mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Trivially expose getEncodedSyntacticClassifications
This commit is contained in:
@@ -94,6 +94,8 @@ namespace ts.server.protocol {
|
||||
ApplyChangedToOpenFiles = "applyChangedToOpenFiles",
|
||||
UpdateOpen = "updateOpen",
|
||||
/* @internal */
|
||||
EncodedSyntacticClassificationsFull = "encodedSyntacticClassifications-full",
|
||||
/* @internal */
|
||||
EncodedSemanticClassificationsFull = "encodedSemanticClassifications-full",
|
||||
/* @internal */
|
||||
Cleanup = "cleanup",
|
||||
@@ -764,6 +766,28 @@ namespace ts.server.protocol {
|
||||
body?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* A request to get encoded Syntactic classifications for a span in the file
|
||||
*/
|
||||
/** @internal */
|
||||
export interface EncodedSyntacticClassificationsRequest extends FileRequest {
|
||||
arguments: EncodedSyntacticClassificationsRequestArgs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Arguments for EncodedSyntacticClassificationsRequest request.
|
||||
*/
|
||||
export interface EncodedSyntacticClassificationsRequestArgs extends FileRequestArgs {
|
||||
/**
|
||||
* Start position of the span.
|
||||
*/
|
||||
start: number;
|
||||
/**
|
||||
* Length of the span.
|
||||
*/
|
||||
length: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* A request to get encoded semantic classifications for a span in the file
|
||||
*/
|
||||
|
||||
@@ -881,6 +881,11 @@ namespace ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
private getEncodedSyntacticClassifications(args: protocol.EncodedSyntacticClassificationsRequestArgs) {
|
||||
const { file, project } = this.getFileAndProject(args);
|
||||
return project.getLanguageService().getEncodedSyntacticClassifications(file, args);
|
||||
}
|
||||
|
||||
private getEncodedSemanticClassifications(args: protocol.EncodedSemanticClassificationsRequestArgs) {
|
||||
const { file, project } = this.getFileAndProject(args);
|
||||
return project.getLanguageService().getEncodedSemanticClassifications(file, args);
|
||||
@@ -2299,6 +2304,9 @@ namespace ts.server {
|
||||
[CommandNames.CompilerOptionsDiagnosticsFull]: (request: protocol.CompilerOptionsDiagnosticsRequest) => {
|
||||
return this.requiredResponse(this.getCompilerOptionsDiagnostics(request.arguments));
|
||||
},
|
||||
[CommandNames.EncodedSyntacticClassificationsFull]: (request: protocol.EncodedSyntacticClassificationsRequest) => {
|
||||
return this.requiredResponse(this.getEncodedSyntacticClassifications(request.arguments));
|
||||
},
|
||||
[CommandNames.EncodedSemanticClassificationsFull]: (request: protocol.EncodedSemanticClassificationsRequest) => {
|
||||
return this.requiredResponse(this.getEncodedSemanticClassifications(request.arguments));
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user