From 61578a5074943324062e4788fd84b8c468568484 Mon Sep 17 00:00:00 2001 From: Qiming Zhao Date: Tue, 21 Dec 2021 16:12:54 +0800 Subject: [PATCH] feat: register range semantic tokens provider --- src/server/languageProvider.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/server/languageProvider.ts b/src/server/languageProvider.ts index 5ab9072..26368d2 100644 --- a/src/server/languageProvider.ts +++ b/src/server/languageProvider.ts @@ -109,9 +109,14 @@ 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) - 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