@@ -2,50 +2,27 @@ diff --git a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts b/s
22index 457818a975..ad45ffe58a 100644
33--- a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts
44+++ b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts
5- @@ -194,3 +194,5 @@ async function handshake(configuration: ISharedProcessConfiguration): Promise<vo
6- main(server, data, configuration);
7- ipcRenderer.send('handshake:im ready');
8- }
5+ @@ -196,0 +197,2 @@ async function handshake(configuration: ISharedProcessConfiguration): Promise<vo
96+
107+ startup({ machineId: "1" });
118diff --git a/src/vs/editor/contrib/clipboard/clipboard.ts b/src/vs/editor/contrib/clipboard/clipboard.ts
129index 5e43f1b39e..a008d3ac7e 100644
1310--- a/src/vs/editor/contrib/clipboard/clipboard.ts
1411+++ b/src/vs/editor/contrib/clipboard/clipboard.ts
15- @@ -26,7 +26,8 @@ const supportsCopyWithSyntaxHighlighting = (supportsCopy && !browser.isEdgeOrIE)
16- // Chrome incorrectly returns true for document.queryCommandSupported('paste')
17- // when the paste feature is available but the calling script has insufficient
18- // privileges to actually perform the action
12+ @@ -29 +29,2 @@ const supportsCopyWithSyntaxHighlighting = (supportsCopy && !browser.isEdgeOrIE)
1913- const supportsPaste = (platform.isNative || (!browser.isChrome && document.queryCommandSupported('paste')));
2014+ // const supportsPaste = (platform.isNative || (!browser.isChrome && document.queryCommandSupported('paste')));
2115+ const supportsPaste = true;
22-
23- type ExecCommand = 'cut' | 'copy' | 'paste';
24-
25- @@ -174,11 +175,12 @@ class ExecCommandPasteAction extends ExecCommandAction {
26- kbOpts = null;
27- }
28-
16+ @@ -176,0 +178 @@ class ExecCommandPasteAction extends ExecCommandAction {
2917+ const { client } = require('vs/../../../../packages/vscode') as typeof import ('vs/../../../../packages/vscode');
30- super('paste', {
31- id: 'editor.action.clipboardPasteAction',
32- label: nls.localize('actions.clipboard.pasteLabel', "Paste"),
33- alias: 'Paste',
18+ @@ -181 +183 @@ class ExecCommandPasteAction extends ExecCommandAction {
3419- precondition: EditorContextKeys.writable,
3520+ precondition: (require('vs/platform/contextkey/common/contextkey') as typeof import('vs/platform/contextkey/common/contextkey')).ContextKeyExpr.and(EditorContextKeys.writable, client.clipboardContextKey),
36- kbOpts: kbOpts,
37- menuOpts: {
38- group: CLIPBOARD_CONTEXT_MENU_GROUP,
39- @@ -188,10 +190,25 @@ class ExecCommandPasteAction extends ExecCommandAction {
40- menuId: MenuId.MenubarEditMenu,
41- group: '2_ccp',
42- title: nls.localize({ key: 'miPaste', comment: ['&& denotes a mnemonic'] }, "&&Paste"),
21+ @@ -191 +193,2 @@ class ExecCommandPasteAction extends ExecCommandAction {
4322- order: 3
4423+ order: 3,
4524+ when: client.clipboardContextKey,
46- }
47- });
48- }
25+ @@ -194,0 +198,14 @@ class ExecCommandPasteAction extends ExecCommandAction {
4926+
5027+ public async run(accessor, editor: ICodeEditor): Promise<void> {
5128+ if (editor instanceof (require('vs/editor/browser/widget/codeEditorWidget') as typeof import('vs/editor/browser/widget/codeEditorWidget')).CodeEditorWidget) {
@@ -60,17 +37,11 @@ index 5e43f1b39e..a008d3ac7e 100644
6037+ super.run(accessor, editor);
6138+ }
6239+ }
63- }
64-
65- class ExecCommandCopyWithSyntaxHighlightingAction extends ExecCommandAction {
6640diff --git a/src/vs/loader.js b/src/vs/loader.js
6741index 2bf7fe37d7..81cc668f12 100644
6842--- a/src/vs/loader.js
6943+++ b/src/vs/loader.js
70- @@ -667,10 +667,10 @@ var AMDLoader;
71- }
72- this._didInitialize = true;
73- // capture node modules
44+ @@ -670,4 +670,4 @@ var AMDLoader;
7445- this._fs = nodeRequire('fs');
7546- this._vm = nodeRequire('vm');
7647- this._path = nodeRequire('path');
@@ -79,64 +50,37 @@ index 2bf7fe37d7..81cc668f12 100644
7950+ this._vm = require('vm');
8051+ this._path = require('path');
8152+ this._crypto = require('crypto');
82- };
83- // patch require-function of nodejs such that we can manually create a script
84- // from cached data. this is done by overriding the `Module._compile` function
85- @@ -731,11 +731,18 @@ var AMDLoader;
86- this._init(nodeRequire);
87- this._initNodeRequire(nodeRequire, moduleManager);
88- var recorder = moduleManager.getRecorder();
53+ @@ -733,0 +734,7 @@ var AMDLoader;
8954+ const context = require.context("../", true, /.*/);
9055+ if (scriptSrc.indexOf("file:///") !== -1) {
9156+ const vsSrc = scriptSrc.split("file:///")[1].split(".js")[0];
9257+ if (vsSrc && vsSrc.startsWith("vs/")) {
9358+ scriptSrc = `node|./${vsSrc}`;
9459+ }
9560+ }
96- if (/^node\|/.test(scriptSrc)) {
97- var pieces = scriptSrc.split('|');
98- var moduleExports_1 = null;
99- try {
61+ @@ -738 +745 @@ var AMDLoader;
10062- moduleExports_1 = nodeRequire(pieces[1]);
10163+ moduleExports_1 = context(pieces[1]);
102- }
103- catch (err) {
104- errorback(err);
10564diff --git a/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts b/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts
10665index e3efb95b75..163bc4c994 100644
10766--- a/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts
10867+++ b/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts
109- @@ -55,6 +55,9 @@ export class HeapService implements IHeapService {
110-
111- private _doTrackRecursive(obj: any): Promise<any> {
112-
68+ @@ -57,0 +58,3 @@ export class HeapService implements IHeapService {
11369+ // Cannot control GC in the browser.
11470+ return Promise.resolve(obj);
11571+
116- if (isNullOrUndefined(obj)) {
117- return Promise.resolve(obj);
118- }
11972diff --git a/src/vs/workbench/browser/dnd.ts b/src/vs/workbench/browser/dnd.ts
12073index 38bf337a61..a6ee664a20 100644
12174--- a/src/vs/workbench/browser/dnd.ts
12275+++ b/src/vs/workbench/browser/dnd.ts
123- @@ -168,7 +168,7 @@ export class ResourcesDropHandler {
124- handleDrop(event: DragEvent, resolveTargetGroup: () => IEditorGroup, afterDrop: (targetGroup: IEditorGroup) => void, targetIndex?: number): void {
125- const untitledOrFileResources = extractResources(event).filter(r => this.fileService.canHandleResource(r.resource) || r.resource.scheme === Schemas.untitled);
126- if (!untitledOrFileResources.length) {
76+ @@ -171 +171 @@ export class ResourcesDropHandler {
12777- return;
12878+ return (require('vs/../../../../packages/vscode') as typeof import ('vs/../../../../packages/vscode')).client.handleDrop(event, resolveTargetGroup, afterDrop, targetIndex);
129- }
130-
131- // Make the window active to handle the drop properly within
13279diff --git a/src/vs/workbench/electron-browser/main.ts b/src/vs/workbench/electron-browser/main.ts
13380index a43d63aa51..438d0a8245 100644
13481--- a/src/vs/workbench/electron-browser/main.ts
13582+++ b/src/vs/workbench/electron-browser/main.ts
136- @@ -147,13 +147,13 @@ function openWorkbench(configuration: IWindowConfiguration): Promise<void> {
137- shell.open();
138-
139- // Inform user about loading issues from the loader
83+ @@ -150,7 +150,7 @@ function openWorkbench(configuration: IWindowConfiguration): Promise<void> {
14084- (<any>self).require.config({
14185- onError: err => {
14286- if (err.errorCode === 'load') {
@@ -151,67 +95,37 @@ index a43d63aa51..438d0a8245 100644
15195+ // }
15296+ // }
15397+ // });
154- });
155- });
156- });
15798diff --git a/src/vs/workbench/electron-browser/window.ts b/src/vs/workbench/electron-browser/window.ts
15899index ea348f3a04..ada0003fea 100644
159100--- a/src/vs/workbench/electron-browser/window.ts
160101+++ b/src/vs/workbench/electron-browser/window.ts
161- @@ -45,7 +45,7 @@ const TextInputActions: IAction[] = [
162- new Separator(),
163- new Action('editor.action.clipboardCutAction', nls.localize('cut', "Cut"), null, true, () => document.execCommand('cut') && Promise.resolve(true)),
164- new Action('editor.action.clipboardCopyAction', nls.localize('copy', "Copy"), null, true, () => document.execCommand('copy') && Promise.resolve(true)),
102+ @@ -48 +48 @@ const TextInputActions: IAction[] = [
165103- new Action('editor.action.clipboardPasteAction', nls.localize('paste', "Paste"), null, true, () => document.execCommand('paste') && Promise.resolve(true)),
166104+ (require('vs/../../../../packages/vscode') as typeof import ('vs/../../../../packages/vscode')).client.pasteAction,
167- new Separator(),
168- new Action('editor.action.selectAll', nls.localize('selectAll', "Select All"), null, true, () => document.execCommand('selectAll') && Promise.resolve(true))
169- ];
170105diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts
171106index 35bc4a82b3..45e96001b6 100644
172107--- a/src/vs/workbench/electron-browser/workbench.ts
173108+++ b/src/vs/workbench/electron-browser/workbench.ts
174- @@ -248,6 +248,7 @@ export class Workbench extends Disposable implements IPartService {
175- super();
176-
177- this.workbenchParams = { configuration, serviceCollection };
109+ @@ -250,0 +251 @@ export class Workbench extends Disposable implements IPartService {
178110+ (require('vs/../../../../packages/vscode') as typeof import ('vs/../../../../packages/vscode')).client.serviceCollection = serviceCollection;
179-
180- this.hasInitialFilesToOpen =
181- (configuration.filesToCreate && configuration.filesToCreate.length > 0) ||
182111diff --git a/src/vs/workbench/node/extensionHostProcess.ts b/src/vs/workbench/node/extensionHostProcess.ts
183112index 8d182d18d9..69d51e1aea 100644
184113--- a/src/vs/workbench/node/extensionHostProcess.ts
185114+++ b/src/vs/workbench/node/extensionHostProcess.ts
186- @@ -129,7 +129,7 @@ function connectToRenderer(protocol: IMessagePassingProtocol): Promise<IRenderer
187- // Kill oneself if one's parent dies. Much drama.
188- setInterval(function () {
189- try {
115+ @@ -132 +132 @@ function connectToRenderer(protocol: IMessagePassingProtocol): Promise<IRenderer
190116- process.kill(initData.parentPid, 0); // throws an exception if the main process doesn't exist anymore.
191117+ // process.kill(initData.parentPid, 0); // throws an exception if the main process doesn't exist anymore.
192- } catch (e) {
193- onTerminate();
194- }
195118diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts
196119index e600fb2f78..1e0dc9a220 100644
197120--- a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts
198121+++ b/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts
199- @@ -932,6 +932,7 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop {
200- }
201-
202- private handleExternalDrop(tree: ITree, data: DesktopDragAndDropData, target: ExplorerItem | Model, originalEvent: DragMouseEvent): TPromise<void> {
122+ @@ -934,0 +935 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop {
203123+ return (require('vs/../../../../packages/vscode') as typeof import ('vs/../../../../packages/vscode')).client.handleExternalDrop(target, originalEvent);
204- const droppedResources = extractResources(originalEvent.browserEvent as DragEvent, true);
205-
206- // Check for dropped external files to be folders
207124diff --git a/src/vs/workbench/parts/welcome/walkThrough/node/walkThroughContentProvider.ts b/src/vs/workbench/parts/welcome/walkThrough/node/walkThroughContentProvider.ts
208125index 7b4e8721ac..96d612f940 100644
209126--- a/src/vs/workbench/parts/welcome/walkThrough/node/walkThroughContentProvider.ts
210127+++ b/src/vs/workbench/parts/welcome/walkThrough/node/walkThroughContentProvider.ts
211- @@ -28,14 +28,16 @@ export class WalkThroughContentProvider implements ITextModelContentProvider, IW
212- public provideTextContent(resource: URI): Thenable<ITextModel> {
213- const query = resource.query ? JSON.parse(resource.query) : {};
214- const content: Thenable<string | ITextBufferFactory> = (query.moduleId ? new Promise<string>((resolve, reject) => {
128+ @@ -31,6 +31,6 @@ export class WalkThroughContentProvider implements ITextModelContentProvider, IW
215129- require([query.moduleId], content => {
216130- try {
217131- resolve(content.default());
@@ -224,27 +138,15 @@ index 7b4e8721ac..96d612f940 100644
224138+ resolve(content.default());
225139+ }).catch((err) => {
226140+ reject(err);
227- });
141+ @@ -38 +38,3 @@ export class WalkThroughContentProvider implements ITextModelContentProvider, IW
228142- }) : this.textFileService.resolveTextContent(URI.file(resource.fsPath)).then(content => content.value));
229143+ }) : (resource.scheme !== "file"
230144+ ? fetch(resource.path).then((res) => res.text())
231145+ : this.textFileService.resolveTextContent(URI.file(resource.fsPath)).then(content => content.value)));
232- return content.then(content => {
233- let codeEditorModel = this.modelService.getModel(resource);
234- if (!codeEditorModel) {
235- @@ -61,7 +63,7 @@ export class WalkThroughSnippetContentProvider implements ITextModelContentProvi
236- }
237-
238- public provideTextContent(resource: URI): Thenable<ITextModel> {
146+ @@ -64 +66 @@ export class WalkThroughSnippetContentProvider implements ITextModelContentProvi
239147- return this.textFileService.resolveTextContent(URI.file(resource.fsPath)).then(content => {
240148+ return fetch(resource.path).then((res) => res.text()).then((content) => {
241- let codeEditorModel = this.modelService.getModel(resource);
242- if (!codeEditorModel) {
243- const j = parseInt(resource.fragment);
244- @@ -78,17 +80,17 @@ export class WalkThroughSnippetContentProvider implements ITextModelContentProvi
245- return '';
246- };
247-
149+ @@ -81,5 +83,5 @@ export class WalkThroughSnippetContentProvider implements ITextModelContentProvi
248150- const textBuffer = content.value.create(DefaultEndOfLine.LF);
249151- const lineCount = textBuffer.getLineCount();
250152- const range = new Range(1, 1, lineCount, textBuffer.getLineLength(lineCount) + 1);
@@ -255,38 +157,19 @@ index 7b4e8721ac..96d612f940 100644
255157+ // const range = new Range(1, 1, lineCount, textBuffer.getLineLength(lineCount) + 1);
256158+ // const markdown = textBuffer.getValueInRange(range, EndOfLinePreference.TextDefined);
257159+ marked(content, { renderer });
258-
259- const languageId = this.modeService.getModeIdForLanguageName(languageName);
260- const languageSelection = this.modeService.create(languageId);
261- codeEditorModel = this.modelService.createModel(codeSnippet, languageSelection, resource);
262- } else {
160+ @@ -91 +93 @@ export class WalkThroughSnippetContentProvider implements ITextModelContentProvi
263161- this.modelService.updateModel(codeEditorModel, content.value);
264162+ this.modelService.updateModel(codeEditorModel, content);
265- }
266-
267- return codeEditorModel;
268163diff --git a/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts b/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts
269164index 4cb7a231f3..78c87d13f6 100644
270165--- a/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts
271166+++ b/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts
272- @@ -31,6 +31,7 @@ interface IExtensionCacheData {
273-
274- let _SystemExtensionsRoot: string | null = null;
275- function getSystemExtensionsRoot(): string {
167+ @@ -33,0 +34 @@ function getSystemExtensionsRoot(): string {
276168+ return (require('vs/../../../../packages/vscode') as typeof import ('vs/../../../../packages/vscode')).client.builtInExtensionsDirectory;
277- if (!_SystemExtensionsRoot) {
278- _SystemExtensionsRoot = path.normalize(path.join(getPathFromAmdModule(require, ''), '..', 'extensions'));
279- }
280169diff --git a/src/vs/workbench/services/themes/electron-browser/fileIconThemeData.ts b/src/vs/workbench/services/themes/electron-browser/fileIconThemeData.ts
281170index 5b4136989f..25ccc0fe9e 100644
282171--- a/src/vs/workbench/services/themes/electron-browser/fileIconThemeData.ts
283172+++ b/src/vs/workbench/services/themes/electron-browser/fileIconThemeData.ts
284- @@ -178,7 +178,7 @@ function _processIconThemeDocument(id: string, iconThemeDocumentLocation: URI, i
285-
286- const iconThemeDocumentLocationDirname = resources.dirname(iconThemeDocumentLocation);
287- function resolvePath(path: string) {
173+ @@ -181 +181 @@ function _processIconThemeDocument(id: string, iconThemeDocumentLocation: URI, i
288174- return resources.joinPath(iconThemeDocumentLocationDirname, path);
289175+ return "/resource" + resources.joinPath(iconThemeDocumentLocationDirname, path).path;
290- }
291-
292- function collectSelectors(associations: IconsAssociation, baseThemeClassName?: string) {
0 commit comments