@@ -20,7 +20,6 @@ import {GetComponentsWithTemplateFile, GetTcbParams, GetTcbRequest, GetTcbRespon
2020import { readNgCompletionData , tsCompletionEntryToLspCompletionItem } from './completion' ;
2121import { tsDiagnosticToLspDiagnostic } from './diagnostic' ;
2222import { getHTMLVirtualContent } from './embedded_support' ;
23- import { getSemanticTokens } from './semantic_tokens' ;
2423import { ServerHost } from './server_host' ;
2524import { documentationToMarkdown } from './text_render' ;
2625import { filePathToUri , getMappedDefinitionInfo , isConfiguredProject , isDebugMode , lspPositionToTsPosition , lspRangeToTsPositions , MruTracker , tsDisplayPartsToText , tsFileTextChangesToLspWorkspaceEdit , tsTextSpanToLspRange , uriToFilePath } from './utils' ;
@@ -218,38 +217,8 @@ export class Session {
218217 conn . onSignatureHelp ( p => this . onSignatureHelp ( p ) ) ;
219218 conn . onCodeAction ( p => this . onCodeAction ( p ) ) ;
220219 conn . onCodeActionResolve ( async p => await this . onCodeActionResolve ( p ) ) ;
221- conn . onRequest ( lsp . SemanticTokensRequest . type , p => this . onSemanticTokensRequest ( p ) ) ;
222- conn . onRequest ( lsp . SemanticTokensRangeRequest . type , p => this . onSemanticTokensRangeRequest ( p ) ) ;
223220 }
224221
225- private onSemanticTokensRequest ( params : lsp . SemanticTokensParams ) : lsp . SemanticTokens | null {
226- const lsInfo = this . getLSAndScriptInfo ( params . textDocument ) ;
227- if ( lsInfo === null ) {
228- return null ;
229- }
230- const { languageService, scriptInfo} = lsInfo ;
231- const span = { start : 0 , length : scriptInfo . getSnapshot ( ) . getLength ( ) } ;
232- const classifications = languageService . getEncodedSemanticClassifications (
233- scriptInfo . fileName , span , ts . SemanticClassificationFormat . TwentyTwenty ) ;
234- return getSemanticTokens ( languageService , classifications , scriptInfo ) ;
235- }
236-
237- private onSemanticTokensRangeRequest ( params : lsp . SemanticTokensRangeParams ) : lsp . SemanticTokens
238- | null {
239- const lsInfo = this . getLSAndScriptInfo ( params . textDocument ) ;
240- if ( lsInfo === null ) {
241- return null ;
242- }
243- const { languageService, scriptInfo} = lsInfo ;
244- const start = lspPositionToTsPosition ( lsInfo . scriptInfo , params . range . start ) ;
245- const end = lspPositionToTsPosition ( lsInfo . scriptInfo , params . range . end ) ;
246- const span = { start, length : end - start } ;
247- const classifications = languageService . getEncodedSemanticClassifications (
248- scriptInfo . fileName , span , ts . SemanticClassificationFormat . TwentyTwenty ) ;
249- return getSemanticTokens ( languageService , classifications , scriptInfo ) ;
250- }
251-
252-
253222 private onCodeAction ( params : lsp . CodeActionParams ) : lsp . CodeAction [ ] | null {
254223 const filePath = uriToFilePath ( params . textDocument . uri ) ;
255224 const lsInfo = this . getLSAndScriptInfo ( params . textDocument ) ;
@@ -840,17 +809,6 @@ export class Session {
840809 // [here](https://github.com/angular/vscode-ng-language-service/issues/1828)
841810 codeActionKinds : [ lsp . CodeActionKind . QuickFix ] ,
842811 } ,
843- semanticTokensProvider : {
844- documentSelector : null ,
845- legend : {
846- tokenTypes : [
847- 'class' ,
848- ] ,
849- tokenModifiers : [ ] ,
850- } ,
851- full : true ,
852- range : true
853- }
854812 } ,
855813 serverOptions,
856814 } ;
0 commit comments