add status request
This commit is contained in:
parent
d8142339f9
commit
a714ece3da
2 changed files with 26 additions and 0 deletions
|
@ -71,6 +71,7 @@ namespace ts.server.protocol {
|
|||
SignatureHelp = "signatureHelp",
|
||||
/* @internal */
|
||||
SignatureHelpFull = "signatureHelp-full",
|
||||
Status = "status",
|
||||
TypeDefinition = "typeDefinition",
|
||||
ProjectInfo = "projectInfo",
|
||||
ReloadProjects = "reloadProjects",
|
||||
|
@ -216,6 +217,27 @@ namespace ts.server.protocol {
|
|||
projectFileName?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests status information from the server
|
||||
*/
|
||||
export interface StatusRequest extends Request {
|
||||
command: CommandTypes.Status;
|
||||
}
|
||||
|
||||
export interface StatusResponseBody {
|
||||
/**
|
||||
* the version of the currently-running server.
|
||||
*/
|
||||
version: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Response to StatusRequest
|
||||
*/
|
||||
export interface StatusResponse extends Response {
|
||||
body: StatusResponseBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests a JS Doc comment template for a given position
|
||||
*/
|
||||
|
|
|
@ -1703,6 +1703,10 @@ namespace ts.server {
|
|||
}
|
||||
|
||||
private handlers = createMapFromTemplate<(request: protocol.Request) => HandlerResponse>({
|
||||
[CommandNames.Status]: () => {
|
||||
const response: protocol.StatusResponseBody = { version };
|
||||
return this.requiredResponse(response);
|
||||
},
|
||||
[CommandNames.OpenExternalProject]: (request: protocol.OpenExternalProjectRequest) => {
|
||||
this.projectService.openExternalProject(request.arguments, /*suppressRefreshOfInferredProjects*/ false);
|
||||
// TODO: report errors
|
||||
|
|
Loading…
Reference in a new issue