summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/FindTarget.h
Commit message (Collapse)AuthorAgeFilesLines
* [clangd] Implement semantic highlightings via findExplicitReferencesIlya Biryukov2019-11-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: To keep the logic of finding locations of interesting AST nodes in one place. The advantage is better coverage of various AST nodes, both now and in the future: as new nodes get added to `findExplicitReferences`, semantic highlighting will automatically pick them up. The drawback of this change is that we have to traverse declarations inside our file twice in order to highlight dependent names, 'auto' and 'decltype'. Hopefully, this should not affect the actual latency too much, most time should be spent in building the AST and not traversing it. Reviewers: hokein Reviewed By: hokein Subscribers: nridge, merge_guards_bot, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69673
* [clangd] Report declaration references in findExplicitReferences.Haojian Wu2019-10-181-0/+2
| | | | | | | | | | | | Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68977 llvm-svn: 375226
* [clangd] Change constness of parameters to findExplicitRefsKadir Cetinkaya2019-09-251-2/+2
| | | | | | | | | | | | | | | | | | Summary: Recursive AST requires non-const ast nodes, but it doesn't really mutate them. In addition to that, in clangd we mostly have const ast nodes. So it makes sense to move the const_cast into callee rather than having it at every caller in the future. Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68027 llvm-svn: 372888
* [clangd] Add missing header guard, NFC.Haojian Wu2019-09-251-0/+5
| | | | llvm-svn: 372860
* [clangd] A helper to find explicit references and their namesIlya Biryukov2019-09-251-0/+34
| | | | | | | | | | | | | | | | | | | | | | Summary: Allows to simplify pending code tweaks: - the upcoming DefineInline tweak (D66647) - remove using declaration (D56612) - qualify name under cursor (D56610) Another potential future application is simplifying semantic highlighting. Reviewers: kadircet Reviewed By: kadircet Subscribers: mgrang, jfb, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67826 llvm-svn: 372859
* [clangd] Add targetDecl(), which determines what declaration an AST node ↵Sam McCall2019-09-031-0/+144
refers to. Summary: This is the first part of an effort to "unbundle" our libIndex use into separate concerns (AST traversal, token<->node mapping, node<->decl mapping, decl<->decl relationshipes). Currently, clangd relies on libIndex to associate tokens, AST nodes, and decls. This leads to rather convoluted implementations of e.g. hover and extract-function, which are not naturally thought of as indexing applications. The idea is that by decoupling different concerns, we make them easier to use, test, and combine, and more efficient when only one part is needed. There are some synergies between e.g. traversal and finding relationships between decls, hopefully the benefits outweight these. Reviewers: kadircet, ilya-biryukov Subscribers: mgorny, MaskRay, jkorous, arphaman, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66751 llvm-svn: 370746
OpenPOWER on IntegriCloud