@@ -20,7 +20,6 @@ import {GetComponentsWithTemplateFile, GetTcbParams, GetTcbRequest, GetTcbRespon
20
20
import { readNgCompletionData , tsCompletionEntryToLspCompletionItem } from './completion' ;
21
21
import { tsDiagnosticToLspDiagnostic } from './diagnostic' ;
22
22
import { getHTMLVirtualContent } from './embedded_support' ;
23
- import { getSemanticTokens } from './semantic_tokens' ;
24
23
import { ServerHost } from './server_host' ;
25
24
import { documentationToMarkdown } from './text_render' ;
26
25
import { filePathToUri , getMappedDefinitionInfo , isConfiguredProject , isDebugMode , lspPositionToTsPosition , lspRangeToTsPositions , MruTracker , tsDisplayPartsToText , tsFileTextChangesToLspWorkspaceEdit , tsTextSpanToLspRange , uriToFilePath } from './utils' ;
@@ -218,38 +217,8 @@ export class Session {
218
217
conn . onSignatureHelp ( p => this . onSignatureHelp ( p ) ) ;
219
218
conn . onCodeAction ( p => this . onCodeAction ( p ) ) ;
220
219
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 ) ) ;
223
220
}
224
221
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
-
253
222
private onCodeAction ( params : lsp . CodeActionParams ) : lsp . CodeAction [ ] | null {
254
223
const filePath = uriToFilePath ( params . textDocument . uri ) ;
255
224
const lsInfo = this . getLSAndScriptInfo ( params . textDocument ) ;
@@ -840,17 +809,6 @@ export class Session {
840
809
// [here](https://github.com/angular/vscode-ng-language-service/issues/1828)
841
810
codeActionKinds : [ lsp . CodeActionKind . QuickFix ] ,
842
811
} ,
843
- semanticTokensProvider : {
844
- documentSelector : null ,
845
- legend : {
846
- tokenTypes : [
847
- 'class' ,
848
- ] ,
849
- tokenModifiers : [ ] ,
850
- } ,
851
- full : true ,
852
- range : true
853
- }
854
812
} ,
855
813
serverOptions,
856
814
} ;
0 commit comments