Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/server/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,11 @@ namespace ts.server.protocol {
* Length of the span.
*/
length: number;
/**
* Optional parameter for the semantic highlighting response, if absent it
* defaults to "original".
*/
format?: "original" | "2020"
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/server/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,8 @@ namespace ts.server {

private getEncodedSemanticClassifications(args: protocol.EncodedSemanticClassificationsRequestArgs) {
const { file, project } = this.getFileAndProject(args);
return project.getLanguageService().getEncodedSemanticClassifications(file, args);
const format = args.format === "2020" ? SemanticClassificationFormat.TwentyTwenty : SemanticClassificationFormat.Original;
return project.getLanguageService().getEncodedSemanticClassifications(file, args, format);
}

private getProject(projectFileName: string | undefined): Project | undefined {
Expand Down