mirror of
https://github.com/coder/code-server.git
synced 2026-05-05 12:05:18 +02:00
Update to VS Code 1.52.1
This commit is contained in:
@@ -17,7 +17,7 @@ import { tmpdir } from 'os';
|
||||
export interface OpenCommandPipeArgs {
|
||||
type: 'open';
|
||||
fileURIs?: string[];
|
||||
folderURIs: string[];
|
||||
folderURIs?: string[];
|
||||
forceNewWindow?: boolean;
|
||||
diffMode?: boolean;
|
||||
addMode?: boolean;
|
||||
@@ -26,6 +26,11 @@ export interface OpenCommandPipeArgs {
|
||||
waitMarkerFilePath?: string;
|
||||
}
|
||||
|
||||
export interface OpenExternalCommandPipeArgs {
|
||||
type: 'openExternal';
|
||||
uris: string[];
|
||||
}
|
||||
|
||||
export interface StatusPipeArgs {
|
||||
type: 'status';
|
||||
}
|
||||
@@ -36,6 +41,8 @@ export interface RunCommandPipeArgs {
|
||||
args: any[];
|
||||
}
|
||||
|
||||
export type PipeCommand = OpenCommandPipeArgs | StatusPipeArgs | RunCommandPipeArgs | OpenExternalCommandPipeArgs;
|
||||
|
||||
export interface ICommandsExecuter {
|
||||
executeCommand<T>(id: string, ...args: any[]): Promise<T>;
|
||||
}
|
||||
@@ -80,11 +87,14 @@ export class CLIServerBase {
|
||||
req.setEncoding('utf8');
|
||||
req.on('data', (d: string) => chunks.push(d));
|
||||
req.on('end', () => {
|
||||
const data: OpenCommandPipeArgs | StatusPipeArgs | RunCommandPipeArgs | any = JSON.parse(chunks.join(''));
|
||||
const data: PipeCommand | any = JSON.parse(chunks.join(''));
|
||||
switch (data.type) {
|
||||
case 'open':
|
||||
this.open(data, res);
|
||||
break;
|
||||
case 'openExternal':
|
||||
this.openExternal(data, res);
|
||||
break;
|
||||
case 'status':
|
||||
this.getStatus(data, res);
|
||||
break;
|
||||
@@ -140,6 +150,14 @@ export class CLIServerBase {
|
||||
res.end();
|
||||
}
|
||||
|
||||
private openExternal(data: OpenExternalCommandPipeArgs, res: http.ServerResponse) {
|
||||
for (const uri of data.uris) {
|
||||
this._commands.executeCommand('_workbench.openExternal', URI.parse(uri), { allowTunneling: true });
|
||||
}
|
||||
res.writeHead(200);
|
||||
res.end();
|
||||
}
|
||||
|
||||
private async getStatus(data: StatusPipeArgs, res: http.ServerResponse) {
|
||||
try {
|
||||
const status = await this._commands.executeCommand('_issues.getSystemStatus');
|
||||
|
||||
Reference in New Issue
Block a user