This revision was automatically updated to reflect the committed changes. Closed by commit rCTE353696: [clangd] Index parameters in function decls (authored by kadircet, committed by ).
Changed prior to commit: https://reviews.llvm.org/D57950?vs=185967&id=186235#toc Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57950/new/ https://reviews.llvm.org/D57950 Files: clangd/XRefs.cpp unittests/clangd/SymbolInfoTests.cpp unittests/clangd/XRefsTests.cpp Index: unittests/clangd/SymbolInfoTests.cpp =================================================================== --- unittests/clangd/SymbolInfoTests.cpp +++ unittests/clangd/SymbolInfoTests.cpp @@ -302,6 +302,12 @@ )cpp", {CreateExpectedSymbolDetails("bar", "foo::", "c:@E@foo@bar")}}, { + R"cpp( // Parameters in declarations + void foo(int ba^r); + )cpp", + {CreateExpectedSymbolDetails("bar", "foo", + "c:TestTU.cpp@50@F@foo#I#@bar")}}, + { R"cpp( // Type inferrence with auto keyword struct foo {}; foo getfoo() { return foo{}; } Index: unittests/clangd/XRefsTests.cpp =================================================================== --- unittests/clangd/XRefsTests.cpp +++ unittests/clangd/XRefsTests.cpp @@ -86,6 +86,10 @@ auto *X = &[[foo]]; } )cpp", + + R"cpp(// Function parameter in decl + void foo(int [[^bar]]); + )cpp", }; for (const char *Test : Tests) { Annotations T(Test); Index: clangd/XRefs.cpp =================================================================== --- clangd/XRefs.cpp +++ clangd/XRefs.cpp @@ -215,6 +215,7 @@ IndexOpts.SystemSymbolFilter = index::IndexingOptions::SystemSymbolFilterKind::All; IndexOpts.IndexFunctionLocals = true; + IndexOpts.IndexParametersInDeclarations = true; indexTopLevelDecls(AST.getASTContext(), AST.getPreprocessor(), AST.getLocalTopLevelDecls(), DeclMacrosFinder, IndexOpts); @@ -400,6 +401,7 @@ IndexOpts.SystemSymbolFilter = index::IndexingOptions::SystemSymbolFilterKind::All; IndexOpts.IndexFunctionLocals = true; + IndexOpts.IndexParametersInDeclarations = true; indexTopLevelDecls(AST.getASTContext(), AST.getPreprocessor(), AST.getLocalTopLevelDecls(), RefFinder, IndexOpts); return std::move(RefFinder).take();
Index: unittests/clangd/SymbolInfoTests.cpp =================================================================== --- unittests/clangd/SymbolInfoTests.cpp +++ unittests/clangd/SymbolInfoTests.cpp @@ -302,6 +302,12 @@ )cpp", {CreateExpectedSymbolDetails("bar", "foo::", "c:@E@foo@bar")}}, { + R"cpp( // Parameters in declarations + void foo(int ba^r); + )cpp", + {CreateExpectedSymbolDetails("bar", "foo", + "c:TestTU.cpp@50@F@foo#I#@bar")}}, + { R"cpp( // Type inferrence with auto keyword struct foo {}; foo getfoo() { return foo{}; } Index: unittests/clangd/XRefsTests.cpp =================================================================== --- unittests/clangd/XRefsTests.cpp +++ unittests/clangd/XRefsTests.cpp @@ -86,6 +86,10 @@ auto *X = &[[foo]]; } )cpp", + + R"cpp(// Function parameter in decl + void foo(int [[^bar]]); + )cpp", }; for (const char *Test : Tests) { Annotations T(Test); Index: clangd/XRefs.cpp =================================================================== --- clangd/XRefs.cpp +++ clangd/XRefs.cpp @@ -215,6 +215,7 @@ IndexOpts.SystemSymbolFilter = index::IndexingOptions::SystemSymbolFilterKind::All; IndexOpts.IndexFunctionLocals = true; + IndexOpts.IndexParametersInDeclarations = true; indexTopLevelDecls(AST.getASTContext(), AST.getPreprocessor(), AST.getLocalTopLevelDecls(), DeclMacrosFinder, IndexOpts); @@ -400,6 +401,7 @@ IndexOpts.SystemSymbolFilter = index::IndexingOptions::SystemSymbolFilterKind::All; IndexOpts.IndexFunctionLocals = true; + IndexOpts.IndexParametersInDeclarations = true; indexTopLevelDecls(AST.getASTContext(), AST.getPreprocessor(), AST.getLocalTopLevelDecls(), RefFinder, IndexOpts); return std::move(RefFinder).take();
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits