summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/SemanticHighlighting.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clangd/SemanticHighlighting.cpp')
-rw-r--r--clang-tools-extra/clangd/SemanticHighlighting.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/SemanticHighlighting.cpp b/clang-tools-extra/clangd/SemanticHighlighting.cpp
index babab5e66ce..f51e868e7a0 100644
--- a/clang-tools-extra/clangd/SemanticHighlighting.cpp
+++ b/clang-tools-extra/clangd/SemanticHighlighting.cpp
@@ -11,6 +11,7 @@
#include "Protocol.h"
#include "SourceCode.h"
#include "clang/AST/ASTContext.h"
+#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include <algorithm>
@@ -200,6 +201,10 @@ private:
addToken(Loc, HighlightingKind::EnumConstant);
return;
}
+ if (isa<ParmVarDecl>(D)) {
+ addToken(Loc, HighlightingKind::Parameter);
+ return;
+ }
if (isa<VarDecl>(D)) {
addToken(Loc, HighlightingKind::Variable);
return;
@@ -406,6 +411,8 @@ llvm::StringRef toTextMateScope(HighlightingKind Kind) {
return "entity.name.function.method.cpp";
case HighlightingKind::Variable:
return "variable.other.cpp";
+ case HighlightingKind::Parameter:
+ return "variable.parameter.cpp";
case HighlightingKind::Field:
return "variable.other.field.cpp";
case HighlightingKind::Class:
OpenPOWER on IntegriCloud