[PATCH] D65637: [clangd] [WIP] Semantic highlighting prototype for the vscode extension.

Johan Vikström via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 2 04:28:39 PDT 2019


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


================
Comment at: clang-tools-extra/clangd/clients/clangd-vscode/src/TextMate.ts:20
+            const split = scope.split('.');
+            while(split.length > 0) {
+                split.splice(-1)
----------------
I'm pretty sure this matching logic is wrong. An example of the scopes for variables in the Light+ theme:

```
variable.css
variable.scss
variable.other.less
variable.language.wildcard.java
variable.language
storage.type.variable.cs
variable
meta.definition.variable.name
support.variable
entity.name.variable
```

With this kind of matching we have now this means that `variable.other.less` will match `variable.other` and `variable.other.less`.
As there is no perfect match for `variable.other.field` it will try to match `variable.other` and find the color for less.

What should probably be done is remove the divided map. The query function should still be the same but  query on this.colors instead of this.divided.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65637





More information about the cfe-commits mailing list