[clangd] ObjC fixes for semantic highlighting and xref highlights
authorSam McCall <sam.mccall@gmail.com>
Sat, 27 Feb 2021 21:08:07 +0000 (22:08 +0100)
committerSam McCall <sam.mccall@gmail.com>
Wed, 3 Mar 2021 19:16:08 +0000 (20:16 +0100)
commit7d2fba8ddb90cf018d9cfc852b68e4584b15678e
tree758d049b1f40dafc804ca1882f98f7536973da7c
parent87e854a578531dadebda3c5f2a380426a61f26be
[clangd] ObjC fixes for semantic highlighting and xref highlights

- highlight references to protocols in class/protocol/extension decls
- support multi-token selector highlights in semantic + xref highlights
  (method calls and declarations only)
- In `@interface I(C)`, I now references the interface and C the category
- highlight uses of interfaces as types
- added semantic highlightings of protocol names (as "interface") and
  category names (as "namespace").
  These are both standard kinds, maybe "extension" will be standardized...
- highlight `auto` as "class" when it resolves to an ObjC pointer
- don't highlight `self` as a variable even though the AST models it as one

Not fixed: uses of protocols in type names (needs some refactoring of
unrelated code first)

Differential Revision: https://reviews.llvm.org/D97617
clang-tools-extra/clangd/FindTarget.cpp
clang-tools-extra/clangd/SemanticHighlighting.cpp
clang-tools-extra/clangd/SemanticHighlighting.h
clang-tools-extra/clangd/XRefs.cpp
clang-tools-extra/clangd/unittests/FindTargetTests.cpp
clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp
clang-tools-extra/clangd/unittests/XRefsTests.cpp