Skip to content

Commit 154f209

Browse files
author
Orta Therox
authored
WIP-semantic in session based TS (#42438)
1 parent 63003eb commit 154f209

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/server/protocol.ts

+5
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,11 @@ namespace ts.server.protocol {
861861
* Length of the span.
862862
*/
863863
length: number;
864+
/**
865+
* Optional parameter for the semantic highlighting response, if absent it
866+
* defaults to "original".
867+
*/
868+
format?: "original" | "2020"
864869
}
865870

866871
/**

src/server/session.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,8 @@ namespace ts.server {
11151115

11161116
private getEncodedSemanticClassifications(args: protocol.EncodedSemanticClassificationsRequestArgs) {
11171117
const { file, project } = this.getFileAndProject(args);
1118-
return project.getLanguageService().getEncodedSemanticClassifications(file, args);
1118+
const format = args.format === "2020" ? SemanticClassificationFormat.TwentyTwenty : SemanticClassificationFormat.Original;
1119+
return project.getLanguageService().getEncodedSemanticClassifications(file, args, format);
11191120
}
11201121

11211122
private getProject(projectFileName: string | undefined): Project | undefined {

0 commit comments

Comments
 (0)