mirror of
https://github.com/coder/code-server.git
synced 2026-05-05 12:05:18 +02:00
chore(vscode): update to 1.56.0
This commit is contained in:
@@ -35,12 +35,6 @@ export interface StatusPipeArgs {
|
||||
type: 'status';
|
||||
}
|
||||
|
||||
export interface RunCommandPipeArgs {
|
||||
type: 'command';
|
||||
command: string;
|
||||
args: any[];
|
||||
}
|
||||
|
||||
export interface ExtensionManagementPipeArgs {
|
||||
type: 'extensionManagement';
|
||||
list?: { showVersions?: boolean, category?: string; };
|
||||
@@ -49,7 +43,7 @@ export interface ExtensionManagementPipeArgs {
|
||||
force?: boolean;
|
||||
}
|
||||
|
||||
export type PipeCommand = OpenCommandPipeArgs | StatusPipeArgs | RunCommandPipeArgs | OpenExternalCommandPipeArgs | ExtensionManagementPipeArgs;
|
||||
export type PipeCommand = OpenCommandPipeArgs | StatusPipeArgs | OpenExternalCommandPipeArgs | ExtensionManagementPipeArgs;
|
||||
|
||||
export interface ICommandsExecuter {
|
||||
executeCommand<T>(id: string, ...args: any[]): Promise<T>;
|
||||
@@ -106,10 +100,6 @@ export class CLIServerBase {
|
||||
case 'status':
|
||||
this.getStatus(data, res);
|
||||
break;
|
||||
case 'command':
|
||||
this.runCommand(data, res)
|
||||
.catch(this.logService.error);
|
||||
break;
|
||||
case 'extensionManagement':
|
||||
this.manageExtensions(data, res)
|
||||
.catch(this.logService.error);
|
||||
@@ -156,7 +146,7 @@ export class CLIServerBase {
|
||||
const waitMarkerFileURI = waitMarkerFilePath ? URI.file(waitMarkerFilePath) : undefined;
|
||||
const preferNewWindow = !forceReuseWindow && !waitMarkerFileURI && !addMode;
|
||||
const windowOpenArgs: IOpenWindowOptions = { forceNewWindow, diffMode, addMode, gotoLineMode, forceReuseWindow, preferNewWindow, waitMarkerFileURI };
|
||||
this._commands.executeCommand('_files.windowOpen', urisToOpen, windowOpenArgs);
|
||||
this._commands.executeCommand('_remoteCLI.windowOpen', urisToOpen, windowOpenArgs);
|
||||
}
|
||||
res.writeHead(200);
|
||||
res.end();
|
||||
@@ -197,7 +187,7 @@ export class CLIServerBase {
|
||||
|
||||
private async getStatus(data: StatusPipeArgs, res: http.ServerResponse) {
|
||||
try {
|
||||
const status = await this._commands.executeCommand('_issues.getSystemStatus');
|
||||
const status = await this._commands.executeCommand('_remoteCLI.getSystemStatus');
|
||||
res.writeHead(200);
|
||||
res.write(status);
|
||||
res.end();
|
||||
@@ -212,28 +202,6 @@ export class CLIServerBase {
|
||||
}
|
||||
}
|
||||
|
||||
private async runCommand(data: RunCommandPipeArgs, res: http.ServerResponse) {
|
||||
try {
|
||||
const { command, args } = data;
|
||||
const result = await this._commands.executeCommand(command, ...args);
|
||||
res.writeHead(200);
|
||||
res.write(JSON.stringify(result), err => {
|
||||
if (err) {
|
||||
this.logService.error(err);
|
||||
}
|
||||
});
|
||||
res.end();
|
||||
} catch (err) {
|
||||
res.writeHead(500);
|
||||
res.write(String(err), err => {
|
||||
if (err) {
|
||||
this.logService.error(err);
|
||||
}
|
||||
});
|
||||
res.end();
|
||||
}
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
this._server.close();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user