diff --git a/src/vs/code/electron-main/windows.ts b/src/vs/code/electron-main/windows.ts index 93a7c4c7120c8a980d725d1c236acc028a843242..754a63af36dfe6481ca4abf941c25a54f0807803 100644 --- a/src/vs/code/electron-main/windows.ts +++ b/src/vs/code/electron-main/windows.ts @@ -7,7 +7,6 @@ import * as path from 'path'; import * as fs from 'original-fs'; -import * as platform from 'vs/base/common/platform'; import * as nls from 'vs/nls'; import * as arrays from 'vs/base/common/arrays'; import { assign, mixin } from 'vs/base/common/objects'; @@ -28,6 +27,7 @@ import { ITelemetryService, ITelemetryData } from 'vs/platform/telemetry/common/ import { isEqual, isEqualOrParent } from 'vs/platform/files/common/files'; import { IWindowsMainService, IOpenConfiguration } from "vs/platform/windows/electron-main/windows"; import { IHistoryMainService } from "vs/platform/history/electron-main/historyMainService"; +import { IProcessEnvironment, isLinux, isMacintosh } from "vs/base/common/platform"; enum WindowError { UNRESPONSIVE, @@ -55,6 +55,23 @@ const ReopenFoldersSetting = { NONE: 'none' }; +interface IOpenBrowserWindowOptions { + userEnv?: IProcessEnvironment; + cli?: ParsedArgs; + workspacePath?: string; + + initialStartup?: boolean; + + filesToOpen?: IPath[]; + filesToCreate?: IPath[]; + filesToDiff?: IPath[]; + + forceNewWindow?: boolean; + windowToUse?: CodeWindow; + + emptyWorkspaceBackupFolder?: string; +} + export class WindowsManager implements IWindowsMainService { _serviceBrand: any; @@ -63,7 +80,7 @@ export class WindowsManager implements IWindowsMainService { private static WINDOWS: CodeWindow[] = []; - private initialUserEnv: platform.IProcessEnvironment; + private initialUserEnv: IProcessEnvironment; private windowsState: IWindowsState; private lastClosedWindowState: IWindowState; @@ -96,7 +113,7 @@ export class WindowsManager implements IWindowsMainService { this.fileDialog = new FileDialog(environmentService, telemetryService, storageService, this); } - public ready(initialUserEnv: platform.IProcessEnvironment): void { + public ready(initialUserEnv: IProcessEnvironment): void { this.initialUserEnv = initialUserEnv; this.registerListeners(); @@ -187,7 +204,7 @@ export class WindowsManager implements IWindowsMainService { // Any non extension host window with same workspace else if (!win.isExtensionDevelopmentHost && !!win.openedWorkspacePath) { this.windowsState.openedFolders.forEach(o => { - if (isEqual(o.workspacePath, win.openedWorkspacePath, !platform.isLinux /* ignorecase */)) { + if (isEqual(o.workspacePath, win.openedWorkspacePath, !isLinux /* ignorecase */)) { o.uiState = state.uiState; } }); @@ -203,67 +220,23 @@ export class WindowsManager implements IWindowsMainService { } public open(openConfig: IOpenConfiguration): CodeWindow[] { - const windowConfig = this.configurationService.getConfiguration('window'); - - let iPathsToOpen: IPath[]; - const usedWindows: CodeWindow[] = []; - // Find paths from provided paths if any - if (openConfig.pathsToOpen && openConfig.pathsToOpen.length > 0) { - iPathsToOpen = openConfig.pathsToOpen.map(pathToOpen => { - const iPath = this.toIPath(pathToOpen, false, openConfig.cli && openConfig.cli.goto); - - // Warn if the requested path to open does not exist - if (!iPath) { - const options: Electron.ShowMessageBoxOptions = { - title: product.nameLong, - type: 'info', - buttons: [nls.localize('ok', "OK")], - message: nls.localize('pathNotExistTitle', "Path does not exist"), - detail: nls.localize('pathNotExistDetail', "The path '{0}' does not seem to exist anymore on disk.", pathToOpen), - noLink: true - }; - - const activeWindow = BrowserWindow.getFocusedWindow(); - if (activeWindow) { - dialog.showMessageBox(activeWindow, options); - } else { - dialog.showMessageBox(options); - } - } - - return iPath; - }); - - // get rid of nulls - iPathsToOpen = arrays.coalesce(iPathsToOpen); - - if (iPathsToOpen.length === 0) { - return null; // indicate to outside that open failed - } + // Find paths to open from config + const pathsToOpen = this.getPathsToOpen(openConfig); + if (!pathsToOpen) { + return null; // indicate to outside that open failed } - // Check for force empty - else if (openConfig.forceEmpty) { - iPathsToOpen = [Object.create(null)]; - } - - // Otherwise infer from command line arguments - else { - const ignoreFileNotFound = openConfig.cli._.length > 0; // we assume the user wants to create this file from command line - iPathsToOpen = this.cliToPaths(openConfig.cli, ignoreFileNotFound); - } - - let foldersToOpen = arrays.distinct(iPathsToOpen.filter(iPath => iPath.workspacePath && !iPath.filePath).map(iPath => iPath.workspacePath), folder => platform.isLinux ? folder : folder.toLowerCase()); // prevent duplicates + let foldersToOpen = arrays.distinct(pathsToOpen.filter(iPath => iPath.workspacePath && !iPath.filePath).map(iPath => iPath.workspacePath), folder => isLinux ? folder : folder.toLowerCase()); // prevent duplicates let foldersToRestore = (openConfig.initialStartup && !openConfig.cli.extensionDevelopmentPath) ? this.backupService.getWorkspaceBackupPaths() : []; let filesToOpen: IPath[] = []; let filesToDiff: IPath[] = []; - let emptyToOpen = iPathsToOpen.filter(iPath => !iPath.workspacePath && !iPath.filePath); + let emptyToOpen = pathsToOpen.filter(iPath => !iPath.workspacePath && !iPath.filePath); let emptyToRestore = (openConfig.initialStartup && !openConfig.cli.extensionDevelopmentPath) ? this.backupService.getEmptyWorkspaceBackupPaths() : []; - let filesToCreate = iPathsToOpen.filter(iPath => !!iPath.filePath && iPath.createFilePath); + let filesToCreate = pathsToOpen.filter(iPath => !!iPath.filePath && iPath.createFilePath); // Diff mode needs special care - const candidates = iPathsToOpen.filter(iPath => !!iPath.filePath && !iPath.createFilePath); + const candidates = pathsToOpen.filter(iPath => !!iPath.filePath && !iPath.createFilePath); if (openConfig.diffMode) { if (candidates.length === 2) { filesToDiff = candidates; @@ -279,12 +252,14 @@ export class WindowsManager implements IWindowsMainService { } // let the user settings override how folders are open in a new window or same window unless we are forced + const windowConfig = this.configurationService.getConfiguration('window'); let openFolderInNewWindow = (openConfig.preferNewWindow || openConfig.forceNewWindow) && !openConfig.forceReuseWindow; if (!openConfig.forceNewWindow && !openConfig.forceReuseWindow && windowConfig && (windowConfig.openFoldersInNewWindow === 'on' || windowConfig.openFoldersInNewWindow === 'off')) { openFolderInNewWindow = (windowConfig.openFoldersInNewWindow === 'on'); } // Handle files to open/diff or to create when we dont open a folder and we do not restore any folder/untitled from hot-exit + const usedWindows: CodeWindow[] = []; if (!foldersToOpen.length && !foldersToRestore.length && !emptyToRestore.length && (filesToOpen.length > 0 || filesToCreate.length > 0 || filesToDiff.length > 0)) { // let the user settings override how files are open in a new window or same window unless we are forced (not for extension development though) @@ -323,8 +298,16 @@ export class WindowsManager implements IWindowsMainService { // Otherwise open instance with files else { - const configuration = this.toConfiguration(openConfig, windowOrFolder, filesToOpen, filesToCreate, filesToDiff); - const browserWindow = this.openInBrowserWindow(configuration, true /* new window */); + const browserWindow = this.openInBrowserWindow({ + userEnv: openConfig.userEnv, + cli: openConfig.cli, + initialStartup: openConfig.initialStartup, + workspacePath: windowOrFolder, + filesToOpen, + filesToCreate, + filesToDiff, + forceNewWindow: true + }); usedWindows.push(browserWindow); openFolderInNewWindow = true; // any other folders to open must open in new window then @@ -337,7 +320,7 @@ export class WindowsManager implements IWindowsMainService { } // Handle folders to open (instructed and to restore) - let allFoldersToOpen = arrays.distinct([...foldersToOpen, ...foldersToRestore], folder => platform.isLinux ? folder : folder.toLowerCase()); // prevent duplicates + let allFoldersToOpen = arrays.distinct([...foldersToOpen, ...foldersToRestore], folder => isLinux ? folder : folder.toLowerCase()); // prevent duplicates if (allFoldersToOpen.length > 0) { // Check for existing instances @@ -362,12 +345,21 @@ export class WindowsManager implements IWindowsMainService { // Open remaining ones allFoldersToOpen.forEach(folderToOpen => { - if (windowsOnWorkspacePath.some(win => isEqual(win.openedWorkspacePath, folderToOpen, !platform.isLinux /* ignorecase */))) { + if (windowsOnWorkspacePath.some(win => isEqual(win.openedWorkspacePath, folderToOpen, !isLinux /* ignorecase */))) { return; // ignore folders that are already open } - const configuration = this.toConfiguration(openConfig, folderToOpen, filesToOpen, filesToCreate, filesToDiff); - const browserWindow = this.openInBrowserWindow(configuration, openFolderInNewWindow, openFolderInNewWindow ? void 0 : openConfig.windowToUse as CodeWindow); + const browserWindow = this.openInBrowserWindow({ + userEnv: openConfig.userEnv, + cli: openConfig.cli, + initialStartup: openConfig.initialStartup, + workspacePath: folderToOpen, + filesToOpen, + filesToCreate, + filesToDiff, + forceNewWindow: openFolderInNewWindow, + windowToUse: openFolderInNewWindow ? void 0 : openConfig.windowToUse as CodeWindow + }); usedWindows.push(browserWindow); // Reset these because we handled them @@ -382,8 +374,16 @@ export class WindowsManager implements IWindowsMainService { // Handle empty if (emptyToRestore.length > 0) { emptyToRestore.forEach(emptyWorkspaceBackupFolder => { - const configuration = this.toConfiguration(openConfig, void 0, filesToOpen, filesToCreate, filesToDiff); - const browserWindow = this.openInBrowserWindow(configuration, true /* new window */, null, emptyWorkspaceBackupFolder); + const browserWindow = this.openInBrowserWindow({ + userEnv: openConfig.userEnv, + cli: openConfig.cli, + initialStartup: openConfig.initialStartup, + filesToOpen, + filesToCreate, + filesToDiff, + forceNewWindow: true, + emptyWorkspaceBackupFolder + }); usedWindows.push(browserWindow); // Reset these because we handled them @@ -398,8 +398,13 @@ export class WindowsManager implements IWindowsMainService { // Only open empty if no empty workspaces were restored else if (emptyToOpen.length > 0) { emptyToOpen.forEach(() => { - const configuration = this.toConfiguration(openConfig); - const browserWindow = this.openInBrowserWindow(configuration, openFolderInNewWindow, openFolderInNewWindow ? void 0 : openConfig.windowToUse as CodeWindow); + const browserWindow = this.openInBrowserWindow({ + userEnv: openConfig.userEnv, + cli: openConfig.cli, + initialStartup: openConfig.initialStartup, + forceNewWindow: openFolderInNewWindow, + windowToUse: openFolderInNewWindow ? void 0 : openConfig.windowToUse as CodeWindow + }); usedWindows.push(browserWindow); openFolderInNewWindow = true; // any other folders to open must open in new window then @@ -411,7 +416,7 @@ export class WindowsManager implements IWindowsMainService { if (!usedWindows.some(w => w.isExtensionDevelopmentHost) && !openConfig.cli.diff) { const recentPaths: { path: string; isFile?: boolean; }[] = []; - iPathsToOpen.forEach(iPath => { + pathsToOpen.forEach(iPath => { if (iPath.filePath || iPath.workspacePath) { app.addRecentDocument(iPath.filePath || iPath.workspacePath); recentPaths.push({ path: iPath.filePath || iPath.workspacePath, isFile: !!iPath.filePath }); @@ -424,57 +429,117 @@ export class WindowsManager implements IWindowsMainService { } // Emit events - this._onPathsOpen.fire(iPathsToOpen); + this._onPathsOpen.fire(pathsToOpen); return arrays.distinct(usedWindows); } - public openExtensionDevelopmentHostWindow(openConfig: IOpenConfiguration): void { + private getPathsToOpen(openConfig: IOpenConfiguration): IPath[] { + let iPathsToOpen: IPath[]; - // Reload an existing extension development host window on the same path - // We currently do not allow more than one extension development window - // on the same extension path. - let res = WindowsManager.WINDOWS.filter(w => w.config && isEqual(w.config.extensionDevelopmentPath, openConfig.cli.extensionDevelopmentPath, !platform.isLinux /* ignorecase */)); - if (res && res.length === 1) { - this.reload(res[0], openConfig.cli); - res[0].focus(); // make sure it gets focus and is restored + // Find paths from provided paths if any + if (openConfig.pathsToOpen && openConfig.pathsToOpen.length > 0) { + iPathsToOpen = openConfig.pathsToOpen.map(pathToOpen => { + const iPath = this.toIPath(pathToOpen, false, openConfig.cli && openConfig.cli.goto); - return; - } + // Warn if the requested path to open does not exist + if (!iPath) { + const options: Electron.ShowMessageBoxOptions = { + title: product.nameLong, + type: 'info', + buttons: [nls.localize('ok', "OK")], + message: nls.localize('pathNotExistTitle', "Path does not exist"), + detail: nls.localize('pathNotExistDetail', "The path '{0}' does not seem to exist anymore on disk.", pathToOpen), + noLink: true + }; - // Fill in previously opened workspace unless an explicit path is provided and we are not unit testing - if (openConfig.cli._.length === 0 && !openConfig.cli.extensionTestsPath) { - const workspaceToOpen = this.windowsState.lastPluginDevelopmentHostWindow && this.windowsState.lastPluginDevelopmentHostWindow.workspacePath; - if (workspaceToOpen) { - openConfig.cli._ = [workspaceToOpen]; + const activeWindow = BrowserWindow.getFocusedWindow(); + if (activeWindow) { + dialog.showMessageBox(activeWindow, options); + } else { + dialog.showMessageBox(options); + } + } + + return iPath; + }); + + // get rid of nulls + iPathsToOpen = arrays.coalesce(iPathsToOpen); + + if (iPathsToOpen.length === 0) { + return null; // indicate to outside that open failed } } - // Make sure we are not asked to open a path that is already opened - if (openConfig.cli._.length > 0) { - res = WindowsManager.WINDOWS.filter(w => w.openedWorkspacePath && openConfig.cli._.indexOf(w.openedWorkspacePath) >= 0); - if (res.length) { - openConfig.cli._ = []; - } + // Check for force empty + else if (openConfig.forceEmpty) { + iPathsToOpen = [Object.create(null)]; } - // Open it - this.open({ context: openConfig.context, cli: openConfig.cli, forceNewWindow: true, forceEmpty: openConfig.cli._.length === 0, userEnv: openConfig.userEnv }); + // Otherwise infer from command line arguments + else if (openConfig.cli._.length > 0) { + iPathsToOpen = this.doExtractPathsFromCLI(openConfig.cli); + } + + // Finally check for paths from previous session + else { + iPathsToOpen = this.doExtractPathsFromLastSession(); + } + + return iPathsToOpen; } - private toConfiguration(config: IOpenConfiguration, workspacePath?: string, filesToOpen?: IPath[], filesToCreate?: IPath[], filesToDiff?: IPath[]): IWindowConfiguration { - const configuration: IWindowConfiguration = mixin({}, config.cli); // inherit all properties from CLI - configuration.appRoot = this.environmentService.appRoot; - configuration.execPath = process.execPath; - configuration.userEnv = assign({}, this.initialUserEnv, config.userEnv || {}); - configuration.isInitialStartup = config.initialStartup; - configuration.workspacePath = workspacePath; - configuration.filesToOpen = filesToOpen; - configuration.filesToCreate = filesToCreate; - configuration.filesToDiff = filesToDiff; - configuration.nodeCachedDataDir = this.environmentService.nodeCachedDataDir; + private doExtractPathsFromCLI(cli: ParsedArgs): IPath[] { + const candidates: string[] = cli._; + + const iPaths = candidates.map(candidate => this.toIPath(candidate, true /* ignoreFileNotFound */, cli.goto)).filter(path => !!path); + if (iPaths.length > 0) { + return iPaths; + } + + // No path provided, return empty to open empty + return [Object.create(null)]; + } + + private doExtractPathsFromLastSession(): IPath[] { + const candidates: string[] = []; + + let reopenFolders: string; + if (this.lifecycleService.wasRestarted) { + reopenFolders = ReopenFoldersSetting.ALL; // always reopen all folders when an update was applied + } else { + const windowConfig = this.configurationService.getConfiguration('window'); + reopenFolders = (windowConfig && windowConfig.reopenFolders) || ReopenFoldersSetting.ONE; + } + + const lastActiveFolder = this.windowsState.lastActiveWindow && this.windowsState.lastActiveWindow.workspacePath; + + // Restore all + if (reopenFolders === ReopenFoldersSetting.ALL) { + const lastOpenedFolders = this.windowsState.openedFolders.map(o => o.workspacePath); + + // If we have a last active folder, move it to the end + if (lastActiveFolder) { + lastOpenedFolders.splice(lastOpenedFolders.indexOf(lastActiveFolder), 1); + lastOpenedFolders.push(lastActiveFolder); + } + + candidates.push(...lastOpenedFolders); + } + + // Restore last active + else if (lastActiveFolder && (reopenFolders === ReopenFoldersSetting.ONE || reopenFolders !== ReopenFoldersSetting.NONE)) { + candidates.push(lastActiveFolder); + } + + const iPaths = candidates.map(candidate => this.toIPath(candidate)).filter(path => !!path); + if (iPaths.length > 0) { + return iPaths; + } - return configuration; + // No path provided, return empty to open empty + return [Object.create(null)]; } private toIPath(anyPath: string, ignoreFileNotFound?: boolean, gotoLineMode?: boolean): IPath { @@ -511,59 +576,57 @@ export class WindowsManager implements IWindowsMainService { return null; } - private cliToPaths(cli: ParsedArgs, ignoreFileNotFound?: boolean): IPath[] { - - // Check for pass in candidate or last opened path - let candidates: string[] = []; - if (cli._.length > 0) { - candidates = cli._; - } - - // No path argument, check settings for what to do now - else { - let reopenFolders: string; - if (this.lifecycleService.wasRestarted) { - reopenFolders = ReopenFoldersSetting.ALL; // always reopen all folders when an update was applied - } else { - const windowConfig = this.configurationService.getConfiguration('window'); - reopenFolders = (windowConfig && windowConfig.reopenFolders) || ReopenFoldersSetting.ONE; - } - - const lastActiveFolder = this.windowsState.lastActiveWindow && this.windowsState.lastActiveWindow.workspacePath; - - // Restore all - if (reopenFolders === ReopenFoldersSetting.ALL) { - const lastOpenedFolders = this.windowsState.openedFolders.map(o => o.workspacePath); + public openExtensionDevelopmentHostWindow(openConfig: IOpenConfiguration): void { - // If we have a last active folder, move it to the end - if (lastActiveFolder) { - lastOpenedFolders.splice(lastOpenedFolders.indexOf(lastActiveFolder), 1); - lastOpenedFolders.push(lastActiveFolder); - } + // Reload an existing extension development host window on the same path + // We currently do not allow more than one extension development window + // on the same extension path. + let res = WindowsManager.WINDOWS.filter(w => w.config && isEqual(w.config.extensionDevelopmentPath, openConfig.cli.extensionDevelopmentPath, !isLinux /* ignorecase */)); + if (res && res.length === 1) { + this.reload(res[0], openConfig.cli); + res[0].focus(); // make sure it gets focus and is restored - candidates.push(...lastOpenedFolders); - } + return; + } - // Restore last active - else if (lastActiveFolder && (reopenFolders === ReopenFoldersSetting.ONE || reopenFolders !== ReopenFoldersSetting.NONE)) { - candidates.push(lastActiveFolder); + // Fill in previously opened workspace unless an explicit path is provided and we are not unit testing + if (openConfig.cli._.length === 0 && !openConfig.cli.extensionTestsPath) { + const workspaceToOpen = this.windowsState.lastPluginDevelopmentHostWindow && this.windowsState.lastPluginDevelopmentHostWindow.workspacePath; + if (workspaceToOpen) { + openConfig.cli._ = [workspaceToOpen]; } } - const iPaths = candidates.map(candidate => this.toIPath(candidate, ignoreFileNotFound, cli.goto)).filter(path => !!path); - if (iPaths.length > 0) { - return iPaths; + // Make sure we are not asked to open a path that is already opened + if (openConfig.cli._.length > 0) { + res = WindowsManager.WINDOWS.filter(w => w.openedWorkspacePath && openConfig.cli._.indexOf(w.openedWorkspacePath) >= 0); + if (res.length) { + openConfig.cli._ = []; + } } - // No path provided, return empty to open empty - return [Object.create(null)]; + // Open it + this.open({ context: openConfig.context, cli: openConfig.cli, forceNewWindow: true, forceEmpty: openConfig.cli._.length === 0, userEnv: openConfig.userEnv }); } - private openInBrowserWindow(configuration: IWindowConfiguration, forceNewWindow?: boolean, windowToUse?: CodeWindow, emptyWorkspaceBackupFolder?: string): CodeWindow { + private openInBrowserWindow(options: IOpenBrowserWindowOptions): CodeWindow { + + // Build IWindowConfiguration from config and options + const configuration: IWindowConfiguration = mixin({}, options.cli); // inherit all properties from CLI + configuration.appRoot = this.environmentService.appRoot; + configuration.execPath = process.execPath; + configuration.userEnv = assign({}, this.initialUserEnv, options.userEnv || {}); + configuration.isInitialStartup = options.initialStartup; + configuration.workspacePath = options.workspacePath; + configuration.filesToOpen = options.filesToOpen; + configuration.filesToCreate = options.filesToCreate; + configuration.filesToDiff = options.filesToDiff; + configuration.nodeCachedDataDir = this.environmentService.nodeCachedDataDir; + let codeWindow: CodeWindow; - if (!forceNewWindow) { - codeWindow = windowToUse || this.getLastActiveWindow(); + if (!options.forceNewWindow) { + codeWindow = options.windowToUse || this.getLastActiveWindow(); if (codeWindow) { codeWindow.focus(); @@ -635,7 +698,7 @@ export class WindowsManager implements IWindowsMainService { // Register window for backups if (!configuration.extensionDevelopmentPath) { - this.backupService.registerWindowForBackupsSync(codeWindow.id, !configuration.workspacePath, emptyWorkspaceBackupFolder, configuration.workspacePath); + this.backupService.registerWindowForBackupsSync(codeWindow.id, !configuration.workspacePath, options.emptyWorkspaceBackupFolder, configuration.workspacePath); } // Load it @@ -655,7 +718,7 @@ export class WindowsManager implements IWindowsMainService { // Known Folder - load from stored settings if any if (configuration.workspacePath) { - const stateForWorkspace = this.windowsState.openedFolders.filter(o => isEqual(o.workspacePath, configuration.workspacePath, !platform.isLinux /* ignorecase */)).map(o => o.uiState); + const stateForWorkspace = this.windowsState.openedFolders.filter(o => isEqual(o.workspacePath, configuration.workspacePath, !isLinux /* ignorecase */)).map(o => o.uiState); if (stateForWorkspace.length) { return stateForWorkspace[0]; } @@ -685,7 +748,7 @@ export class WindowsManager implements IWindowsMainService { else { // on mac there is 1 menu per window so we need to use the monitor where the cursor currently is - if (platform.isMacintosh) { + if (isMacintosh) { const cursorPoint = screen.getCursorScreenPoint(); displayToUse = screen.getDisplayNearestPoint(cursorPoint); } @@ -796,22 +859,22 @@ export class WindowsManager implements IWindowsMainService { const res = windowsToTest.filter(w => { // match on workspace - if (typeof w.openedWorkspacePath === 'string' && (isEqual(w.openedWorkspacePath, workspacePath, !platform.isLinux /* ignorecase */))) { + if (typeof w.openedWorkspacePath === 'string' && (isEqual(w.openedWorkspacePath, workspacePath, !isLinux /* ignorecase */))) { return true; } // match on file - if (typeof w.openedFilePath === 'string' && isEqual(w.openedFilePath, filePath, !platform.isLinux /* ignorecase */)) { + if (typeof w.openedFilePath === 'string' && isEqual(w.openedFilePath, filePath, !isLinux /* ignorecase */)) { return true; } // match on file path - if (typeof w.openedWorkspacePath === 'string' && filePath && isEqualOrParent(filePath, w.openedWorkspacePath, !platform.isLinux /* ignorecase */)) { + if (typeof w.openedWorkspacePath === 'string' && filePath && isEqualOrParent(filePath, w.openedWorkspacePath, !isLinux /* ignorecase */)) { return true; } // match on extension development path - if (typeof extensionDevelopmentPath === 'string' && isEqual(w.extensionDevelopmentPath, extensionDevelopmentPath, !platform.isLinux /* ignorecase */)) { + if (typeof extensionDevelopmentPath === 'string' && isEqual(w.extensionDevelopmentPath, extensionDevelopmentPath, !isLinux /* ignorecase */)) { return true; }