10919: internal: Define missing semantic token hierarchies in package.json r=Veykril a=Veykril

Closes https://github.com/rust-analyzer/rust-analyzer/issues/10077
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
bors[bot] 2021-12-03 22:53:32 +00:00 committed by GitHub
commit 348110dcd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1112,29 +1112,124 @@
} }
], ],
"semanticTokenTypes": [ "semanticTokenTypes": [
{
"id": "angle",
"description": "Style for < or >",
"superType": "punctuation"
},
{
"id": "arithmetic",
"description": "Style for arithmetic operators",
"superType": "operator"
},
{ {
"id": "attribute", "id": "attribute",
"description": "Style for attributes" "description": "Style for attributes"
}, },
{
"id": "bitwise",
"description": "Style for bitwise operators",
"superType": "operator"
},
{ {
"id": "boolean", "id": "boolean",
"description": "Style for boolean literals", "description": "Style for boolean literals",
"superType": "keyword" "superType": "keyword"
}, },
{
"id": "brace",
"description": "Style for { or }",
"superType": "punctuation"
},
{
"id": "bracket",
"description": "Style for [ or ]",
"superType": "punctuation"
},
{
"id": "builtinAttribute",
"description": "Style for builtin attributes",
"superType": "attribute"
},
{ {
"id": "builtinType", "id": "builtinType",
"description": "Style for builtin types", "description": "Style for builtin types",
"superType": "type" "superType": "type"
}, },
{
"id": "char",
"description": "Style for character literals",
"superType": "type"
},
{
"id": "colon",
"description": "Style for :",
"superType": "punctuation"
},
{
"id": "comma",
"description": "Style for ,",
"superType": "punctuation"
},
{
"id": "comparison",
"description": "Style for comparison operators",
"superType": "operator"
},
{
"id": "constParameter",
"description": "Style for const generics"
},
{
"id": "dot",
"description": "Style for .",
"superType": "punctuation"
},
{
"id": "escapeSequence",
"description": "Style for char escapes in strings"
},
{
"id": "formatSpecifier",
"description": "Style for {} placeholders in format strings"
},
{
"id": "label",
"description": "Style for labels"
},
{ {
"id": "lifetime", "id": "lifetime",
"description": "Style for lifetimes" "description": "Style for lifetimes"
}, },
{
"id": "logical",
"description": "Style for logic operators",
"superType": "operator"
},
{
"id": "operator",
"description": "Style for operators",
"superType": "punctuation"
},
{
"id": "parenthesis",
"description": "Style for ( or )",
"superType": "punctuation"
},
{
"id": "punctuation",
"description": "Style for generic punctuation"
},
{ {
"id": "selfKeyword", "id": "selfKeyword",
"description": "Style for the self keyword", "description": "Style for the self keyword",
"superType": "keyword" "superType": "keyword"
}, },
{
"id": "semicolon",
"description": "Style for ;",
"superType": "punctuation"
},
{ {
"id": "typeAlias", "id": "typeAlias",
"description": "Style for type aliases", "description": "Style for type aliases",
@ -1148,54 +1243,6 @@
{ {
"id": "unresolvedReference", "id": "unresolvedReference",
"description": "Style for names which can not be resolved due to compilation errors" "description": "Style for names which can not be resolved due to compilation errors"
},
{
"id": "formatSpecifier",
"description": "Style for {} placeholders in format strings"
},
{
"id": "punctuation",
"description": "generic punctuation"
},
{
"id": "parenthesis",
"description": "( or )",
"superType": "punctuation"
},
{
"id": "bracket",
"description": "[ or ]",
"superType": "punctuation"
},
{
"id": "brace",
"description": "{ or }",
"superType": "punctuation"
},
{
"id": "angle",
"description": "< or >",
"superType": "punctuation"
},
{
"id": "comma",
"description": ",",
"superType": "punctuation"
},
{
"id": "colon",
"description": ":",
"superType": "punctuation"
},
{
"id": "semicolon",
"description": ";",
"superType": "punctuation"
},
{
"id": "dot",
"description": ".",
"superType": "punctuation"
} }
], ],
"semanticTokenModifiers": [ "semanticTokenModifiers": [
@ -1207,14 +1254,14 @@
"id": "attribute", "id": "attribute",
"description": "Style for elements within attributes" "description": "Style for elements within attributes"
}, },
{
"id": "constant",
"description": "Style for compile-time constants"
},
{ {
"id": "callable", "id": "callable",
"description": "Style for locals whose types implements one of the `Fn*` traits" "description": "Style for locals whose types implements one of the `Fn*` traits"
}, },
{
"id": "constant",
"description": "Style for compile-time constants"
},
{ {
"id": "consuming", "id": "consuming",
"description": "Style for locals that are being consumed when use in a function call" "description": "Style for locals that are being consumed when use in a function call"
@ -1224,8 +1271,8 @@
"description": "Style for control-flow related tokens, this includes the `?` operator" "description": "Style for control-flow related tokens, this includes the `?` operator"
}, },
{ {
"id": "definition", "id": "crateRoot",
"description": "Style for mutable bindings" "description": "Style for names resolving to a crate root"
}, },
{ {
"id": "injected", "id": "injected",
@ -1267,26 +1314,26 @@
"attribute": [ "attribute": [
"meta.attribute.rust" "meta.attribute.rust"
], ],
"function.attribute": [
"entity.name.function.attribute.rust"
],
"boolean": [ "boolean": [
"constant.language.boolean.rust" "constant.language.boolean.rust"
], ],
"builtinType": [ "builtinType": [
"support.type.primitive.rust" "support.type.primitive.rust"
], ],
"lifetime": [ "constParameter": [
"storage.modifier.lifetime.rust" "constant.other.caps.rust"
], ],
"typeAlias": [ "enum": [
"entity.name.type.typeAlias.rust" "entity.name.type.enum.rust"
], ],
"union": [ "formatSpecifier": [
"entity.name.type.union.rust" "punctuation.section.embedded.rust"
], ],
"struct": [ "function": [
"entity.name.type.struct.rust" "entity.name.function.rust"
],
"interface": [
"entity.name.type.trait.rust"
], ],
"keyword": [ "keyword": [
"keyword.other.rust" "keyword.other.rust"
@ -1294,12 +1341,27 @@
"keyword.controlFlow": [ "keyword.controlFlow": [
"keyword.control.rust" "keyword.control.rust"
], ],
"lifetime": [
"storage.modifier.lifetime.rust"
],
"method": [
"entity.name.function.rust"
],
"struct": [
"entity.name.type.struct.rust"
],
"typeAlias": [
"entity.name.type.declaration.rust"
],
"union": [
"entity.name.type.union.rust"
],
"variable": [
"variable.other.rust"
],
"variable.constant": [ "variable.constant": [
"variable.other.constant.rust" "variable.other.constant.rust"
], ],
"formatSpecifier": [
"punctuation.section.embedded.rust"
],
"*.mutable": [ "*.mutable": [
"markup.underline" "markup.underline"
] ]