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,10 +109,15 @@ export default class LanguageProvider {
if (this.client.apiVersion.gte(API.v380) && typeof languages['registerCallHierarchyProvider'] === 'function') {
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)
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 conf = fileConfigurationManager.getLanguageConfiguration(this.id)