feat: register range semantic tokens provider

This commit is contained in:
Qiming Zhao 2021-12-21 16:12:54 +08:00
parent 4b662b57e4
commit 61578a5074

View file

@ -109,9 +109,14 @@ export default class LanguageProvider {
if (this.client.apiVersion.gte(API.v380) && typeof languages['registerCallHierarchyProvider'] === 'function') { if (this.client.apiVersion.gte(API.v380) && typeof languages['registerCallHierarchyProvider'] === 'function') {
this._register(languages.registerCallHierarchyProvider(languageIds, new CallHierarchyProvider(client))) this._register(languages.registerCallHierarchyProvider(languageIds, new CallHierarchyProvider(client)))
} }
if (this.client.apiVersion.gte(API.v370) && typeof languages['registerDocumentSemanticTokensProvider'] === 'function') { if (this.client.apiVersion.gte(API.v370)) {
const provider = new SemanticTokensProvider(client) const provider = new SemanticTokensProvider(client)
this._register(languages.registerDocumentSemanticTokensProvider(languageIds, provider, provider.getLegend())) if (typeof languages['registerDocumentSemanticTokensProvider'] === 'function') {
this._register(languages.registerDocumentSemanticTokensProvider(languageIds, provider, provider.getLegend()))
}
if (typeof languages['registerDocumentRangeSemanticTokensProvider'] === 'function') {
this._register(languages.registerDocumentRangeSemanticTokensProvider(languageIds, provider, provider.getLegend()))
}
} }
let { fileConfigurationManager } = this let { fileConfigurationManager } = this