[PATCH] D50958: [clangd] Implement findReferences function

2018-09-05 Thread Sam McCall via Phabricator via cfe-commits
sammccall closed this revision. sammccall added a comment. Oops, I forgot to associate my patch with this review. It landed as https://reviews.llvm.org/rL341458. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50958 ___ cfe-commits

[PATCH] D50958: [clangd] Implement findReferences function

2018-09-05 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clangd/XRefs.cpp:328 + : AST(AST) { +for (const Decl *D : TargetDecls) + Targets.insert(D); hokein wrote: > nit: we can initialize TargetDecls like `Targets(TargetDecls.begin(), > TargetDecls.end())`. In

[PATCH] D50958: [clangd] Implement findReferences function

2018-09-05 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 164004. sammccall added a comment. Finish tests, fix TestTU::index() to include occurrences. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50958 Files: clangd/XRefs.cpp clangd/XRefs.h unittests/clangd/TestTU.cpp unittests/clangd/

[PATCH] D50958: [clangd] Implement findReferences function

2018-09-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. Thanks, looks good from my side. Comment at: clangd/XRefs.cpp:328 + : AST(AST) { +for (const Decl *D : TargetDecls) + Targets.insert(D); nit: w

[PATCH] D50958: [clangd] Implement findReferences function

2018-09-04 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Oops, and I rebased on head (Occurrences -> Refs) of course. @ilya-biryukov @ioeric, any interest in taking over review here? Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50958 ___ cfe-commits mailing l

[PATCH] D50958: [clangd] Implement findReferences function

2018-09-04 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 163834. sammccall added a comment. Address comments and tighten up highlights/refs reuse in XRefs.cpp a bit. Still to do: - test interaction with index, including actual data - maybe add the ClangdServer/LSP binding and lit test, if it's just boilerplate

[PATCH] D50958: [clangd] Implement findReferences function

2018-09-04 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. OK thanks, I'll steal this one. Comment at: clangd/XRefs.cpp:724 + // traversing the AST, and we don't want to make unnecessary queries to the + // index. Howerver, we don't have a reliable way to distinguish file-local + // symbols. We conservativ

[PATCH] D50958: [clangd] Implement findReferences function

2018-09-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In https://reviews.llvm.org/D50958#149, @sammccall wrote: > Looking forward to using this! > > Unless you object, I'd like to address the remaining comments (and get a > review), so you can make the most of your leave! Thanks, feel free to pick it up. The comments m

[PATCH] D50958: [clangd] Implement findReferences function

2018-09-03 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Looking forward to using this! Unless you object, I'd like to address the remaining comments (and get a review), so you can make the most of your leave! Comment at: clangd/XRefs.cpp:333 + +DeclOccurrences[D].emplace_back(FileLoc, Roles); +re

[PATCH] D50958: [clangd] Implement findReferences function

2018-09-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 163654. hokein edited the summary of this revision. hokein added a comment. Rebase Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50958 Files: clangd/XRefs.cpp clangd/XRefs.h unittests/clangd/XRefsTests.cpp Index: unittests/clangd/XRe

[PATCH] D50958: [clangd] Implement findReferences function

2018-08-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/XRefs.cpp:666 +std::vector references(ParsedAST &AST, Position Pos, + bool IncludeDeclaration, + const SymbolIndex *Index) { sammccall wrote: > I'm no