diff --git a/clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp b/clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp --- a/clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp +++ b/clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// #include "Annotations.h" +#include "Config.h" #include "Protocol.h" #include "SemanticHighlighting.h" #include "SourceCode.h" @@ -1260,6 +1261,17 @@ EXPECT_EQ(Toks[3].deltaStart, 2u); EXPECT_EQ(Toks[3].length, 3u); } + +TEST(SemanticHighlighting, WithHighlightingFilter) { + llvm::StringRef AnnotatedCode = R"cpp( +int *$Variable[[x]] = new int; +)cpp"; + Config Cfg; + Cfg.SemanticTokens.DisabledKinds = { "Operator" }; + Cfg.SemanticTokens.DisabledModifiers = { "Declaration", "Definition" }; + WithContextValue WithCfg(Config::Key, std::move(Cfg)); + checkHighlightings(AnnotatedCode, {}, ~ScopeModifierMask); +} } // namespace } // namespace clangd } // namespace clang