-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd7035a
commit aff8a1f
Showing
5 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { BaseLanguageClient, ClientCapabilities, ServerCapabilities, StaticFeature } from 'vscode-languageclient'; | ||
|
||
export class CustomSemanticTokens implements StaticFeature { | ||
constructor( | ||
private _client: BaseLanguageClient, | ||
private extTokenTypes: string[], | ||
private extTokenModifiers: string[], | ||
) {} | ||
|
||
public fillClientCapabilities(capabilities: ClientCapabilities): void { | ||
if (!capabilities.textDocument || !capabilities.textDocument.semanticTokens) { | ||
return; | ||
} | ||
|
||
const tokenTypes = capabilities.textDocument.semanticTokens.tokenTypes; | ||
capabilities.textDocument.semanticTokens.tokenTypes = tokenTypes.concat(this.extTokenTypes); | ||
|
||
const tokenModifiers = capabilities.textDocument.semanticTokens.tokenModifiers; | ||
capabilities.textDocument.semanticTokens.tokenModifiers = tokenModifiers.concat(this.extTokenModifiers); | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
public initialize(capabilities: ServerCapabilities): void { | ||
return; | ||
} | ||
|
||
public dispose(): void { | ||
return; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters