[clangd] Implement semantic highlightings via findExplicitReferences

Authored by ilya-biryukov on Nov 5 2019, 10:06 AM.


[clangd] Implement semantic highlightings via findExplicitReferences

To keep the logic of finding locations of interesting AST nodes in one

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