fix lgtm warnings
This commit is contained in:
parent
1539caf1b4
commit
54adadd72c
6 changed files with 11 additions and 11 deletions
|
@ -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;
|
||||
|
|
|
@ -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<string[]> {
|
||||
|
||||
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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<any> {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue