Skip to content

Commit e6d1f2a

Browse files
committed
Update VS Code to 1.41.0
1 parent 44c4722 commit e6d1f2a

15 files changed

+337
-350
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66

77
before_install:
88
- export MAJOR_VERSION="2"
9-
- export VSCODE_VERSION="1.39.2"
9+
- export VSCODE_VERSION="1.41.0"
1010
- export VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER"
1111
- export TAG="$VERSION-vsc$VSCODE_VERSION"
1212
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then export MINIFY="true"; fi

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,6 @@ Our changes include:
174174
- Modify the loader, websocket, webview, service worker, and asset requests to
175175
use the URL of the page as a base (and TLS if necessary for the websocket).
176176
- Send client-side telemetry through the server.
177-
- Add an upload service along with a file prefix to ignore for temporary files
178-
created during upload.
179177
- Make changing the display language work.
180178
- Make it possible for us to load code on the client.
181179
- Make extensions work in the browser.

scripts/build.ts

-20
Original file line numberDiff line numberDiff line change
@@ -339,26 +339,6 @@ class Builder {
339339
]);
340340
});
341341

342-
// onigasm 2.2.2 has a bug that makes it broken for PHP files so use 2.2.1.
343-
// https://github.com/NeekSandhu/onigasm/issues/17
344-
await this.task("Applying onigasm PHP fix", async () => {
345-
const onigasmPath = path.join(finalBuildPath, "node_modules/onigasm-umd");
346-
const onigasmTmpPath = `${onigasmPath}-temp`;
347-
await Promise.all([
348-
fs.remove(onigasmPath),
349-
fs.mkdir(onigasmTmpPath),
350-
]);
351-
await util.promisify(cp.exec)(`git clone "https://github.com/alexandrudima/onigasm-umd" "${onigasmPath}"`);
352-
await util.promisify(cp.exec)("yarn", { cwd: onigasmPath });
353-
await util.promisify(cp.exec)("yarn add --dev [email protected]", { cwd: onigasmPath });
354-
await util.promisify(cp.exec)("yarn package", { cwd: onigasmPath });
355-
await Promise.all(["release", "LICENSE", "package.json"].map((fileName) => {
356-
return fs.copy(path.join(onigasmPath, fileName), path.join(onigasmTmpPath, fileName));
357-
}));
358-
await fs.remove(onigasmPath);
359-
await fs.move(onigasmTmpPath, onigasmPath);
360-
});
361-
362342
this.log(`Final build: ${finalBuildPath}`);
363343
}
364344

scripts/vscode.patch

+173-210
Large diffs are not rendered by default.

src/browser/api.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { ITelemetryService } from "vs/platform/telemetry/common/telemetry";
2121
import { IThemeService } from "vs/platform/theme/common/themeService";
2222
import { IWorkspaceContextService } from "vs/platform/workspace/common/workspace";
2323
import * as extHostTypes from "vs/workbench/api/common/extHostTypes";
24-
import { CustomTreeView, CustomTreeViewPanel } from "vs/workbench/browser/parts/views/customView";
24+
import { CustomTreeView, CustomTreeViewPane } from "vs/workbench/browser/parts/views/customView";
2525
import { ViewContainerViewlet } from "vs/workbench/browser/parts/views/viewsViewlet";
2626
import { Extensions as ViewletExtensions, ShowViewletAction, ViewletDescriptor, ViewletRegistry } from "vs/workbench/browser/viewlet";
2727
import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from "vs/workbench/common/actions";
@@ -120,11 +120,11 @@ export const coderApi = (serviceCollection: ServiceCollection): CoderApi => {
120120
}
121121

122122
Registry.as<ViewletRegistry>(ViewletExtensions.Viewlets).registerViewlet(
123-
new ViewletDescriptor(CustomViewlet as any, id, containerName, cssClass, undefined, URI.parse(icon)),
123+
ViewletDescriptor.create(CustomViewlet as any, id, containerName, cssClass, undefined, URI.parse(icon)),
124124
);
125125

126126
Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions).registerWorkbenchAction(
127-
new SyncActionDescriptor(OpenCustomViewletAction as any, id, localize("showViewlet", "Show {0}", containerName)),
127+
SyncActionDescriptor.create(OpenCustomViewletAction as any, id, localize("showViewlet", "Show {0}", containerName)),
128128
"View: Show {0}",
129129
localize("view", "View"),
130130
);
@@ -137,7 +137,7 @@ export const coderApi = (serviceCollection: ServiceCollection): CoderApi => {
137137
Registry.as<IViewsRegistry>(ViewsExtensions.ViewsRegistry).registerViews([{
138138
id: viewId,
139139
name: viewName,
140-
ctorDescriptor: { ctor: CustomTreeViewPanel },
140+
ctorDescriptor: { ctor: CustomTreeViewPane },
141141
treeView: getService(IInstantiationService).createInstance(CustomTreeView as any, viewId, container),
142142
}] as ITreeViewDescriptor[], container);
143143
},
@@ -286,8 +286,8 @@ class StatusBarEntry implements vscode.StatusBarItem {
286286

287287
private _id: number;
288288
private entry: IStatusBarEntry;
289-
private visible: boolean;
290-
private disposed: boolean;
289+
private visible?: boolean;
290+
private disposed?: boolean;
291291
private statusId: string;
292292
private statusName: string;
293293
private accessor?: IStatusbarEntryAccessor;

src/browser/extHostNodeProxy.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Emitter } from "vs/base/common/event";
2-
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
2+
import { createDecorator } from "vs/platform/instantiation/common/instantiation";
33
import { ExtHostNodeProxyShape, MainContext, MainThreadNodeProxyShape } from "vs/workbench/api/common/extHost.protocol";
44
import { IExtHostRpcService } from "vs/workbench/api/common/extHostRpcService";
55

@@ -43,4 +43,4 @@ export class ExtHostNodeProxy implements ExtHostNodeProxyShape {
4343
}
4444

4545
export interface IExtHostNodeProxy extends ExtHostNodeProxy { }
46-
export const IExtHostNodeProxy = createDecorator<IExtHostNodeProxy>('IExtHostNodeProxy');
46+
export const IExtHostNodeProxy = createDecorator<IExtHostNodeProxy>("IExtHostNodeProxy");

src/browser/login.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
55
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'self' 'unsafe-inline'; script-src 'unsafe-inline'; manifest-src 'self'; img-src 'self';">
66
<title>Authenticate: code-server</title>
7-
<link rel="icon" href="./favicon.ico" type="image/x-icon" />
8-
<link rel="manifest" href="./manifest.json">
7+
<link rel="icon" href="./static/out/vs/server/src/media/favicon.ico" type="image/x-icon" />
8+
<link rel="manifest" href="./static/out/vs/server/src/media/manifest.json" crossorigin="use-credentials">
99
<link rel="apple-touch-icon" href="./static/out/vs/server/src/media/code-server.png" />
10+
<meta name="apple-mobile-web-app-capable" content="yes">
1011
<link href="./static/out/vs/server/src/media/login.css" rel="stylesheet">
1112
</head>
1213
<body>

src/browser/workbench-build.html

+4-22
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,6 @@
77
<!-- Disable pinch zooming -->
88
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
99

10-
<!-- Content Security Policy -->
11-
<meta
12-
http-equiv="Content-Security-Policy"
13-
content="
14-
default-src 'self';
15-
img-src 'self' https: data: blob:;
16-
media-src 'none';
17-
script-src 'self' 'unsafe-eval' https: 'sha256-bpJydy1E+3Mx9MyBtkOIA3yyzM2wdyIz115+Sgq21+0=' 'sha256-meDZW3XhN5JmdjFUrWGhTouRKBiWYtXHltaKnqn/WMo=';
18-
child-src 'self';
19-
frame-src 'self';
20-
worker-src 'self';
21-
style-src 'self' 'unsafe-inline';
22-
connect-src 'self' ws: wss: https:;
23-
font-src 'self' blob:;
24-
manifest-src 'self';
25-
">
26-
2710
<!-- Workbench Configuration -->
2811
<meta id="vscode-workbench-web-configuration" data-settings="{{WORKBENCH_WEB_CONFIGURATION}}">
2912

@@ -36,15 +19,14 @@
3619
<meta id="vscode-remote-nls-configuration" data-settings="{{NLS_CONFIGURATION}}">
3720

3821
<!-- Workbench Icon/Manifest/CSS -->
39-
<link rel="icon" href="./favicon.ico" type="image/x-icon" />
40-
<link rel="manifest" href="./manifest.json" crossorigin="use-credentials">
41-
<link rel="apple-touch-icon" href="./static-{{COMMIT}}/out/vs/server/src/media/code-server.png" />
22+
<link rel="icon" href="./static-{{COMMIT}}/out/vs/server/src/media/favicon.ico" type="image/x-icon" />
23+
<link rel="manifest" href="./static-{{COMMIT}}/out/vs/server/src/media/manifest.json" crossorigin="use-credentials">
4224
<link data-name="vs/workbench/workbench.web.api" rel="stylesheet" href="./static-{{COMMIT}}/out/vs/workbench/workbench.web.api.css">
25+
<link rel="apple-touch-icon" href="./static-{{COMMIT}}/out/vs/server/src/media/code-server.png" />
4326
<meta name="apple-mobile-web-app-capable" content="yes">
4427

4528
<!-- Prefetch to avoid waterfall -->
4629
<link rel="prefetch" href="./static-{{COMMIT}}/node_modules/semver-umd/lib/semver-umd.js">
47-
<link rel="prefetch" href="./static-{{COMMIT}}/node_modules/@microsoft/applicationinsights-web/dist/applicationinsights-web.js">
4830
</head>
4931

5032
<body aria-label="">
@@ -90,8 +72,8 @@
9072
'xterm': `${staticBase}/node_modules/xterm/lib/xterm.js`,
9173
'xterm-addon-search': `${staticBase}/node_modules/xterm-addon-search/lib/xterm-addon-search.js`,
9274
'xterm-addon-web-links': `${staticBase}/node_modules/xterm-addon-web-links/lib/xterm-addon-web-links.js`,
75+
'xterm-addon-webgl': `${staticBase}/node_modules/xterm-addon-webgl/lib/xterm-addon-webgl.js`,
9376
'semver-umd': `${staticBase}/node_modules/semver-umd/lib/semver-umd.js`,
94-
'@microsoft/applicationinsights-web': `${staticBase}/node_modules/@microsoft/applicationinsights-web/dist/applicationinsights-web.js`,
9577
},
9678
'vs/nls': nlsConfig,
9779
};

src/browser/workbench.html

+3-20
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,6 @@
77
<!-- Disable pinch zooming -->
88
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
99

10-
<!-- Content Security Policy -->
11-
<meta
12-
http-equiv="Content-Security-Policy"
13-
content="
14-
default-src 'self';
15-
img-src 'self' https: data: blob:;
16-
media-src 'none';
17-
script-src 'self' https://az416426.vo.msecnd.net 'unsafe-eval' https: 'unsafe-inline';
18-
child-src 'self';
19-
frame-src 'self' https://*.vscode-webview-test.com;
20-
worker-src 'self';
21-
style-src 'self' 'unsafe-inline';
22-
connect-src 'self' ws: wss: https:;
23-
font-src 'self' blob:;
24-
manifest-src 'self';
25-
">
26-
2710
<!-- Workbench Configuration -->
2811
<meta id="vscode-workbench-web-configuration" data-settings="{{WORKBENCH_WEB_CONFIGURATION}}">
2912

@@ -36,8 +19,8 @@
3619
<meta id="vscode-remote-nls-configuration" data-settings="{{NLS_CONFIGURATION}}">
3720

3821
<!-- Workbench Icon/Manifest/CSS -->
39-
<link rel="icon" href="./favicon.ico" type="image/x-icon" />
40-
<link rel="manifest" href="./manifest.json" crossorigin="use-credentials">
22+
<link rel="icon" href="./static/out/vs/server/src/media/favicon.ico" type="image/x-icon" />
23+
<link rel="manifest" href="./static/out/vs/server/src/media/manifest.json" crossorigin="use-credentials">
4124
</head>
4225

4326
<body aria-label="">
@@ -58,8 +41,8 @@
5841
'xterm': `${staticBase}/node_modules/xterm/lib/xterm.js`,
5942
'xterm-addon-search': `${staticBase}/node_modules/xterm-addon-search/lib/xterm-addon-search.js`,
6043
'xterm-addon-web-links': `${staticBase}/node_modules/xterm-addon-web-links/lib/xterm-addon-web-links.js`,
44+
'xterm-addon-webgl': `${staticBase}/node_modules/xterm-addon-webgl/lib/xterm-addon-webgl.js`,
6145
'semver-umd': `${staticBase}/node_modules/semver-umd/lib/semver-umd.js`,
62-
'@microsoft/applicationinsights-web': `${staticBase}/node_modules/@microsoft/applicationinsights-web/dist/applicationinsights-web.js`,
6346
},
6447
};
6548
</script>

src/media/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"background-color": "#fff",
77
"description": "Run VS Code on a remote server.",
88
"icons": [{
9-
"src": "./static/out/vs/server/src/media/code-server.png",
9+
"src": "./code-server.png",
1010
"sizes": "384x384",
1111
"type": "image/png"
1212
}]

src/node/channel.ts

+63-33
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
import * as path from "path";
2-
import { VSBuffer } from "vs/base/common/buffer";
2+
import { VSBuffer, VSBufferReadableStream } from "vs/base/common/buffer";
33
import { Emitter, Event } from "vs/base/common/event";
44
import { IDisposable } from "vs/base/common/lifecycle";
55
import { OS } from "vs/base/common/platform";
6+
import { ReadableStreamEventPayload } from "vs/base/common/stream";
67
import { URI, UriComponents } from "vs/base/common/uri";
78
import { transformOutgoingURIs } from "vs/base/common/uriIpc";
89
import { IServerChannel } from "vs/base/parts/ipc/common/ipc";
910
import { IDiagnosticInfo } from "vs/platform/diagnostics/common/diagnostics";
1011
import { IEnvironmentService } from "vs/platform/environment/common/environment";
1112
import { ExtensionIdentifier, IExtensionDescription } from "vs/platform/extensions/common/extensions";
12-
import { FileDeleteOptions, FileOpenOptions, FileOverwriteOptions, FileType, IStat, IWatchOptions } from "vs/platform/files/common/files";
13+
import { FileDeleteOptions, FileOpenOptions, FileOverwriteOptions, FileReadStreamOptions, FileType, FileWriteOptions, IStat, IWatchOptions } from "vs/platform/files/common/files";
14+
import { createReadStream } from "vs/platform/files/common/io";
1315
import { DiskFileSystemProvider } from "vs/platform/files/node/diskFileSystemProvider";
1416
import { ILogService } from "vs/platform/log/common/log";
1517
import product from "vs/platform/product/common/product";
16-
import { IRemoteAgentEnvironment } from "vs/platform/remote/common/remoteAgentEnvironment";
18+
import { IRemoteAgentEnvironment, RemoteAgentConnectionContext } from "vs/platform/remote/common/remoteAgentEnvironment";
1719
import { ITelemetryService } from "vs/platform/telemetry/common/telemetry";
1820
import { INodeProxyService } from "vs/server/src/common/nodeProxy";
1921
import { getTranslations } from "vs/server/src/node/nls";
2022
import { getUriTransformer, localRequire } from "vs/server/src/node/util";
23+
import { IFileChangeDto } from "vs/workbench/api/common/extHost.protocol";
2124
import { ExtensionScanner, ExtensionScannerInput } from "vs/workbench/services/extensions/node/extensionPoints";
2225

2326
/**
@@ -42,7 +45,7 @@ class Watcher extends DiskFileSystemProvider {
4245
}
4346
}
4447

45-
export class FileProviderChannel implements IServerChannel, IDisposable {
48+
export class FileProviderChannel implements IServerChannel<RemoteAgentConnectionContext>, IDisposable {
4649
private readonly provider: DiskFileSystemProvider;
4750
private readonly watchers = new Map<string, Watcher>();
4851

@@ -53,48 +56,67 @@ export class FileProviderChannel implements IServerChannel, IDisposable {
5356
this.provider = new DiskFileSystemProvider(this.logService);
5457
}
5558

56-
public listen(context: any, event: string, args?: any): Event<any> {
59+
public listen(context: RemoteAgentConnectionContext, event: string, args?: any): Event<any> {
5760
switch (event) {
58-
// This is where the actual file changes are sent. The watch method just
59-
// adds things that will fire here. That means we have to split up
60-
// watchers based on the session otherwise sessions would get events for
61-
// other sessions. There is also no point in having the watcher unless
62-
// something is listening. I'm not sure there is a different way to
63-
// dispose, anyway.
64-
case "filechange":
65-
const session = args[0];
66-
const emitter = new Emitter({
67-
onFirstListenerAdd: () => {
68-
const provider = new Watcher(this.logService);
69-
this.watchers.set(session, provider);
70-
const transformer = getUriTransformer(context.remoteAuthority);
71-
provider.onDidChangeFile((events) => {
72-
emitter.fire(events.map((event) => ({
73-
...event,
74-
resource: transformer.transformOutgoing(event.resource),
75-
})));
76-
});
77-
provider.onDidErrorOccur((event) => emitter.fire(event));
78-
},
79-
onLastListenerRemove: () => {
80-
this.watchers.get(session)!.dispose();
81-
this.watchers.delete(session);
82-
},
83-
});
84-
85-
return emitter.event;
61+
case "filechange": return this.filechange(context, args[0]);
62+
case "readFileStream": return this.readFileStream(args[0], args[1]);
8663
}
8764

8865
throw new Error(`Invalid listen "${event}"`);
8966
}
9067

68+
private filechange(context: RemoteAgentConnectionContext, session: string): Event<IFileChangeDto[]> {
69+
const emitter = new Emitter<IFileChangeDto[]>({
70+
onFirstListenerAdd: () => {
71+
const provider = new Watcher(this.logService);
72+
this.watchers.set(session, provider);
73+
const transformer = getUriTransformer(context.remoteAuthority);
74+
provider.onDidChangeFile((events) => {
75+
emitter.fire(events.map((event) => ({
76+
...event,
77+
resource: transformer.transformOutgoing(event.resource),
78+
})));
79+
});
80+
provider.onDidErrorOccur((event) => this.logService.error(event));
81+
},
82+
onLastListenerRemove: () => {
83+
this.watchers.get(session)!.dispose();
84+
this.watchers.delete(session);
85+
},
86+
});
87+
88+
return emitter.event;
89+
}
90+
91+
private readFileStream(resource: UriComponents, opts: FileReadStreamOptions): Event<ReadableStreamEventPayload<VSBuffer>> {
92+
let fileStream: VSBufferReadableStream | undefined;
93+
const emitter = new Emitter<ReadableStreamEventPayload<VSBuffer>>({
94+
onFirstListenerAdd: () => {
95+
if (!fileStream) {
96+
fileStream = createReadStream(this.provider, this.transform(resource), {
97+
...opts,
98+
bufferSize: 64 * 1024, // From DiskFileSystemProvider
99+
});
100+
fileStream.on("data", (data) => emitter.fire(data));
101+
fileStream.on("error", (error) => emitter.fire(error));
102+
fileStream.on("end", () => emitter.fire("end"));
103+
}
104+
},
105+
onLastListenerRemove: () => fileStream && fileStream.destroy(),
106+
});
107+
108+
return emitter.event;
109+
}
110+
91111
public call(_: unknown, command: string, args?: any): Promise<any> {
92112
switch (command) {
93113
case "stat": return this.stat(args[0]);
94114
case "open": return this.open(args[0], args[1]);
95115
case "close": return this.close(args[0]);
96116
case "read": return this.read(args[0], args[1], args[2]);
117+
case "readFile": return this.readFile(args[0]);
97118
case "write": return this.write(args[0], args[1], args[2], args[3], args[4]);
119+
case "writeFile": return this.writeFile(args[0], args[1], args[2]);
98120
case "delete": return this.delete(args[0], args[1]);
99121
case "mkdir": return this.mkdir(args[0]);
100122
case "readdir": return this.readdir(args[0]);
@@ -130,10 +152,18 @@ export class FileProviderChannel implements IServerChannel, IDisposable {
130152
return [buffer, bytesRead];
131153
}
132154

155+
private async readFile(resource: UriComponents): Promise<VSBuffer> {
156+
return VSBuffer.wrap(await this.provider.readFile(this.transform(resource)));
157+
}
158+
133159
private write(fd: number, pos: number, buffer: VSBuffer, offset: number, length: number): Promise<number> {
134160
return this.provider.write(fd, pos, buffer.buffer, offset, length);
135161
}
136162

163+
private writeFile(resource: UriComponents, buffer: VSBuffer, opts: FileWriteOptions): Promise<void> {
164+
return this.provider.writeFile(this.transform(resource), buffer.buffer, opts);
165+
}
166+
137167
private async delete(resource: UriComponents, opts: FileDeleteOptions): Promise<void> {
138168
return this.provider.delete(this.transform(resource), opts);
139169
}

0 commit comments

Comments
 (0)