mirror of
https://github.com/MaskRay/ccls.git
synced 2025-07-14 19:50:12 +00:00
This patch implements `textDocument/semanticTokens/{full,range}`. If the client supports semantic tokens, $ccls/publishSemanticHighlight (now deprecated) is disabled. These token modifiers are mostly useful to emphasize certain symbols: `static, classScope, globalScope, namespaceScope`. To enable a colorful syntax highlighting scheme, set the highlight.rainbow initialization option to 10. https://maskray.me/blog/2024-10-20-ccls-and-lsp-semantic-tokens Note that the older $ccls/publishSemanticHighlight protocol with highlight.lsRanges==true (used by vscode-ccls) is no longer supported.
37 lines
996 B
SQL
37 lines
996 B
SQL
#ifndef TOKEN_MODIFIER
|
|
#define TOKEN_MODIFIER(name, str)
|
|
#endif
|
|
// vscode
|
|
TOKEN_MODIFIER(Declaration, "declaration")
|
|
TOKEN_MODIFIER(Definition, "definition")
|
|
TOKEN_MODIFIER(Static, "static")
|
|
|
|
// ccls extensions
|
|
TOKEN_MODIFIER(Read, "read")
|
|
TOKEN_MODIFIER(Write, "write")
|
|
TOKEN_MODIFIER(ClassScope, "classScope")
|
|
TOKEN_MODIFIER(FunctionScope, "functionScope")
|
|
TOKEN_MODIFIER(NamespaceScope, "namespaceScope")
|
|
|
|
// Rainbow semantic tokens
|
|
TOKEN_MODIFIER(Id0, "id0")
|
|
TOKEN_MODIFIER(Id1, "id1")
|
|
TOKEN_MODIFIER(Id2, "id2")
|
|
TOKEN_MODIFIER(Id3, "id3")
|
|
TOKEN_MODIFIER(Id4, "id4")
|
|
TOKEN_MODIFIER(Id5, "id5")
|
|
TOKEN_MODIFIER(Id6, "id6")
|
|
TOKEN_MODIFIER(Id7, "id7")
|
|
TOKEN_MODIFIER(Id8, "id8")
|
|
TOKEN_MODIFIER(Id9, "id9")
|
|
TOKEN_MODIFIER(Id10, "id10")
|
|
TOKEN_MODIFIER(Id11, "id11")
|
|
TOKEN_MODIFIER(Id12, "id12")
|
|
TOKEN_MODIFIER(Id13, "id13")
|
|
TOKEN_MODIFIER(Id14, "id14")
|
|
TOKEN_MODIFIER(Id15, "id15")
|
|
TOKEN_MODIFIER(Id16, "id16")
|
|
TOKEN_MODIFIER(Id17, "id17")
|
|
TOKEN_MODIFIER(Id18, "id18")
|
|
TOKEN_MODIFIER(Id19, "id19")
|