[PATCH] D67901: [clangd] Improve semantic highlighting in dependent contexts (fixes #154)

Nathan Ridge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 24 13:23:23 PDT 2019


nridge marked an inline comment as done.
nridge added inline comments.


================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:181
+      addToken(E->getMemberLoc(), E->getQualifier()
+                                      ? HighlightingKind::StaticField
+                                      : HighlightingKind::Field);
----------------
hokein wrote:
> This could be member functions, a case is like
> 
> ```
> template<class T>
> class Foo {
> public:
>   void foo() {
>     this->foo();
>   }
> };
> ```
Thanks for the example.

Do you have a suggestion for how to discriminate this case? To me, it would seem logical to do it based on syntax (highlight as a member function if the expression forms the function name of a function call expression). That would require navigating from the expression to its parent node. Is there a way to do that?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67901/new/

https://reviews.llvm.org/D67901





More information about the cfe-commits mailing list