[clang-tools-extra] de5b0b7 - [clangd] semanticTokens: fields are 'property', not 'member'

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 20 11:53:26 PST 2020


Author: Sam McCall
Date: 2020-11-20T20:53:12+01:00
New Revision: de5b0b776fd7de72078256e003ede4fb5c37cdcb

URL: https://github.com/llvm/llvm-project/commit/de5b0b776fd7de72078256e003ede4fb5c37cdcb
DIFF: https://github.com/llvm/llvm-project/commit/de5b0b776fd7de72078256e003ede4fb5c37cdcb.diff

LOG: [clangd] semanticTokens: fields are 'property', not 'member'

This isn't obvious, but vscode maps member as 'entity.name.function.member',
so it's really for member functions.

Fixes https://github.com/clangd/vscode-clangd/issues/105

Added: 
    

Modified: 
    clang-tools-extra/clangd/SemanticHighlighting.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/SemanticHighlighting.cpp b/clang-tools-extra/clangd/SemanticHighlighting.cpp
index a9c885c7275e..1a78e7a8c0da 100644
--- a/clang-tools-extra/clangd/SemanticHighlighting.cpp
+++ b/clang-tools-extra/clangd/SemanticHighlighting.cpp
@@ -561,7 +561,8 @@ llvm::StringRef toSemanticTokenType(HighlightingKind Kind) {
     // FIXME: better function/member with static modifier?
     return "function";
   case HighlightingKind::Field:
-    return "member";
+    // Not "member": https://github.com/clangd/vscode-clangd/issues/105
+    return "property";
   case HighlightingKind::Class:
     return "class";
   case HighlightingKind::Enum:


        


More information about the cfe-commits mailing list