Skip to content

Update to 1.71 #5535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/vscode
Submodule vscode updated 1045 files
68 changes: 3 additions & 65 deletions patches/cli-window-open.diff
Original file line number Diff line number Diff line change
Expand Up @@ -13,62 +13,15 @@ To test:
The file or directory should only open from the instance attached to that
terminal.

Index: code-server/lib/vscode/src/vs/server/node/remoteTerminalChannel.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/server/node/remoteTerminalChannel.ts
+++ code-server/lib/vscode/src/vs/server/node/remoteTerminalChannel.ts
@@ -89,7 +89,7 @@ export class RemoteTerminalChannel exten
uriTransformer: IURITransformer;
}>();

- private readonly _onExecuteCommand = this._register(new Emitter<{ reqId: number; commandId: string; commandArgs: any[] }>());
+ private readonly _onExecuteCommand = this._register(new Emitter<{ reqId: number; terminalId: number; commandId: string; commandArgs: any[] }>());
readonly onExecuteCommand = this._onExecuteCommand.event;

constructor(
@@ -241,20 +241,20 @@ export class RemoteTerminalChannel exten
const ipcHandlePath = createRandomIPCHandle();
env.VSCODE_IPC_HOOK_CLI = ipcHandlePath;
const commandsExecuter: ICommandsExecuter = {
- executeCommand: <T>(id: string, ...args: any[]): Promise<T> => this._executeCommand(id, args, uriTransformer)
+ executeCommand: <T>(commandId: string, ...args: any[]): Promise<T> => this._executeCommand(terminalId, commandId, args, uriTransformer)
};
const cliServer = new CLIServerBase(commandsExecuter, this._logService, ipcHandlePath);

- const id = await this._ptyService.createProcess(shellLaunchConfig, initialCwd, args.cols, args.rows, args.unicodeVersion, env, baseEnv, args.options, args.shouldPersistTerminal, args.workspaceId, args.workspaceName);
- this._ptyService.onProcessExit(e => e.id === id && cliServer.dispose());
+ const terminalId = await this._ptyService.createProcess(shellLaunchConfig, initialCwd, args.cols, args.rows, args.unicodeVersion, env, baseEnv, args.options, args.shouldPersistTerminal, args.workspaceId, args.workspaceName);
+ this._ptyService.onProcessExit(e => e.id === terminalId && cliServer.dispose());

return {
- persistentTerminalId: id,
+ persistentTerminalId: terminalId,
resolvedShellLaunchConfig: shellLaunchConfig
};
}

- private _executeCommand<T>(commandId: string, commandArgs: any[], uriTransformer: IURITransformer): Promise<T> {
+ private _executeCommand<T>(terminalId: number, commandId: string, commandArgs: any[], uriTransformer: IURITransformer): Promise<T> {
let resolve!: (data: any) => void;
let reject!: (err: any) => void;
const result = new Promise<T>((_resolve, _reject) => {
@@ -277,6 +277,7 @@ export class RemoteTerminalChannel exten
});
this._onExecuteCommand.fire({
reqId,
+ terminalId,
commandId,
commandArgs: serializedCommandArgs
});
Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
@@ -94,10 +94,14 @@ class RemoteTerminalBackend extends Base
this._remoteTerminalChannel.onExecuteCommand(async e => {
@@ -99,10 +99,14 @@ class RemoteTerminalBackend extends Base
}
const reqId = e.reqId;
const commandId = e.commandId;
+ const terminalId = e.terminalId;
+ const terminalId = e.persistentProcessId;
if (!allowedCommands.includes(commandId)) {
this._remoteTerminalChannel.sendCommandResult(reqId, true, 'Invalid remote cli command: ' + commandId);
return;
Expand All @@ -79,18 +32,3 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTe
const commandArgs = e.commandArgs.map(arg => revive(arg));
try {
const result = await this._commandService.executeCommand(e.commandId, ...commandArgs);
Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/remoteTerminalChannel.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/common/remoteTerminalChannel.ts
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/remoteTerminalChannel.ts
@@ -88,8 +88,8 @@ export class RemoteTerminalChannelClient
get onProcessOrphanQuestion(): Event<{ id: number }> {
return this._channel.listen<{ id: number }>('$onProcessOrphanQuestion');
}
- get onExecuteCommand(): Event<{ reqId: number; commandId: string; commandArgs: any[] }> {
- return this._channel.listen<{ reqId: number; commandId: string; commandArgs: any[] }>('$onExecuteCommand');
+ get onExecuteCommand(): Event<{ reqId: number; terminalId: number; commandId: string; commandArgs: any[] }> {
+ return this._channel.listen<{ reqId: number; terminalId: number; commandId: string; commandArgs: any[] }>('$onExecuteCommand');
}
get onDidRequestDetach(): Event<{ requestId: number; workspaceId: string; instanceId: number }> {
return this._channel.listen<{ requestId: number; workspaceId: string; instanceId: number }>('$onDidRequestDetach');
4 changes: 2 additions & 2 deletions patches/disable-builtin-ext-update.diff
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
@@ -237,6 +237,10 @@ export class Extension implements IExten
@@ -236,6 +236,10 @@ export class Extension implements IExten
if (this.type === ExtensionType.System && this.productService.quality === 'stable') {
return false;
}
Expand All @@ -18,7 +18,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
if (!this.local.preRelease && this.gallery.properties.isPreReleaseVersion) {
return false;
}
@@ -1122,6 +1126,10 @@ export class ExtensionsWorkbenchService
@@ -1121,6 +1125,10 @@ export class ExtensionsWorkbenchService
// Skip if check updates only for builtin extensions and current extension is not builtin.
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion patches/heartbeat.diff
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Index: code-server/lib/vscode/src/vs/base/parts/ipc/common/ipc.net.ts

export const enum SocketDiagnosticsEventType {
Created = 'created',
@@ -829,6 +830,19 @@ export class PersistentProtocol implemen
@@ -849,6 +850,19 @@ export class PersistentProtocol implemen
this._socketDisposables.push(this._socketWriter);
this._socketReader = new ProtocolReader(this._socket);
this._socketDisposables.push(this._socketReader);
Expand Down
3 changes: 1 addition & 2 deletions patches/insecure-notification.diff
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
) {
super();
}
@@ -42,5 +45,32 @@ export class CodeServerClient extends Di
@@ -42,5 +45,31 @@ export class CodeServerClient extends Di
}
});
}
Expand All @@ -49,7 +49,6 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
+ class: undefined,
+ enabled: true,
+ checked: true,
+ dispose: () => undefined,
+ run: () => {
+ return Promise.resolve();
+ },
Expand Down
2 changes: 1 addition & 1 deletion patches/proposed-api.diff
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/abstra
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts
@@ -1460,7 +1460,7 @@ class ProposedApiController {
@@ -1458,7 +1458,7 @@ class ProposedApiController {

this._envEnabledExtensions = new Set((_environmentService.extensionEnabledProposedApi ?? []).map(id => ExtensionIdentifier.toKey(id)));

Expand Down
28 changes: 14 additions & 14 deletions patches/proxy-uri.diff
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,31 @@ Index: code-server/lib/vscode/src/vs/platform/remote/browser/remoteAuthorityReso
import { getRemoteServerRootPath, parseAuthorityWithOptionalPort } from 'vs/platform/remote/common/remoteHosts';

export class RemoteAuthorityResolverService extends Disposable implements IRemoteAuthorityResolverService {
@@ -22,7 +22,7 @@ export class RemoteAuthorityResolverServ
private readonly _connectionToken: string | undefined;
@@ -23,7 +23,7 @@ export class RemoteAuthorityResolverServ
private readonly _connectionToken: Promise<string> | string | undefined;
private readonly _connectionTokens: Map<string, string>;

- constructor(@IProductService productService: IProductService, connectionToken: string | undefined, resourceUriProvider: ((uri: URI) => URI) | undefined) {
+ constructor(@IProductService productService: IProductService, connectionToken: string | undefined, resourceUriProvider: ((uri: URI) => URI) | undefined, private readonly proxyEndpointTemplate?: string) {
- constructor(@IProductService productService: IProductService, connectionToken: Promise<string> | string | undefined, resourceUriProvider: ((uri: URI) => URI) | undefined) {
+ constructor(@IProductService productService: IProductService, connectionToken: Promise<string> | string | undefined, resourceUriProvider: ((uri: URI) => URI) | undefined, private readonly proxyEndpointTemplate?: string) {
super();
this._cache = new Map<string, ResolverResult>();
this._connectionToken = connectionToken;
@@ -62,9 +62,14 @@ export class RemoteAuthorityResolverServ
this._connectionTokens = new Map<string, string>();
@@ -61,9 +61,14 @@ export class RemoteAuthorityResolverServ

private _doResolveAuthority(authority: string): ResolverResult {
const connectionToken = this._connectionTokens.get(authority) || this._connectionToken;
private async _doResolveAuthority(authority: string): Promise<ResolverResult> {
const connectionToken = await Promise.resolve(this._connectionTokens.get(authority) || this._connectionToken);
+ let options: ResolvedOptions | undefined;
+ if (this.proxyEndpointTemplate) {
+ const proxyUrl = new URL(this.proxyEndpointTemplate, window.location.href);
+ options = { extensionHostEnv: { VSCODE_PROXY_URI: decodeURIComponent(proxyUrl.toString()) }}
+ }
const defaultPort = (/^https:/.test(window.location.href) ? 443 : 80);
const { host, port } = parseAuthorityWithOptionalPort(authority, defaultPort);
- return { authority: { authority, host: host, port: port, connectionToken } };
+ return { authority: { authority, host: host, port: port, connectionToken }, options };
}

_clearResolvedAuthority(authority: string): void {
- const result: ResolverResult = { authority: { authority, host: host, port: port, connectionToken } };
+ const result: ResolverResult = { authority: { authority, host: host, port: port, connectionToken }, options };
RemoteAuthorities.set(authority, result.authority.host, result.authority.port);
this._cache.set(authority, result);
this._onDidChangeConnectionData.fire();
Comment on lines +59 to +62
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to self: this change is fine, right?

Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
Expand All @@ -76,7 +76,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.main.ts
+++ code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
@@ -239,7 +239,7 @@ export class BrowserMain extends Disposa
@@ -247,7 +247,7 @@ export class BrowserMain extends Disposa

// Remote
const connectionToken = environmentService.options.connectionToken || getCookieValue(connectionTokenCookieName);
Expand Down
6 changes: 3 additions & 3 deletions patches/sourcemaps.diff
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
===================================================================
--- code-server.orig/lib/vscode/build/gulpfile.reh.js
+++ code-server/lib/vscode/build/gulpfile.reh.js
@@ -194,8 +194,7 @@ function packageTask(type, platform, arc
@@ -196,8 +196,7 @@ function packageTask(type, platform, arc

const src = gulp.src(sourceFolderName + '/**', { base: '.' })
.pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + sourceFolderName), 'out'); }))
Expand All @@ -20,7 +20,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js

const workspaceExtensionPoints = ['debuggers', 'jsonValidation'];
const isUIExtension = (manifest) => {
@@ -234,9 +233,9 @@ function packageTask(type, platform, arc
@@ -236,9 +235,9 @@ function packageTask(type, platform, arc
.map(name => `.build/extensions/${name}/**`);

const extensions = gulp.src(extensionPaths, { base: '.build', dot: true });
Expand All @@ -32,7 +32,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js

let version = packageJson.version;
const quality = product.quality;
@@ -371,7 +370,7 @@ function tweakProductForServerWeb(produc
@@ -373,7 +372,7 @@ function tweakProductForServerWeb(produc
const minifyTask = task.define(`minify-vscode-${type}`, task.series(
optimizeTask,
util.rimraf(`out-vscode-${type}-min`),
Expand Down
70 changes: 48 additions & 22 deletions patches/telemetry.diff
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Add support for telemetry endpoint

Contains some fixes included in https://github.com/microsoft/vscode/commit/b108bc8294ce920fcf2ee8d53f97c3bcf3316e1c
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition 👍🏼


Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
Expand Down Expand Up @@ -86,12 +88,45 @@ Index: code-server/lib/vscode/src/vs/workbench/services/telemetry/browser/teleme
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/services/telemetry/browser/telemetryService.ts
+++ code-server/lib/vscode/src/vs/workbench/services/telemetry/browser/telemetryService.ts
@@ -38,26 +38,30 @@ export class TelemetryService extends Di
@@ -15,7 +15,7 @@ import { ClassifiedEvent, IGDPRProperty,
import { ITelemetryData, ITelemetryInfo, ITelemetryService, TelemetryLevel, TELEMETRY_SETTING_ID } from 'vs/platform/telemetry/common/telemetry';
import { TelemetryLogAppender } from 'vs/platform/telemetry/common/telemetryLogAppender';
import { ITelemetryServiceConfig, TelemetryService as BaseTelemetryService } from 'vs/platform/telemetry/common/telemetryService';
-import { isInternalTelemetry, ITelemetryAppender, NullTelemetryService, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
+import { getTelemetryLevel, isInternalTelemetry, ITelemetryAppender, NullTelemetryService, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService';
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
import { resolveWorkbenchCommonProperties } from 'vs/workbench/services/telemetry/browser/workbenchCommonProperties';
@@ -24,7 +24,7 @@ export class TelemetryService extends Di

declare readonly _serviceBrand: undefined;

- private impl: ITelemetryService;
+ private impl: ITelemetryService = NullTelemetryService;
public readonly sendErrorTelemetry = true;

constructor(
@@ -37,11 +37,7 @@ export class TelemetryService extends Di
) {
super();

- if (supportsTelemetry(productService, environmentService) && productService.aiConfig?.ariaKey) {
+ if (supportsTelemetry(productService, environmentService)) {
- this.impl = this.initializeService(environmentService, loggerService, configurationService, storageService, productService, remoteAgentService);
- } else {
- this.impl = NullTelemetryService;
- }
+ this.impl = this.initializeService(environmentService, loggerService, configurationService, storageService, productService, remoteAgentService);

// When the level changes it could change from off to on and we want to make sure telemetry is properly intialized
this._register(configurationService.onDidChangeConfiguration(e => {
@@ -64,23 +60,28 @@ export class TelemetryService extends Di
productService: IProductService,
remoteAgentService: IRemoteAgentService
) {
- const telemetrySupported = supportsTelemetry(productService, environmentService) && productService.aiConfig?.ariaKey;
- if (telemetrySupported && this.impl === NullTelemetryService && this.telemetryLevel.value !== TelemetryLevel.NONE) {
+ const telemetrySupported = supportsTelemetry(productService, environmentService);
+ if (telemetrySupported && getTelemetryLevel(configurationService) !== TelemetryLevel.NONE && this.impl === NullTelemetryService) {
// If remote server is present send telemetry through that, else use the client side appender
const appenders = [];
const isInternal = isInternalTelemetry(productService, configurationService);
Expand All @@ -103,14 +138,6 @@ Index: code-server/lib/vscode/src/vs/workbench/services/telemetry/browser/teleme
- commonProperties: resolveWorkbenchCommonProperties(storageService, productService.commit, productService.version, isInternal, environmentService.remoteAuthority, productService.embedderIdentifier, productService.removeTelemetryMachineId, environmentService.options && environmentService.options.resolveCommonTelemetryProperties),
- sendErrorTelemetry: this.sendErrorTelemetry,
- };
- this.impl = this._register(new BaseTelemetryService(config, configurationService, productService));
-
- if (getTelemetryLevel(configurationService) !== TelemetryLevel.NONE) {
- // If we cannot fetch the endpoint it means it is down and we should not send any telemetry.
- // This is most likely due to ad blockers
- fetch(telemetryEndpointUrl, { method: 'POST' }).catch(err => {
- this.impl = NullTelemetryService;
- });
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually have no idea what happened with this segment in the original version. I have not found any commit where this was removed or changed. Maybe sbd. finds the reason...

+ const telemetryProvider: ITelemetryAppender | undefined = remoteAgentService.getConnection() !== null ? { log: remoteAgentService.logTelemetry.bind(remoteAgentService), flush: remoteAgentService.flushTelemetry.bind(remoteAgentService) } : productService.aiConfig?.ariaKey ? new OneDataSystemWebAppender(isInternal, 'monacoworkbench', null, productService.aiConfig?.ariaKey) : undefined;
+ if (telemetryProvider) {
+ appenders.push(telemetryProvider);
Expand All @@ -120,20 +147,19 @@ Index: code-server/lib/vscode/src/vs/workbench/services/telemetry/browser/teleme
+ commonProperties: resolveWorkbenchCommonProperties(storageService, productService.commit, productService.version, isInternal, environmentService.remoteAuthority, productService.embedderIdentifier, productService.removeTelemetryMachineId, environmentService.options && environmentService.options.resolveCommonTelemetryProperties),
+ sendErrorTelemetry: this.sendErrorTelemetry,
+ };
+ this.impl = this._register(new BaseTelemetryService(config, configurationService, productService));
+
+ if (remoteAgentService.getConnection() === null && getTelemetryLevel(configurationService) !== TelemetryLevel.NONE) {
+ // If we cannot fetch the endpoint it means it is down and we should not send any telemetry.
+ // This is most likely due to ad blockers
+ fetch(telemetryEndpointUrl, { method: 'POST' }).catch(err => {
+ this.impl = NullTelemetryService;
+ });
+ }
+ return this._register(new BaseTelemetryService(config, configurationService, productService));
+ } else {
+ this.impl = NullTelemetryService;
}
} else {
this.impl = NullTelemetryService;
+ return this.impl;
+ }

- return this._register(new BaseTelemetryService(config, configurationService, productService));
}
- return NullTelemetryService;
+ return this.impl;
}

setExperimentProperty(name: string, value: string): void {
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
Expand Down