diff --git a/extensions/npm/src/features/bowerJSONContribution.ts b/extensions/npm/src/features/bowerJSONContribution.ts index 4770303760c..705e40d34e7 100644 --- a/extensions/npm/src/features/bowerJSONContribution.ts +++ b/extensions/npm/src/features/bowerJSONContribution.ts @@ -167,7 +167,7 @@ export class BowerJSONContribution implements IJSONContribution { if (url.indexOf('git://') === 0) { url = url.substring(6); } - if (url.lastIndexOf('.git') === url.length - 4) { + if (url.length >= 4 && url.substr(url.length - 4) === '.git') { url = url.substring(0, url.length - 4); } return url; diff --git a/extensions/npm/src/features/packageJSONContribution.ts b/extensions/npm/src/features/packageJSONContribution.ts index d667de3981f..88cf753425c 100644 --- a/extensions/npm/src/features/packageJSONContribution.ts +++ b/extensions/npm/src/features/packageJSONContribution.ts @@ -229,7 +229,7 @@ export class PackageJSONContribution implements IJSONContribution { if ((location.matches(['dependencies', '*']) || location.matches(['devDependencies', '*']) || location.matches(['optionalDependencies', '*']) || location.matches(['peerDependencies', '*']))) { const currentKey = location.path[location.path.length - 1]; if (typeof currentKey === 'string') { - const queryUrl = 'https://registry.npmjs.org/' + encodeURIComponent(currentKey).replace('%40', '@'); + const queryUrl = 'https://registry.npmjs.org/' + encodeURIComponent(currentKey).replace(/%40/g, '@'); return this.xhr({ url: queryUrl, agent: USER_AGENT @@ -289,7 +289,7 @@ export class PackageJSONContribution implements IJSONContribution { private getInfo(pack: string): Thenable { - const queryUrl = 'https://registry.npmjs.org/' + encodeURIComponent(pack).replace('%40', '@'); + const queryUrl = 'https://registry.npmjs.org/' + encodeURIComponent(pack).replace(/%40/g, '@'); return this.xhr({ url: queryUrl, agent: USER_AGENT diff --git a/src/vs/base/common/json.ts b/src/vs/base/common/json.ts index 12651380219..e0cf131ad89 100644 --- a/src/vs/base/common/json.ts +++ b/src/vs/base/common/json.ts @@ -205,10 +205,10 @@ export function createScanner(text: string, ignoreTrivia: boolean = false): JSON token: SyntaxKind = SyntaxKind.Unknown, scanError: ScanError = ScanError.None; - function scanHexDigits(count: number, exact?: boolean): number { + function scanHexDigits(count: number): number { let digits = 0; let value = 0; - while (digits < count || !exact) { + while (digits < count) { let ch = text.charCodeAt(pos); if (ch >= CharacterCodes._0 && ch <= CharacterCodes._9) { value = value * 16 + ch - CharacterCodes._0; @@ -331,7 +331,7 @@ export function createScanner(text: string, ignoreTrivia: boolean = false): JSON result += '\t'; break; case CharacterCodes.u: - let ch = scanHexDigits(4, true); + let ch = scanHexDigits(4); if (ch >= 0) { result += String.fromCharCode(ch); } else { diff --git a/src/vs/code/electron-main/windows.ts b/src/vs/code/electron-main/windows.ts index 5b5bb7be830..09cc9f0fab4 100644 --- a/src/vs/code/electron-main/windows.ts +++ b/src/vs/code/electron-main/windows.ts @@ -551,9 +551,6 @@ export class WindowsManager implements IWindowsMainService { if (lastActiveWindow) { usedWindows.push(this.doAddFoldersToExistingWindow(lastActiveWindow, foldersToAdd)); } - - // Reset because we handled them - foldersToAdd = []; } // 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 diff --git a/src/vs/workbench/services/themes/electron-browser/colorThemeData.ts b/src/vs/workbench/services/themes/electron-browser/colorThemeData.ts index 59ee56d0edd..f884af683dd 100644 --- a/src/vs/workbench/services/themes/electron-browser/colorThemeData.ts +++ b/src/vs/workbench/services/themes/electron-browser/colorThemeData.ts @@ -322,7 +322,10 @@ function _loadColorTheme(fileService: IFileService, themeLocation: URI, resultRu let pListParser: Promise<{ parse(content: string) }>; function getPListParser() { - return pListParser || import('fast-plist'); + if (!pListParser) { + pListParser = import('fast-plist'); + } + return pListParser; } function _loadSyntaxTokens(fileService: IFileService, themeLocation: URI, resultRules: ITokenColorizationRule[], resultColors: IColorMap): Promise { diff --git a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts index 2a0ab5b757d..219db8aa5c8 100644 --- a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts +++ b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts @@ -125,7 +125,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { themeData = ColorThemeData.fromStorageData(persistedThemeData); } let containerBaseTheme = this.getBaseThemeFromContainer(); - if (!themeData || themeData && themeData.baseTheme !== containerBaseTheme) { + if (!themeData || themeData.baseTheme !== containerBaseTheme) { themeData = ColorThemeData.createUnloadedTheme(containerBaseTheme); } themeData.setCustomColors(this.colorCustomizations);