2019-01-19 07:04:24 +07:00
diff --git a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts
2019-02-22 00:55:42 +07:00
index a342222d04..c731e82591 100644
2019-01-19 07:04:24 +07:00
--- a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts
+++ b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts
2019-02-22 00:55:42 +07:00
@@ -195,0 +196,2 @@ async function handshake(configuration: ISharedProcessConfiguration): Promise<vo
2019-01-19 07:04:24 +07:00
+
+startup({ machineId: "1" });
2019-01-31 05:57:22 +07:00
diff --git a/src/vs/editor/contrib/clipboard/clipboard.ts b/src/vs/editor/contrib/clipboard/clipboard.ts
2019-02-07 01:59:03 +07:00
index 5e43f1b39e..a008d3ac7e 100644
2019-01-31 05:57:22 +07:00
--- a/src/vs/editor/contrib/clipboard/clipboard.ts
+++ b/src/vs/editor/contrib/clipboard/clipboard.ts
2019-02-07 02:20:40 +07:00
@@ -29 +29,2 @@ const supportsCopyWithSyntaxHighlighting = (supportsCopy && !browser.isEdgeOrIE)
2019-01-31 05:57:22 +07:00
-const supportsPaste = (platform.isNative || (!browser.isChrome && document.queryCommandSupported('paste')));
+// const supportsPaste = (platform.isNative || (!browser.isChrome && document.queryCommandSupported('paste')));
+const supportsPaste = true;
2019-02-07 02:20:40 +07:00
@@ -176,0 +178 @@ class ExecCommandPasteAction extends ExecCommandAction {
2019-02-07 01:59:03 +07:00
+ const { client } = require('vs/../../../../packages/vscode') as typeof import ('vs/../../../../packages/vscode');
2019-02-07 02:20:40 +07:00
@@ -181 +183 @@ class ExecCommandPasteAction extends ExecCommandAction {
2019-01-31 05:57:22 +07:00
- precondition: EditorContextKeys.writable,
2019-02-07 01:59:03 +07:00
+ precondition: (require('vs/platform/contextkey/common/contextkey') as typeof import('vs/platform/contextkey/common/contextkey')).ContextKeyExpr.and(EditorContextKeys.writable, client.clipboardContextKey),
2019-02-07 02:20:40 +07:00
@@ -191 +193,2 @@ class ExecCommandPasteAction extends ExecCommandAction {
2019-01-31 05:57:22 +07:00
- order: 3
+ order: 3,
+ when: client.clipboardContextKey,
2019-02-07 02:20:40 +07:00
@@ -194,0 +198,14 @@ class ExecCommandPasteAction extends ExecCommandAction {
2019-01-31 05:57:22 +07:00
+
+ public async run(accessor, editor: ICodeEditor): Promise<void> {
2019-02-07 01:59:03 +07:00
+ if (editor instanceof (require('vs/editor/browser/widget/codeEditorWidget') as typeof import('vs/editor/browser/widget/codeEditorWidget')).CodeEditorWidget) {
2019-01-31 05:57:22 +07:00
+ try {
2019-02-07 01:59:03 +07:00
+ editor.trigger('', (require('vs/editor/common/editorCommon') as typeof import ('vs/editor/common/editorCommon')).Handler.Paste, {
+ text: await (require('vs/../../../../packages/vscode') as typeof import ('vs/../../../../packages/vscode')).client.clipboardText,
2019-01-31 05:57:22 +07:00
+ });
+ } catch (ex) {
+ super.run(accessor, editor);
+ }
+ } else {
+ super.run(accessor, editor);
+ }
+ }
2019-01-19 07:04:24 +07:00
diff --git a/src/vs/loader.js b/src/vs/loader.js
2019-02-22 00:55:42 +07:00
index 4eddcab3a0..5d80768406 100644
2019-01-19 07:04:24 +07:00
--- a/src/vs/loader.js
+++ b/src/vs/loader.js
2019-02-22 00:55:42 +07:00
@@ -671,4 +671,4 @@ var AMDLoader;
2019-01-19 07:04:24 +07:00
- this._fs = nodeRequire('fs');
- this._vm = nodeRequire('vm');
- this._path = nodeRequire('path');
- this._crypto = nodeRequire('crypto');
+ this._fs = require('fs');
+ this._vm = require('vm');
+ this._path = require('path');
+ this._crypto = require('crypto');
2019-02-22 00:55:42 +07:00
@@ -736,0 +737,7 @@ var AMDLoader;
2019-01-19 07:04:24 +07:00
+ const context = require.context("../", true, /.*/);
+ if (scriptSrc.indexOf("file:///") !== -1) {
+ const vsSrc = scriptSrc.split("file:///")[1].split(".js")[0];
+ if (vsSrc && vsSrc.startsWith("vs/")) {
+ scriptSrc = `node|./${vsSrc}`;
+ }
+ }
2019-02-22 00:55:42 +07:00
@@ -741 +748 @@ var AMDLoader;
2019-01-19 07:04:24 +07:00
- moduleExports_1 = nodeRequire(pieces[1]);
+ moduleExports_1 = context(pieces[1]);
2019-02-01 05:19:12 +07:00
diff --git a/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts b/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts
2019-02-22 00:55:42 +07:00
index 6c52cbc937..09adbe7f51 100644
2019-02-01 05:19:12 +07:00
--- a/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts
+++ b/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts
2019-02-07 02:20:40 +07:00
@@ -57,0 +58,3 @@ export class HeapService implements IHeapService {
2019-02-02 08:55:32 +07:00
+ // Cannot control GC in the browser.
2019-02-01 05:19:12 +07:00
+ return Promise.resolve(obj);
+
2019-02-07 02:04:54 +07:00
diff --git a/src/vs/workbench/api/node/extHostExtensionService.ts b/src/vs/workbench/api/node/extHostExtensionService.ts
2019-02-22 00:55:42 +07:00
index 1f4a1e100b..1bf605a064 100644
2019-02-07 02:04:54 +07:00
--- a/src/vs/workbench/api/node/extHostExtensionService.ts
+++ b/src/vs/workbench/api/node/extHostExtensionService.ts
2019-02-22 00:55:42 +07:00
@@ -719 +719 @@ function loadCommonJSModule<T>(logService: ILogService, modulePath: string, acti
2019-02-07 02:04:54 +07:00
- r = require.__$__nodeRequire<T>(modulePath);
+ r = (global as any).nativeNodeRequire(modulePath);
2019-01-31 04:40:01 +07:00
diff --git a/src/vs/workbench/browser/dnd.ts b/src/vs/workbench/browser/dnd.ts
2019-02-22 00:55:42 +07:00
index e73acff052..bd65fcbd6c 100644
2019-01-31 04:40:01 +07:00
--- a/src/vs/workbench/browser/dnd.ts
+++ b/src/vs/workbench/browser/dnd.ts
2019-02-07 02:20:40 +07:00
@@ -171 +171 @@ export class ResourcesDropHandler {
2019-01-31 04:40:01 +07:00
- return;
2019-02-07 01:59:03 +07:00
+ return (require('vs/../../../../packages/vscode') as typeof import ('vs/../../../../packages/vscode')).client.handleDrop(event, resolveTargetGroup, afterDrop, targetIndex);
2019-01-19 07:04:24 +07:00
diff --git a/src/vs/workbench/electron-browser/main.ts b/src/vs/workbench/electron-browser/main.ts
2019-02-22 00:55:42 +07:00
index 1e6333c731..0a7bdeeb9b 100644
2019-01-19 07:04:24 +07:00
--- a/src/vs/workbench/electron-browser/main.ts
+++ b/src/vs/workbench/electron-browser/main.ts
2019-02-22 00:55:42 +07:00
@@ -147,7 +147,7 @@ function openWorkbench(configuration: IWindowConfiguration): Promise<void> {
2019-01-19 07:04:24 +07:00
- (<any>self).require.config({
- onError: err => {
- if (err.errorCode === 'load') {
- shell.onUnexpectedError(new Error(nls.localize('loaderErrorNative', "Failed to load a required file. Please restart the application to try again. Details: {0}", JSON.stringify(err))));
- }
- }
- });
+ // (<any>self).require.config({
+ // onError: err => {
+ // if (err.errorCode === 'load') {
+ // shell.onUnexpectedError(new Error(nls.localize('loaderErrorNative', "Failed to load a required file. Please restart the application to try again. Details: {0}", JSON.stringify(err))));
+ // }
+ // }
+ // });
2019-01-31 05:57:22 +07:00
diff --git a/src/vs/workbench/electron-browser/window.ts b/src/vs/workbench/electron-browser/window.ts
2019-02-22 00:55:42 +07:00
index c0aff6bd4b..4f3b1e3984 100644
2019-01-31 05:57:22 +07:00
--- a/src/vs/workbench/electron-browser/window.ts
+++ b/src/vs/workbench/electron-browser/window.ts
2019-02-22 00:55:42 +07:00
@@ -49 +49 @@ const TextInputActions: IAction[] = [
- new Action('editor.action.clipboardPasteAction', nls.localize('paste', "Paste"), undefined, true, () => Promise.resolve(document.execCommand('paste'))),
2019-02-07 01:59:03 +07:00
+ (require('vs/../../../../packages/vscode') as typeof import ('vs/../../../../packages/vscode')).client.pasteAction,
2019-02-22 00:55:42 +07:00
@@ -263 +263 @@ export class ElectronWindow extends Themable {
- (<any>window).open = function (url: string, target: string, features: string, replace: boolean): any {
+ (<any>window).openInvalid = function (url: string, target: string, features: string, replace: boolean): any {
2019-01-31 04:40:01 +07:00
diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts
2019-02-22 00:55:42 +07:00
index d82db96296..c9bd4e0325 100644
2019-01-31 04:40:01 +07:00
--- a/src/vs/workbench/electron-browser/workbench.ts
+++ b/src/vs/workbench/electron-browser/workbench.ts
2019-02-22 00:55:42 +07:00
@@ -272,0 +273 @@ export class Workbench extends Disposable implements IPartService {
2019-02-07 01:59:03 +07:00
+ (require('vs/../../../../packages/vscode') as typeof import ('vs/../../../../packages/vscode')).client.serviceCollection = serviceCollection;
2019-02-19 23:17:03 +07:00
diff --git a/src/vs/workbench/parts/debug/node/debugAdapter.ts b/src/vs/workbench/parts/debug/node/debugAdapter.ts
2019-02-22 00:55:42 +07:00
index 81954344b9..2bdce9603e 100644
2019-02-19 23:17:03 +07:00
--- a/src/vs/workbench/parts/debug/node/debugAdapter.ts
+++ b/src/vs/workbench/parts/debug/node/debugAdapter.ts
@@ -315 +315 @@ export class ExecutableDebugAdapter extends StreamDebugAdapter {
- return new Promise<void>((resolve, reject) => {
+ return new Promise<void>(async (resolve, reject) => {
@@ -320 +320 @@ export class ExecutableDebugAdapter extends StreamDebugAdapter {
- if (!fs.existsSync(this.adapterExecutable.command)) {
+ if (!(await require("util").promisify(fs.exists)(this.adapterExecutable.command))) {
2019-01-31 04:40:01 +07:00
diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts
2019-02-22 01:43:49 +07:00
index e66f74f034..759ffe0cef 100644
2019-01-31 04:40:01 +07:00
--- a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts
+++ b/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts
2019-02-22 00:55:42 +07:00
@@ -586,0 +587 @@ export class FileDragAndDrop implements ITreeDragAndDrop<ExplorerItem> {
2019-02-22 01:43:49 +07:00
+ return (require('vs/../../../../packages/vscode') as typeof import('vs/../../../../packages/vscode')).client.handleExternalDrop(target, originalEvent);
2019-02-19 23:17:03 +07:00
diff --git a/src/vs/workbench/parts/logs/electron-browser/logs.contribution.ts b/src/vs/workbench/parts/logs/electron-browser/logs.contribution.ts
index 4015c9cd5d..bebdb25f6c 100644
--- a/src/vs/workbench/parts/logs/electron-browser/logs.contribution.ts
+++ b/src/vs/workbench/parts/logs/electron-browser/logs.contribution.ts
@@ -31 +31,2 @@ class LogOutputChannels extends Disposable implements IWorkbenchContribution {
- outputChannelRegistry.registerChannel({ id: Constants.mainLogChannelId, label: nls.localize('mainLog', "Main"), file: URI.file(join(environmentService.logsPath, `main.log`)), log: true });
+ // This channel only seems to be used when loading the app and we skip all of that, so it is never actually created or written to.
+ // outputChannelRegistry.registerChannel({ id: Constants.mainLogChannelId, label: nls.localize('mainLog', "Main"), file: URI.file(join(environmentService.logsPath, `main.log`)), log: true });
diff --git a/src/vs/workbench/parts/output/common/outputLinkProvider.ts b/src/vs/workbench/parts/output/common/outputLinkProvider.ts
2019-02-22 00:55:42 +07:00
index 6d9451401a..510f5131ce 100644
2019-02-19 23:17:03 +07:00
--- a/src/vs/workbench/parts/output/common/outputLinkProvider.ts
+++ b/src/vs/workbench/parts/output/common/outputLinkProvider.ts
@@ -77,0 +78,2 @@ export class OutputLinkProvider {
2019-02-22 00:55:42 +07:00
+
2019-02-19 23:17:03 +07:00
+ return Promise.resolve([]);
2019-02-22 00:55:42 +07:00
diff --git a/src/vs/workbench/parts/webview/electron-browser/webview-pre.js b/src/vs/workbench/parts/webview/electron-browser/webview-pre.js
index 29593dc6b6..dd3d25098d 100644
--- a/src/vs/workbench/parts/webview/electron-browser/webview-pre.js
+++ b/src/vs/workbench/parts/webview/electron-browser/webview-pre.js
@@ -10 +10,19 @@
- const ipcRenderer = require('electron').ipcRenderer;
+ const ipcRenderer = {
+ on: (channel, callback) => {
+ window.addEventListener("message", (event) => {
+ if (event.data.channel === channel) {
+ callback(event.data.channel, ...event.data.data);
+ }
+ });
+ },
+ sendToHost: (channel, ...args) => {
+ window.parent.postMessage({
+ channel,
+ data: args,
+ id: document.body.id,
+ }, "*");
+ },
+ };
+ const process = {
+ pid: undefined,
+ };
@@ -22,7 +40,7 @@
- require('electron').webFrame.registerURLSchemeAsPrivileged('vscode-resource', {
- secure: true,
- bypassCSP: false,
- allowServiceWorkers: false,
- supportFetchAPI: true,
- corsEnabled: true
- });
+ // require('electron').webFrame.registerURLSchemeAsPrivileged('vscode-resource', {
+ // secure: true,
+ // bypassCSP: false,
+ // allowServiceWorkers: false,
+ // supportFetchAPI: true,
+ // corsEnabled: true
+ // });
diff --git a/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts b/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts
index 5d9110300f..ecdc40b0eb 100644
--- a/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts
+++ b/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts
@@ -261,0 +262,3 @@ export class WebviewElement extends Disposable {
+ Object.defineProperty(this._options, 'useSameOriginForRoot', {
+ value: true,
+ });
2019-01-15 03:58:34 +07:00
diff --git a/src/vs/workbench/parts/welcome/walkThrough/node/walkThroughContentProvider.ts b/src/vs/workbench/parts/welcome/walkThrough/node/walkThroughContentProvider.ts
2019-02-22 00:55:42 +07:00
index 147f05b246..fa89583203 100644
2019-01-15 03:58:34 +07:00
--- a/src/vs/workbench/parts/welcome/walkThrough/node/walkThroughContentProvider.ts
+++ b/src/vs/workbench/parts/welcome/walkThrough/node/walkThroughContentProvider.ts
2019-02-07 02:20:40 +07:00
@@ -31,6 +31,6 @@ export class WalkThroughContentProvider implements ITextModelContentProvider, IW
2019-01-15 03:58:34 +07:00
- require([query.moduleId], content => {
2019-02-02 08:55:32 +07:00
- try {
- resolve(content.default());
- } catch (err) {
- reject(err);
- }
+ // This works because the only walkthrough that is a module is the welcome page.
+ // We have to explicitly import it or Webpack won't pick it up.
2019-01-15 03:58:34 +07:00
+ import("vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page").then((content) => {
2019-02-02 08:55:32 +07:00
+ resolve(content.default());
+ }).catch((err) => {
+ reject(err);
2019-02-07 02:20:40 +07:00
@@ -38 +38,3 @@ export class WalkThroughContentProvider implements ITextModelContentProvider, IW
2019-02-02 08:55:32 +07:00
- }) : this.textFileService.resolveTextContent(URI.file(resource.fsPath)).then(content => content.value));
+ }) : (resource.scheme !== "file"
+ ? fetch(resource.path).then((res) => res.text())
+ : this.textFileService.resolveTextContent(URI.file(resource.fsPath)).then(content => content.value)));
2019-02-07 02:20:40 +07:00
@@ -64 +66 @@ export class WalkThroughSnippetContentProvider implements ITextModelContentProvi
2019-02-02 08:55:32 +07:00
- return this.textFileService.resolveTextContent(URI.file(resource.fsPath)).then(content => {
+ return fetch(resource.path).then((res) => res.text()).then((content) => {
2019-02-07 02:20:40 +07:00
@@ -81,5 +83,5 @@ export class WalkThroughSnippetContentProvider implements ITextModelContentProvi
2019-02-02 08:55:32 +07:00
- const textBuffer = content.value.create(DefaultEndOfLine.LF);
- const lineCount = textBuffer.getLineCount();
- const range = new Range(1, 1, lineCount, textBuffer.getLineLength(lineCount) + 1);
- const markdown = textBuffer.getValueInRange(range, EndOfLinePreference.TextDefined);
- marked(markdown, { renderer });
+ // const textBuffer = content.value.create(DefaultEndOfLine.LF);
+ // const lineCount = textBuffer.getLineCount();
+ // const range = new Range(1, 1, lineCount, textBuffer.getLineLength(lineCount) + 1);
+ // const markdown = textBuffer.getValueInRange(range, EndOfLinePreference.TextDefined);
+ marked(content, { renderer });
2019-02-07 02:20:40 +07:00
@@ -91 +93 @@ export class WalkThroughSnippetContentProvider implements ITextModelContentProvi
2019-02-02 08:55:32 +07:00
- this.modelService.updateModel(codeEditorModel, content.value);
+ this.modelService.updateModel(codeEditorModel, content);
2019-02-07 00:01:15 +07:00
diff --git a/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts b/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts
2019-02-22 00:55:42 +07:00
index 29cbfd65c4..1091dc3c8a 100644
2019-02-07 00:01:15 +07:00
--- a/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts
+++ b/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts
2019-02-07 02:20:40 +07:00
@@ -33,0 +34 @@ function getSystemExtensionsRoot(): string {
2019-02-07 01:59:03 +07:00
+ return (require('vs/../../../../packages/vscode') as typeof import ('vs/../../../../packages/vscode')).client.builtInExtensionsDirectory;
2019-02-22 00:55:42 +07:00
diff --git a/src/vs/workbench/services/extensions/node/extensionHostProcess.ts b/src/vs/workbench/services/extensions/node/extensionHostProcess.ts
index 5f2935618c..af5498d7ac 100644
--- a/src/vs/workbench/services/extensions/node/extensionHostProcess.ts
+++ b/src/vs/workbench/services/extensions/node/extensionHostProcess.ts
@@ -132 +132 @@ function connectToRenderer(protocol: IMessagePassingProtocol): Promise<IRenderer
- process.kill(initData.parentPid, 0); // throws an exception if the main process doesn't exist anymore.
+ // process.kill(initData.parentPid, 0); // throws an exception if the main process doesn't exist anymore.
diff --git a/src/vs/workbench/workbench.main.ts b/src/vs/workbench/workbench.main.ts
index 1ad274696d..f52d1e0d2e 100644
--- a/src/vs/workbench/workbench.main.ts
+++ b/src/vs/workbench/workbench.main.ts
@@ -25 +25 @@ import 'vs/workbench/browser/actions/navigationActions';
-import 'vs/workbench/browser/parts/quickopen/quickopenActions';
+import 'vs/workbench/browser/parts/quickopen/quickOpenActions';