WIP-semantic in session based TS (#42438)

This commit is contained in:
Orta Therox 2021-01-23 13:13:56 +00:00 committed by GitHub
parent 63003eb106
commit 154f2094fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -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"
}
/**

View file

@ -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 {