Skip to content

Commit

Permalink
Merge pull request #3789 from JoeRobich/classify-excluded-code
Browse files Browse the repository at this point in the history
Classify excluded code
  • Loading branch information
JoeRobich authored May 16, 2020
2 parents 5b64b62 + 3a07cbc commit 1fe37dc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3087,6 +3087,10 @@
"id": "preprocessorText",
"description": "Represents"
},
{
"id": "excludedCode",
"description": ""
},
{
"id": "punctuation",
"description": ""
Expand Down Expand Up @@ -3180,6 +3184,9 @@
"preprocessorText": [
"meta.preprocessor.string.cs"
],
"excludedCode": [
"support.other.excluded.cs"
],
"punctuation": [
"punctuation.cs"
],
Expand Down
4 changes: 3 additions & 1 deletion src/features/semanticTokensProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ enum CustomTokenType {
operatorOverloaded,
preprocessorKeyword,
preprocessorText,
excludedCode,
punctuation,
stringVerbatim,
stringEscapeCharacter,
Expand Down Expand Up @@ -261,6 +262,7 @@ tokenTypes[CustomTokenType.controlKeyword] = "controlKeyword";
tokenTypes[CustomTokenType.operatorOverloaded] = "operatorOverloaded";
tokenTypes[CustomTokenType.preprocessorKeyword] = "preprocessorKeyword";
tokenTypes[CustomTokenType.preprocessorText] = "preprocessorText";
tokenTypes[CustomTokenType.excludedCode] = "excludedCode";
tokenTypes[CustomTokenType.punctuation] = "punctuation";
tokenTypes[CustomTokenType.stringVerbatim] = "stringVerbatim";
tokenTypes[CustomTokenType.stringEscapeCharacter] = "stringEscapeCharacter";
Expand Down Expand Up @@ -291,7 +293,7 @@ tokenModifiers[DefaultTokenModifier.readonly] = 'readonly';

const tokenTypeMap: number[] = [];
tokenTypeMap[SemanticHighlightClassification.Comment] = DefaultTokenType.comment;
tokenTypeMap[SemanticHighlightClassification.ExcludedCode] = undefined;
tokenTypeMap[SemanticHighlightClassification.ExcludedCode] = CustomTokenType.excludedCode;
tokenTypeMap[SemanticHighlightClassification.Identifier] = DefaultTokenType.variable;
tokenTypeMap[SemanticHighlightClassification.Keyword] = CustomTokenType.plainKeyword;
tokenTypeMap[SemanticHighlightClassification.ControlKeyword] = CustomTokenType.controlKeyword;
Expand Down

0 comments on commit 1fe37dc

Please sign in to comment.