diff --git a/src/server/protocol.ts b/src/server/protocol.ts index 9b406411df..237ce1fd5a 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -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" } /** diff --git a/src/server/session.ts b/src/server/session.ts index a3fcdc7787..99133fbbff 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -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 {