diff --git a/src/vs/platform/windows/electron-main/windowsService.ts b/src/vs/platform/windows/electron-main/windowsService.ts index 4722e6c8e9b07bd635856b1494d9f6e1f3a41648..f74d5c7984998f05e8c6963340ea9763a75ad191 100644 --- a/src/vs/platform/windows/electron-main/windowsService.ts +++ b/src/vs/platform/windows/electron-main/windowsService.ts @@ -334,7 +334,21 @@ export class WindowsService extends Disposable implements IWindowsService, IURLH } async log(severity: string, ...messages: string[]): Promise { - console[severity].apply(console, ...messages); + let consoleFn = console.log; + + switch (severity) { + case 'error': + consoleFn = console.error; + break; + case 'warn': + consoleFn = console.warn; + break; + case 'info': + consoleFn = console.info; + break; + } + + consoleFn(...messages); } async showItemInFolder(resource: URI): Promise { diff --git a/src/vs/workbench/browser/editor.ts b/src/vs/workbench/browser/editor.ts index f65ab63ac54eb15bb0503ac22cfb66be13bf0577..a7f3c099ea2458274b9147d848b1acf947397e30 100644 --- a/src/vs/workbench/browser/editor.ts +++ b/src/vs/workbench/browser/editor.ts @@ -81,10 +81,10 @@ export class EditorDescriptor implements IEditorDescriptor { } } -const INPUT_DESCRIPTORS_PROPERTY = '__$inputDescriptors'; - class EditorRegistry implements IEditorRegistry { + private editors: EditorDescriptor[] = []; + private readonly mapEditorToInputs = new Map[]>(); registerEditor(descriptor: EditorDescriptor, editorInputDescriptor: SyncDescriptor): void; registerEditor(descriptor: EditorDescriptor, editorInputDescriptor: SyncDescriptor[]): void; @@ -99,7 +99,8 @@ class EditorRegistry implements IEditorRegistry { } // Register (Support multiple Editors per Input) - descriptor[INPUT_DESCRIPTORS_PROPERTY] = inputDescriptors; + this.mapEditorToInputs.set(descriptor, inputDescriptors); + this.editors.push(descriptor); } @@ -108,20 +109,22 @@ class EditorRegistry implements IEditorRegistry { const matchingDescriptors: EditorDescriptor[] = []; for (const editor of this.editors) { - const inputDescriptors: SyncDescriptor[] = editor[INPUT_DESCRIPTORS_PROPERTY]; - for (const inputDescriptor of inputDescriptors) { - const inputClass = inputDescriptor.ctor; - - // Direct check on constructor type (ignores prototype chain) - if (!byInstanceOf && input.constructor === inputClass) { - matchingDescriptors.push(editor); - break; - } - - // Normal instanceof check - else if (byInstanceOf && input instanceof inputClass) { - matchingDescriptors.push(editor); - break; + const inputDescriptors: SyncDescriptor[] | undefined = this.mapEditorToInputs.get(editor); + if (inputDescriptors) { + for (const inputDescriptor of inputDescriptors) { + const inputClass = inputDescriptor.ctor; + + // Direct check on constructor type (ignores prototype chain) + if (!byInstanceOf && input.constructor === inputClass) { + matchingDescriptors.push(editor); + break; + } + + // Normal instanceof check + else if (byInstanceOf && input instanceof inputClass) { + matchingDescriptors.push(editor); + break; + } } } } @@ -175,8 +178,10 @@ class EditorRegistry implements IEditorRegistry { getEditorInputs(): SyncDescriptor[] { const inputClasses: SyncDescriptor[] = []; for (const editor of this.editors) { - const editorInputDescriptors: SyncDescriptor[] = editor[INPUT_DESCRIPTORS_PROPERTY]; - inputClasses.push(...editorInputDescriptors.map(descriptor => descriptor.ctor)); + const editorInputDescriptors: SyncDescriptor[] | undefined = this.mapEditorToInputs.get(editor); + if (editorInputDescriptors) { + inputClasses.push(...editorInputDescriptors.map(descriptor => descriptor.ctor)); + } } return inputClasses; diff --git a/src/vs/workbench/electron-browser/window.ts b/src/vs/workbench/electron-browser/window.ts index a1001064bfc4d84226203b2fb3379d49a6305520..d3c487340600e081ac7626ecb19cde4e69253dbb 100644 --- a/src/vs/workbench/electron-browser/window.ts +++ b/src/vs/workbench/electron-browser/window.ts @@ -408,7 +408,7 @@ export class ElectronWindow extends Disposable { const options = { companyName: product.crashReporter.companyName, productName: product.crashReporter.productName, - submitURL: isWindows ? product.hockeyApp[`win32-${process.arch}`] : isLinux ? product.hockeyApp[`linux-${process.arch}`] : product.hockeyApp.darwin, + submitURL: isWindows ? product.hockeyApp[process.arch === 'ia32' ? 'win32-ia32' : 'win32-x64'] : isLinux ? product.hockeyApp[`linux-x64`] : product.hockeyApp.darwin, extra: { vscode_version: pkg.version, vscode_commit: product.commit