mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
replace void 0 with undefined
This commit is contained in:
@@ -171,13 +171,13 @@ const config = {
|
||||
urlSchemes: [product.urlProtocol]
|
||||
}],
|
||||
darwinForceDarkModeSupport: true,
|
||||
darwinCredits: darwinCreditsTemplate ? Buffer.from(darwinCreditsTemplate({ commit: commit, date: new Date().toISOString() })) : void 0,
|
||||
darwinCredits: darwinCreditsTemplate ? Buffer.from(darwinCreditsTemplate({ commit: commit, date: new Date().toISOString() })) : undefined,
|
||||
linuxExecutableName: product.applicationName,
|
||||
winIcon: 'resources/win32/code.ico',
|
||||
token: process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || void 0,
|
||||
token: process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || undefined,
|
||||
|
||||
// @ts-ignore JSON checking: electronRepository is optional
|
||||
repo: product.electronRepository || void 0
|
||||
repo: product.electronRepository || undefined
|
||||
};
|
||||
|
||||
function getElectron(arch) {
|
||||
|
||||
+3
-3
@@ -18,7 +18,7 @@ export function getVersion(repo: string): string | undefined {
|
||||
try {
|
||||
head = fs.readFileSync(headPath, 'utf8').trim();
|
||||
} catch (e) {
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (/^[0-9a-f]{40}$/i.test(head)) {
|
||||
@@ -28,7 +28,7 @@ export function getVersion(repo: string): string | undefined {
|
||||
const refMatch = /^ref: (.*)$/.exec(head);
|
||||
|
||||
if (!refMatch) {
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const ref = refMatch[1];
|
||||
@@ -46,7 +46,7 @@ export function getVersion(repo: string): string | undefined {
|
||||
try {
|
||||
refsRaw = fs.readFileSync(packedRefsPath, 'utf8').trim();
|
||||
} catch (e) {
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const refsRegex = /^([0-9a-f]{40})\s+(.+)$/gm;
|
||||
|
||||
@@ -17,7 +17,7 @@ function handleDeletions() {
|
||||
});
|
||||
}
|
||||
|
||||
let watch = void 0;
|
||||
let watch = undefined;
|
||||
|
||||
if (!watch) {
|
||||
watch = process.platform === 'win32' ? require('./watch-win32') : require('gulp-watch');
|
||||
|
||||
@@ -126,7 +126,7 @@ function getDocumentSettings(textDocument: TextDocument): Thenable<LanguageSetti
|
||||
}
|
||||
return promise;
|
||||
}
|
||||
return Promise.resolve(void 0);
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
// The settings have changed. Is send on server activation as well.
|
||||
|
||||
@@ -15,7 +15,7 @@ export function getLanguageModelCache<T>(maxEntries: number, cleanupIntervalTime
|
||||
let languageModels: { [uri: string]: { version: number, languageId: string, cTime: number, languageModel: T } } = {};
|
||||
let nModels = 0;
|
||||
|
||||
let cleanupInterval: NodeJS.Timer | undefined = void 0;
|
||||
let cleanupInterval: NodeJS.Timer | undefined = undefined;
|
||||
if (cleanupIntervalTimeInSec > 0) {
|
||||
cleanupInterval = setInterval(() => {
|
||||
let cutoffTime = Date.now() - cleanupIntervalTimeInSec * 1000;
|
||||
@@ -73,7 +73,7 @@ export function getLanguageModelCache<T>(maxEntries: number, cleanupIntervalTime
|
||||
dispose() {
|
||||
if (typeof cleanupInterval !== 'undefined') {
|
||||
clearInterval(cleanupInterval);
|
||||
cleanupInterval = void 0;
|
||||
cleanupInterval = undefined;
|
||||
languageModels = {};
|
||||
nModels = 0;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ export function getDocumentContext(documentUri: string, workspaceFolders: Worksp
|
||||
return folderURI;
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -114,17 +114,17 @@ function findGitWin32InPath(onLookup: (path: string) => void): Promise<IGit> {
|
||||
|
||||
function findGitWin32(onLookup: (path: string) => void): Promise<IGit> {
|
||||
return findSystemGitWin32(process.env['ProgramW6432'] as string, onLookup)
|
||||
.then(void 0, () => findSystemGitWin32(process.env['ProgramFiles(x86)'] as string, onLookup))
|
||||
.then(void 0, () => findSystemGitWin32(process.env['ProgramFiles'] as string, onLookup))
|
||||
.then(void 0, () => findSystemGitWin32(path.join(process.env['LocalAppData'] as string, 'Programs'), onLookup))
|
||||
.then(void 0, () => findGitWin32InPath(onLookup));
|
||||
.then(undefined, () => findSystemGitWin32(process.env['ProgramFiles(x86)'] as string, onLookup))
|
||||
.then(undefined, () => findSystemGitWin32(process.env['ProgramFiles'] as string, onLookup))
|
||||
.then(undefined, () => findSystemGitWin32(path.join(process.env['LocalAppData'] as string, 'Programs'), onLookup))
|
||||
.then(undefined, () => findGitWin32InPath(onLookup));
|
||||
}
|
||||
|
||||
export function findGit(hint: string | undefined, onLookup: (path: string) => void): Promise<IGit> {
|
||||
const first = hint ? findSpecificGit(hint, onLookup) : Promise.reject<IGit>(null);
|
||||
|
||||
return first
|
||||
.then(void 0, () => {
|
||||
.then(undefined, () => {
|
||||
switch (process.platform) {
|
||||
case 'darwin': return findGitDarwin(onLookup);
|
||||
case 'win32': return findGitWin32(onLookup);
|
||||
@@ -248,7 +248,7 @@ export class GitError {
|
||||
this.error = data.error;
|
||||
this.message = data.error.message;
|
||||
} else {
|
||||
this.error = void 0;
|
||||
this.error = undefined;
|
||||
this.message = '';
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ function getGitErrorCode(stderr: string): string | undefined {
|
||||
return GitErrorCodes.InvalidBranchName;
|
||||
}
|
||||
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export class Git {
|
||||
@@ -1376,7 +1376,7 @@ export class Repository {
|
||||
throw new Error('Not in a branch');
|
||||
}
|
||||
|
||||
return { name: result.stdout.trim(), commit: void 0, type: RefType.Head };
|
||||
return { name: result.stdout.trim(), commit: undefined, type: RefType.Head };
|
||||
} catch (err) {
|
||||
const result = await this.run(['rev-parse', 'HEAD']);
|
||||
|
||||
@@ -1384,7 +1384,7 @@ export class Repository {
|
||||
throw new Error('Error parsing HEAD');
|
||||
}
|
||||
|
||||
return { name: void 0, commit: result.stdout.trim(), type: RefType.Head };
|
||||
return { name: undefined, commit: result.stdout.trim(), type: RefType.Head };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ export function anyEvent<T>(...events: Event<T>[]): Event<T> {
|
||||
}
|
||||
|
||||
export function done<T>(promise: Promise<T>): Promise<void> {
|
||||
return promise.then<void>(() => void 0);
|
||||
return promise.then<void>(() => undefined);
|
||||
}
|
||||
|
||||
export function onceEvent<T>(event: Event<T>): Event<T> {
|
||||
|
||||
@@ -14,7 +14,7 @@ export function activateTagClosing(tagProvider: (document: TextDocument, positio
|
||||
updateEnabledState();
|
||||
window.onDidChangeActiveTextEditor(updateEnabledState, null, disposables);
|
||||
|
||||
let timeout: NodeJS.Timer | undefined = void 0;
|
||||
let timeout: NodeJS.Timer | undefined = undefined;
|
||||
|
||||
function updateEnabledState() {
|
||||
isEnabled = false;
|
||||
@@ -26,7 +26,7 @@ export function activateTagClosing(tagProvider: (document: TextDocument, positio
|
||||
if (!supportedLanguages[document.languageId]) {
|
||||
return;
|
||||
}
|
||||
if (!workspace.getConfiguration(void 0, document.uri).get<boolean>(configName)) {
|
||||
if (!workspace.getConfiguration(undefined, document.uri).get<boolean>(configName)) {
|
||||
return;
|
||||
}
|
||||
isEnabled = true;
|
||||
@@ -68,7 +68,7 @@ export function activateTagClosing(tagProvider: (document: TextDocument, positio
|
||||
}
|
||||
}
|
||||
});
|
||||
timeout = void 0;
|
||||
timeout = undefined;
|
||||
}, 100);
|
||||
}
|
||||
return Disposable.from(...disposables);
|
||||
|
||||
@@ -75,7 +75,7 @@ function getDocumentSettings(textDocument: TextDocument, needsDocumentSettings:
|
||||
}
|
||||
return promise;
|
||||
}
|
||||
return Promise.resolve(void 0);
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
// After the server has started the client sends an initialize request. The server receives
|
||||
|
||||
@@ -15,7 +15,7 @@ export function getLanguageModelCache<T>(maxEntries: number, cleanupIntervalTime
|
||||
let languageModels: { [uri: string]: { version: number, languageId: string, cTime: number, languageModel: T } } = {};
|
||||
let nModels = 0;
|
||||
|
||||
let cleanupInterval: NodeJS.Timer | undefined = void 0;
|
||||
let cleanupInterval: NodeJS.Timer | undefined = undefined;
|
||||
if (cleanupIntervalTimeInSec > 0) {
|
||||
cleanupInterval = setInterval(() => {
|
||||
let cutoffTime = Date.now() - cleanupIntervalTimeInSec * 1000;
|
||||
@@ -73,7 +73,7 @@ export function getLanguageModelCache<T>(maxEntries: number, cleanupIntervalTime
|
||||
dispose() {
|
||||
if (typeof cleanupInterval !== 'undefined') {
|
||||
clearInterval(cleanupInterval);
|
||||
cleanupInterval = void 0;
|
||||
cleanupInterval = undefined;
|
||||
languageModels = {};
|
||||
nModels = 0;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ export function getDocumentRegions(languageService: LanguageService, document: T
|
||||
if (/["'](module|(text|application)\/(java|ecma)script)["']/.test(scanner.getTokenText())) {
|
||||
languageIdFromType = 'javascript';
|
||||
} else {
|
||||
languageIdFromType = void 0;
|
||||
languageIdFromType = undefined;
|
||||
}
|
||||
} else {
|
||||
let attributeLanguageId = getAttributeLanguage(lastAttributeName!);
|
||||
|
||||
@@ -54,7 +54,7 @@ function limitRanges(ranges: FoldingRange[], maxRanges: number) {
|
||||
|
||||
// compute each range's nesting level in 'nestingLevels'.
|
||||
// count the number of ranges for each level in 'nestingLevelCounts'
|
||||
let top: FoldingRange | undefined = void 0;
|
||||
let top: FoldingRange | undefined = undefined;
|
||||
let previous: FoldingRange[] = [];
|
||||
let nestingLevels: number[] = [];
|
||||
let nestingLevelCounts: number[] = [];
|
||||
|
||||
@@ -58,7 +58,7 @@ export function getJavaScriptMode(documentRegions: LanguageModelCache<HTMLDocume
|
||||
return {
|
||||
getText: (start, end) => text.substring(start, end),
|
||||
getLength: () => text.length,
|
||||
getChangeRange: () => void 0
|
||||
getChangeRange: () => undefined
|
||||
};
|
||||
},
|
||||
getCurrentDirectory: () => '',
|
||||
|
||||
@@ -91,7 +91,7 @@ export function getLanguageModes(supportedLanguages: { [languageId: string]: boo
|
||||
if (languageId) {
|
||||
return modes[languageId];
|
||||
}
|
||||
return void 0;
|
||||
return undefined;
|
||||
},
|
||||
getModesInRange(document: TextDocument, range: Range): LanguageModeRange[] {
|
||||
return documentRegions.get(document).getLanguageRanges(range).map(r => {
|
||||
|
||||
@@ -89,7 +89,7 @@ suite('HTML Embedded Support', () => {
|
||||
assertLanguageId('<script type="text/ecmascript">var| i = 0;</script>', 'javascript');
|
||||
assertLanguageId('<script type="application/javascript">var| i = 0;</script>', 'javascript');
|
||||
assertLanguageId('<script type="application/ecmascript">var| i = 0;</script>', 'javascript');
|
||||
assertLanguageId('<script type="application/typescript">var| i = 0;</script>', void 0);
|
||||
assertLanguageId('<script type="application/typescript">var| i = 0;</script>', undefined);
|
||||
assertLanguageId('<script type=\'text/javascript\'>var| i = 0;</script>', 'javascript');
|
||||
});
|
||||
|
||||
|
||||
@@ -200,7 +200,7 @@ suite('HTML Folding', () => {
|
||||
/*19*/' </span>',
|
||||
/*20*/'</div>',
|
||||
];
|
||||
assertRanges(input, [r(0, 19), r(1, 18), r(2, 3), r(5, 11), r(6, 7), r(9, 10), r(13, 14), r(16, 17)], 'no limit', void 0);
|
||||
assertRanges(input, [r(0, 19), r(1, 18), r(2, 3), r(5, 11), r(6, 7), r(9, 10), r(13, 14), r(16, 17)], 'no limit', undefined);
|
||||
assertRanges(input, [r(0, 19), r(1, 18), r(2, 3), r(5, 11), r(6, 7), r(9, 10), r(13, 14), r(16, 17)], 'limit 8', 8);
|
||||
assertRanges(input, [r(0, 19), r(1, 18), r(2, 3), r(5, 11), r(6, 7), r(13, 14), r(16, 17)], 'limit 7', 7);
|
||||
assertRanges(input, [r(0, 19), r(1, 18), r(2, 3), r(5, 11), r(13, 14), r(16, 17)], 'limit 6', 6);
|
||||
|
||||
@@ -38,7 +38,7 @@ suite('HTML Embedded Formatting', () => {
|
||||
formatOptions = FormattingOptions.create(2, true);
|
||||
}
|
||||
|
||||
let result = format(languageModes, document, range, formatOptions, void 0, { css: true, javascript: true });
|
||||
let result = format(languageModes, document, range, formatOptions, undefined, { css: true, javascript: true });
|
||||
|
||||
let actual = TextDocument.applyEdits(document, result);
|
||||
assert.equal(actual, expected, message);
|
||||
@@ -67,8 +67,8 @@ suite('HTML Embedded Formatting', () => {
|
||||
|
||||
test('HTLM & Scripts - Fixtures', function () {
|
||||
assertFormatWithFixture('19813.html', '19813.html');
|
||||
assertFormatWithFixture('19813.html', '19813-4spaces.html', void 0, FormattingOptions.create(4, true));
|
||||
assertFormatWithFixture('19813.html', '19813-tab.html', void 0, FormattingOptions.create(1, false));
|
||||
assertFormatWithFixture('19813.html', '19813-4spaces.html', undefined, FormattingOptions.create(4, true));
|
||||
assertFormatWithFixture('19813.html', '19813-tab.html', undefined, FormattingOptions.create(1, false));
|
||||
assertFormatWithFixture('21634.html', '21634.html');
|
||||
});
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ export function getDocumentContext(documentUri: string, workspaceFolders: Worksp
|
||||
return folderURI;
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -338,7 +338,7 @@ function getPackageInfo(context: ExtensionContext): IPackageInfo | undefined {
|
||||
aiKey: extensionPackage.aiKey
|
||||
};
|
||||
}
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function readJSONFile(location: string) {
|
||||
|
||||
@@ -143,7 +143,7 @@ connection.onInitialize((params: InitializeParams): InitializeResult => {
|
||||
const capabilities: ServerCapabilities = {
|
||||
// Tell the client that the server works in FULL text document sync mode
|
||||
textDocumentSync: documents.syncKind,
|
||||
completionProvider: clientSnippetSupport ? { resolveProvider: true, triggerCharacters: ['"', ':'] } : void 0,
|
||||
completionProvider: clientSnippetSupport ? { resolveProvider: true, triggerCharacters: ['"', ':'] } : undefined,
|
||||
hoverProvider: true,
|
||||
documentSymbolProvider: true,
|
||||
documentRangeFormattingProvider: false,
|
||||
@@ -174,8 +174,8 @@ interface JSONSchemaSettings {
|
||||
schema?: JSONSchema;
|
||||
}
|
||||
|
||||
let jsonConfigurationSettings: JSONSchemaSettings[] | undefined = void 0;
|
||||
let schemaAssociations: ISchemaAssociations | undefined = void 0;
|
||||
let jsonConfigurationSettings: JSONSchemaSettings[] | undefined = undefined;
|
||||
let schemaAssociations: ISchemaAssociations | undefined = undefined;
|
||||
let formatterRegistration: Thenable<Disposable> | null = null;
|
||||
|
||||
// The settings have changed. Is send on server activation as well.
|
||||
|
||||
@@ -15,7 +15,7 @@ export function getLanguageModelCache<T>(maxEntries: number, cleanupIntervalTime
|
||||
let languageModels: { [uri: string]: { version: number, languageId: string, cTime: number, languageModel: T } } = {};
|
||||
let nModels = 0;
|
||||
|
||||
let cleanupInterval: NodeJS.Timer | undefined = void 0;
|
||||
let cleanupInterval: NodeJS.Timer | undefined = undefined;
|
||||
if (cleanupIntervalTimeInSec > 0) {
|
||||
cleanupInterval = setInterval(() => {
|
||||
let cutoffTime = Date.now() - cleanupIntervalTimeInSec * 1000;
|
||||
@@ -73,7 +73,7 @@ export function getLanguageModelCache<T>(maxEntries: number, cleanupIntervalTime
|
||||
dispose() {
|
||||
if (typeof cleanupInterval !== 'undefined') {
|
||||
clearInterval(cleanupInterval);
|
||||
cleanupInterval = void 0;
|
||||
cleanupInterval = undefined;
|
||||
languageModels = {};
|
||||
nModels = 0;
|
||||
}
|
||||
|
||||
@@ -39,9 +39,9 @@ export class OpenDocumentLinkCommand implements Command {
|
||||
return this.tryOpen(p + '.md', args);
|
||||
}
|
||||
const resource = vscode.Uri.file(p);
|
||||
return Promise.resolve(void 0)
|
||||
return Promise.resolve(undefined)
|
||||
.then(() => vscode.commands.executeCommand('vscode.open', resource))
|
||||
.then(() => void 0);
|
||||
.then(() => undefined);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -175,9 +175,9 @@ export class BowerJSONContribution implements IJSONContribution {
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
return void 0;
|
||||
return undefined;
|
||||
}, () => {
|
||||
return void 0;
|
||||
return undefined;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ export default class PHPValidationProvider {
|
||||
}
|
||||
this.trigger = RunTrigger.from(section.get<string>('validate.run', RunTrigger.strings.onSave));
|
||||
}
|
||||
if (this.executableIsUserDefined !== true && this.workspaceStore.get<string | undefined>(CheckedExecutablePath, undefined) !== void 0) {
|
||||
if (this.executableIsUserDefined !== true && this.workspaceStore.get<string | undefined>(CheckedExecutablePath, undefined) !== undefined) {
|
||||
vscode.commands.executeCommand('setContext', 'php.untrustValidationExecutableContext', true);
|
||||
}
|
||||
this.delayers = Object.create(null);
|
||||
@@ -195,7 +195,7 @@ export default class PHPValidationProvider {
|
||||
delayer.trigger(() => this.doValidate(textDocument));
|
||||
};
|
||||
|
||||
if (this.executableIsUserDefined !== void 0 && !this.executableIsUserDefined) {
|
||||
if (this.executableIsUserDefined !== undefined && !this.executableIsUserDefined) {
|
||||
let checkedExecutablePath = this.workspaceStore.get<string | undefined>(CheckedExecutablePath, undefined);
|
||||
if (!checkedExecutablePath || checkedExecutablePath !== this.executable) {
|
||||
vscode.window.showInformationMessage<MessageItem>(
|
||||
|
||||
@@ -124,7 +124,7 @@ class PendingDiagnostics extends ResourceMap<number> {
|
||||
|
||||
const map = new ResourceMap<void>();
|
||||
for (const resource of orderedResources) {
|
||||
map.set(resource, void 0);
|
||||
map.set(resource, undefined);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
@@ -355,7 +355,7 @@ export default class BufferSyncSupport extends Disposable {
|
||||
|
||||
// Add all open TS buffers to the geterr request. They might be visible
|
||||
for (const buffer of this.syncedBuffers.values) {
|
||||
orderedFileSet.set(buffer.resource, void 0);
|
||||
orderedFileSet.set(buffer.resource, undefined);
|
||||
}
|
||||
|
||||
if (orderedFileSet.size) {
|
||||
@@ -363,7 +363,7 @@ export default class BufferSyncSupport extends Disposable {
|
||||
this.pendingGetErr.cancel();
|
||||
|
||||
for (const file of this.pendingGetErr.files.entries) {
|
||||
orderedFileSet.set(file.resource, void 0);
|
||||
orderedFileSet.set(file.resource, undefined);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -101,17 +101,17 @@ suite('commands namespace tests', () => {
|
||||
|
||||
|
||||
let a = commands.executeCommand('vscode.diff', Uri.parse('sc:a'), Uri.parse('sc:b'), 'DIFF').then(value => {
|
||||
assert.ok(value === void 0);
|
||||
assert.ok(value === undefined);
|
||||
registration.dispose();
|
||||
});
|
||||
|
||||
let b = commands.executeCommand('vscode.diff', Uri.parse('sc:a'), Uri.parse('sc:b')).then(value => {
|
||||
assert.ok(value === void 0);
|
||||
assert.ok(value === undefined);
|
||||
registration.dispose();
|
||||
});
|
||||
|
||||
let c = commands.executeCommand('vscode.diff', Uri.parse('sc:a'), Uri.parse('sc:b'), 'Title', { selection: new Range(new Position(1, 1), new Position(1, 2)) }).then(value => {
|
||||
assert.ok(value === void 0);
|
||||
assert.ok(value === undefined);
|
||||
registration.dispose();
|
||||
});
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -185,7 +185,7 @@ function registerDeveloperKeybindings() {
|
||||
return function () {
|
||||
if (listener) {
|
||||
window.removeEventListener('keydown', listener);
|
||||
listener = void 0;
|
||||
listener = undefined;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
+1
-1
@@ -414,7 +414,7 @@ function rimraf(location) {
|
||||
}
|
||||
}, err => {
|
||||
if (err.code === 'ENOENT') {
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
throw err;
|
||||
});
|
||||
|
||||
@@ -147,10 +147,10 @@ const _manualClassList = new class implements IDomClassList {
|
||||
|
||||
toggleClass(node: HTMLElement, className: string, shouldHaveIt?: boolean): void {
|
||||
this._findClassName(node, className);
|
||||
if (this._lastStart !== -1 && (shouldHaveIt === void 0 || !shouldHaveIt)) {
|
||||
if (this._lastStart !== -1 && (shouldHaveIt === undefined || !shouldHaveIt)) {
|
||||
this.removeClass(node, className);
|
||||
}
|
||||
if (this._lastStart === -1 && (shouldHaveIt === void 0 || shouldHaveIt)) {
|
||||
if (this._lastStart === -1 && (shouldHaveIt === undefined || shouldHaveIt)) {
|
||||
this.addClass(node, className);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,24 +60,24 @@ export class BaseActionItem extends Disposable implements IActionItem {
|
||||
}
|
||||
|
||||
private handleActionChangeEvent(event: IActionChangeEvent): void {
|
||||
if (event.enabled !== void 0) {
|
||||
if (event.enabled !== undefined) {
|
||||
this.updateEnabled();
|
||||
}
|
||||
|
||||
if (event.checked !== void 0) {
|
||||
if (event.checked !== undefined) {
|
||||
this.updateChecked();
|
||||
}
|
||||
|
||||
if (event.class !== void 0) {
|
||||
if (event.class !== undefined) {
|
||||
this.updateClass();
|
||||
}
|
||||
|
||||
if (event.label !== void 0) {
|
||||
if (event.label !== undefined) {
|
||||
this.updateLabel();
|
||||
this.updateTooltip();
|
||||
}
|
||||
|
||||
if (event.tooltip !== void 0) {
|
||||
if (event.tooltip !== undefined) {
|
||||
this.updateTooltip();
|
||||
}
|
||||
}
|
||||
@@ -679,7 +679,7 @@ export class ActionBar extends Disposable implements IActionRunner {
|
||||
focus(selectFirst?: boolean): void;
|
||||
focus(arg?: any): void {
|
||||
let selectFirst: boolean = false;
|
||||
let index: number | undefined = void 0;
|
||||
let index: number | undefined = undefined;
|
||||
if (arg === undefined) {
|
||||
selectFirst = true;
|
||||
} else if (typeof arg === 'number') {
|
||||
|
||||
@@ -132,7 +132,7 @@ export class IconLabel extends Disposable {
|
||||
this.domNode.title = options && options.title ? options.title : '';
|
||||
|
||||
if (this.labelNode instanceof HighlightedLabel) {
|
||||
this.labelNode.set(label || '', options ? options.matches : void 0, options && options.title ? options.title : void 0, options && options.labelEscapeNewLines);
|
||||
this.labelNode.set(label || '', options ? options.matches : undefined, options && options.title ? options.title : undefined, options && options.labelEscapeNewLines);
|
||||
} else {
|
||||
this.labelNode.textContent = label || '';
|
||||
}
|
||||
@@ -143,7 +143,7 @@ export class IconLabel extends Disposable {
|
||||
}
|
||||
|
||||
if (this.descriptionNode instanceof HighlightedLabel) {
|
||||
this.descriptionNode.set(description || '', options ? options.descriptionMatches : void 0);
|
||||
this.descriptionNode.set(description || '', options ? options.descriptionMatches : undefined);
|
||||
if (options && options.descriptionTitle) {
|
||||
this.descriptionNode.element.title = options.descriptionTitle;
|
||||
} else {
|
||||
|
||||
@@ -34,8 +34,8 @@ export class HorizontalScrollbar extends AbstractScrollbar {
|
||||
className: 'left-arrow',
|
||||
top: scrollbarDelta,
|
||||
left: arrowDelta,
|
||||
bottom: void 0,
|
||||
right: void 0,
|
||||
bottom: undefined,
|
||||
right: undefined,
|
||||
bgWidth: options.arrowSize,
|
||||
bgHeight: options.horizontalScrollbarSize,
|
||||
onActivate: () => this._host.onMouseWheel(new StandardWheelEvent(null, 1, 0)),
|
||||
@@ -44,8 +44,8 @@ export class HorizontalScrollbar extends AbstractScrollbar {
|
||||
this._createArrow({
|
||||
className: 'right-arrow',
|
||||
top: scrollbarDelta,
|
||||
left: void 0,
|
||||
bottom: void 0,
|
||||
left: undefined,
|
||||
bottom: undefined,
|
||||
right: arrowDelta,
|
||||
bgWidth: options.arrowSize,
|
||||
bgHeight: options.horizontalScrollbarSize,
|
||||
|
||||
@@ -35,8 +35,8 @@ export class VerticalScrollbar extends AbstractScrollbar {
|
||||
className: 'up-arrow',
|
||||
top: arrowDelta,
|
||||
left: scrollbarDelta,
|
||||
bottom: void 0,
|
||||
right: void 0,
|
||||
bottom: undefined,
|
||||
right: undefined,
|
||||
bgWidth: options.verticalScrollbarSize,
|
||||
bgHeight: options.arrowSize,
|
||||
onActivate: () => this._host.onMouseWheel(new StandardWheelEvent(null, 0, 1)),
|
||||
@@ -44,10 +44,10 @@ export class VerticalScrollbar extends AbstractScrollbar {
|
||||
|
||||
this._createArrow({
|
||||
className: 'down-arrow',
|
||||
top: void 0,
|
||||
top: undefined,
|
||||
left: scrollbarDelta,
|
||||
bottom: arrowDelta,
|
||||
right: void 0,
|
||||
right: undefined,
|
||||
bgWidth: options.verticalScrollbarSize,
|
||||
bgHeight: options.arrowSize,
|
||||
onActivate: () => this._host.onMouseWheel(new StandardWheelEvent(null, 0, -1)),
|
||||
|
||||
@@ -133,9 +133,9 @@ export class ToolBar extends Disposable {
|
||||
}
|
||||
|
||||
private getKeybindingLabel(action: IAction): string | undefined {
|
||||
const key = this.lookupKeybindings && this.options.getKeyBinding ? this.options.getKeyBinding(action) : void 0;
|
||||
const key = this.lookupKeybindings && this.options.getKeyBinding ? this.options.getKeyBinding(action) : undefined;
|
||||
|
||||
return (key && key.getLabel()) || void 0;
|
||||
return (key && key.getLabel()) || undefined;
|
||||
}
|
||||
|
||||
addPrimaryAction(primaryAction: IAction): () => void {
|
||||
@@ -157,7 +157,7 @@ export class ToolBar extends Disposable {
|
||||
dispose(): void {
|
||||
if (this.toggleMenuActionItem) {
|
||||
this.toggleMenuActionItem.dispose();
|
||||
this.toggleMenuActionItem = void 0;
|
||||
this.toggleMenuActionItem = undefined;
|
||||
}
|
||||
|
||||
super.dispose();
|
||||
@@ -173,7 +173,7 @@ class ToggleMenuAction extends Action {
|
||||
|
||||
constructor(toggleDropdownMenu: () => void, title?: string) {
|
||||
title = title || nls.localize('moreActions', "More Actions...");
|
||||
super(ToggleMenuAction.ID, title, void 0, true);
|
||||
super(ToggleMenuAction.ID, title, undefined, true);
|
||||
|
||||
this.toggleDropdownMenu = toggleDropdownMenu;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ export function debounce<T>(delay: number, reducer?: IDebouceReducer<T>, initial
|
||||
|
||||
return function (this: any, ...args: any[]) {
|
||||
if (!this[resultKey]) {
|
||||
this[resultKey] = initialValueProvider ? initialValueProvider() : void 0;
|
||||
this[resultKey] = initialValueProvider ? initialValueProvider() : undefined;
|
||||
}
|
||||
|
||||
clearTimeout(this[timerKey]);
|
||||
@@ -83,7 +83,7 @@ export function debounce<T>(delay: number, reducer?: IDebouceReducer<T>, initial
|
||||
|
||||
this[timerKey] = setTimeout(() => {
|
||||
fn.apply(this, args);
|
||||
this[resultKey] = initialValueProvider ? initialValueProvider() : void 0;
|
||||
this[resultKey] = initialValueProvider ? initialValueProvider() : undefined;
|
||||
}, delay);
|
||||
};
|
||||
});
|
||||
|
||||
@@ -727,7 +727,7 @@ export class EventBufferer {
|
||||
} else {
|
||||
listener.call(thisArgs, i);
|
||||
}
|
||||
}, void 0, disposables);
|
||||
}, undefined, disposables);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ export function isMarkdownString(thing: any): thing is IMarkdownString {
|
||||
return true;
|
||||
} else if (thing && typeof thing === 'object') {
|
||||
return typeof (<IMarkdownString>thing).value === 'string'
|
||||
&& (typeof (<IMarkdownString>thing).isTrusted === 'boolean' || (<IMarkdownString>thing).isTrusted === void 0);
|
||||
&& (typeof (<IMarkdownString>thing).isTrusted === 'boolean' || (<IMarkdownString>thing).isTrusted === undefined);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
+17
-17
@@ -722,13 +722,13 @@ interface NodeImpl extends Node {
|
||||
export function getLocation(text: string, position: number): Location {
|
||||
let segments: Segment[] = []; // strings or numbers
|
||||
let earlyReturnException = new Object();
|
||||
let previousNode: NodeImpl | undefined = void 0;
|
||||
let previousNode: NodeImpl | undefined = undefined;
|
||||
const previousNodeInst: NodeImpl = {
|
||||
value: {},
|
||||
offset: 0,
|
||||
length: 0,
|
||||
type: 'object',
|
||||
parent: void 0
|
||||
parent: undefined
|
||||
};
|
||||
let isAtPropertyKey = false;
|
||||
function setPreviousNode(value: string, offset: number, length: number, type: NodeType) {
|
||||
@@ -736,7 +736,7 @@ export function getLocation(text: string, position: number): Location {
|
||||
previousNodeInst.offset = offset;
|
||||
previousNodeInst.length = length;
|
||||
previousNodeInst.type = type;
|
||||
previousNodeInst.colonOffset = void 0;
|
||||
previousNodeInst.colonOffset = undefined;
|
||||
previousNode = previousNodeInst;
|
||||
}
|
||||
try {
|
||||
@@ -746,7 +746,7 @@ export function getLocation(text: string, position: number): Location {
|
||||
if (position <= offset) {
|
||||
throw earlyReturnException;
|
||||
}
|
||||
previousNode = void 0;
|
||||
previousNode = undefined;
|
||||
isAtPropertyKey = position > offset;
|
||||
segments.push(''); // push a placeholder (will be replaced)
|
||||
},
|
||||
@@ -764,21 +764,21 @@ export function getLocation(text: string, position: number): Location {
|
||||
if (position <= offset) {
|
||||
throw earlyReturnException;
|
||||
}
|
||||
previousNode = void 0;
|
||||
previousNode = undefined;
|
||||
segments.pop();
|
||||
},
|
||||
onArrayBegin: (offset: number, length: number) => {
|
||||
if (position <= offset) {
|
||||
throw earlyReturnException;
|
||||
}
|
||||
previousNode = void 0;
|
||||
previousNode = undefined;
|
||||
segments.push(0);
|
||||
},
|
||||
onArrayEnd: (offset: number, length: number) => {
|
||||
if (position <= offset) {
|
||||
throw earlyReturnException;
|
||||
}
|
||||
previousNode = void 0;
|
||||
previousNode = undefined;
|
||||
segments.pop();
|
||||
},
|
||||
onLiteralValue: (value: any, offset: number, length: number) => {
|
||||
@@ -798,7 +798,7 @@ export function getLocation(text: string, position: number): Location {
|
||||
if (sep === ':' && previousNode && previousNode.type === 'property') {
|
||||
previousNode.colonOffset = offset;
|
||||
isAtPropertyKey = false;
|
||||
previousNode = void 0;
|
||||
previousNode = undefined;
|
||||
} else if (sep === ',') {
|
||||
let last = segments[segments.length - 1];
|
||||
if (typeof last === 'number') {
|
||||
@@ -807,7 +807,7 @@ export function getLocation(text: string, position: number): Location {
|
||||
isAtPropertyKey = true;
|
||||
segments[segments.length - 1] = '';
|
||||
}
|
||||
previousNode = void 0;
|
||||
previousNode = undefined;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -891,7 +891,7 @@ export function parse(text: string, errors: ParseError[] = [], options: ParseOpt
|
||||
* Parses the given text and returns a tree representation the JSON content. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.
|
||||
*/
|
||||
export function parseTree(text: string, errors: ParseError[] = [], options: ParseOptions = ParseOptions.DEFAULT): Node {
|
||||
let currentParent: NodeImpl = { type: 'array', offset: -1, length: -1, children: [], parent: void 0 }; // artificial root
|
||||
let currentParent: NodeImpl = { type: 'array', offset: -1, length: -1, children: [], parent: undefined }; // artificial root
|
||||
|
||||
function ensurePropertyComplete(endOffset: number) {
|
||||
if (currentParent.type === 'property') {
|
||||
@@ -957,13 +957,13 @@ export function parseTree(text: string, errors: ParseError[] = [], options: Pars
|
||||
*/
|
||||
export function findNodeAtLocation(root: Node, path: JSONPath): Node | undefined {
|
||||
if (!root) {
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
let node = root;
|
||||
for (let segment of path) {
|
||||
if (typeof segment === 'string') {
|
||||
if (node.type !== 'object' || !Array.isArray(node.children)) {
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
let found = false;
|
||||
for (const propertyNode of node.children) {
|
||||
@@ -974,12 +974,12 @@ export function findNodeAtLocation(root: Node, path: JSONPath): Node | undefined
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
} else {
|
||||
let index = <number>segment;
|
||||
if (node.type !== 'array' || index < 0 || !Array.isArray(node.children) || index >= node.children.length) {
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
node = node.children[index];
|
||||
}
|
||||
@@ -1029,7 +1029,7 @@ export function getNodeValue(node: Node): any {
|
||||
case 'boolean':
|
||||
return node.value;
|
||||
default:
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1055,7 +1055,7 @@ export function findNodeAtOffset(node: Node, offset: number, includeRightBound =
|
||||
}
|
||||
return node;
|
||||
}
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
@@ -1322,7 +1322,7 @@ export function stripComments(text: string, replaceCh?: string): string {
|
||||
if (offset !== pos) {
|
||||
parts.push(text.substring(offset, pos));
|
||||
}
|
||||
if (replaceCh !== void 0) {
|
||||
if (replaceCh !== undefined) {
|
||||
parts.push(_scanner.getTokenValue().replace(/[^\r\n]/g, replaceCh));
|
||||
}
|
||||
offset = _scanner.getPosition();
|
||||
|
||||
@@ -8,20 +8,20 @@ import { Edit, format, isEOL, FormattingOptions } from './jsonFormatter';
|
||||
|
||||
|
||||
export function removeProperty(text: string, path: JSONPath, formattingOptions: FormattingOptions): Edit[] {
|
||||
return setProperty(text, path, void 0, formattingOptions);
|
||||
return setProperty(text, path, undefined, formattingOptions);
|
||||
}
|
||||
|
||||
export function setProperty(text: string, originalPath: JSONPath, value: any, formattingOptions: FormattingOptions, getInsertionIndex?: (properties: string[]) => number): Edit[] {
|
||||
let path = originalPath.slice();
|
||||
let errors: ParseError[] = [];
|
||||
let root = parseTree(text, errors);
|
||||
let parent: Node | undefined = void 0;
|
||||
let parent: Node | undefined = undefined;
|
||||
|
||||
let lastSegment: Segment | undefined = void 0;
|
||||
let lastSegment: Segment | undefined = undefined;
|
||||
while (path.length > 0) {
|
||||
lastSegment = path.pop();
|
||||
parent = findNodeAtLocation(root, path);
|
||||
if (parent === void 0 && value !== void 0) {
|
||||
if (parent === undefined && value !== undefined) {
|
||||
if (typeof lastSegment === 'string') {
|
||||
value = { [lastSegment]: value };
|
||||
} else {
|
||||
@@ -34,14 +34,14 @@ export function setProperty(text: string, originalPath: JSONPath, value: any, fo
|
||||
|
||||
if (!parent) {
|
||||
// empty document
|
||||
if (value === void 0) { // delete
|
||||
if (value === undefined) { // delete
|
||||
throw new Error('Can not delete in empty document');
|
||||
}
|
||||
return withFormatting(text, { offset: root ? root.offset : 0, length: root ? root.length : 0, content: JSON.stringify(value) }, formattingOptions);
|
||||
} else if (parent.type === 'object' && typeof lastSegment === 'string' && Array.isArray(parent.children)) {
|
||||
let existing = findNodeAtLocation(parent, [lastSegment]);
|
||||
if (existing !== void 0) {
|
||||
if (value === void 0) { // delete
|
||||
if (existing !== undefined) {
|
||||
if (value === undefined) { // delete
|
||||
if (!existing.parent) {
|
||||
throw new Error('Malformed AST');
|
||||
}
|
||||
@@ -66,7 +66,7 @@ export function setProperty(text: string, originalPath: JSONPath, value: any, fo
|
||||
return withFormatting(text, { offset: existing.offset, length: existing.length, content: JSON.stringify(value) }, formattingOptions);
|
||||
}
|
||||
} else {
|
||||
if (value === void 0) { // delete
|
||||
if (value === undefined) { // delete
|
||||
return []; // property does not exist, nothing to do
|
||||
}
|
||||
let newProperty = `${JSON.stringify(lastSegment)}: ${JSON.stringify(value)}`;
|
||||
@@ -96,7 +96,7 @@ export function setProperty(text: string, originalPath: JSONPath, value: any, fo
|
||||
}
|
||||
return withFormatting(text, edit, formattingOptions);
|
||||
} else {
|
||||
if (value === void 0 && parent.children.length >= 0) {
|
||||
if (value === undefined && parent.children.length >= 0) {
|
||||
//Removal
|
||||
let removalIndex = lastSegment;
|
||||
let toRemove = parent.children[removalIndex];
|
||||
|
||||
@@ -110,7 +110,7 @@ export function tildify(path: string, userHome: string): string {
|
||||
}
|
||||
|
||||
// Keep a normalized user home path as cache to prevent accumulated string creation
|
||||
let normalizedUserHome = normalizedUserHomeCached.original === userHome ? normalizedUserHomeCached.normalized : void 0;
|
||||
let normalizedUserHome = normalizedUserHomeCached.original === userHome ? normalizedUserHomeCached.normalized : undefined;
|
||||
if (!normalizedUserHome) {
|
||||
normalizedUserHome = `${rtrim(userHome, sep)}${sep}`;
|
||||
normalizedUserHomeCached = { original: userHome, normalized: normalizedUserHome };
|
||||
|
||||
@@ -24,7 +24,7 @@ export function keys<K, V>(map: Map<K, V>): K[] {
|
||||
|
||||
export function getOrSet<K, V>(map: Map<K, V>, key: K, value: V): V {
|
||||
let result = map.get(key);
|
||||
if (result === void 0) {
|
||||
if (result === undefined) {
|
||||
result = value;
|
||||
map.set(key, result);
|
||||
}
|
||||
@@ -687,7 +687,7 @@ export class LinkedMap<K, V> {
|
||||
this._head = current;
|
||||
this._size = currentSize;
|
||||
if (current) {
|
||||
current.previous = void 0;
|
||||
current.previous = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -719,8 +719,8 @@ export class LinkedMap<K, V> {
|
||||
|
||||
private removeItem(item: Item<K, V>): void {
|
||||
if (item === this._head && item === this._tail) {
|
||||
this._head = void 0;
|
||||
this._tail = void 0;
|
||||
this._head = undefined;
|
||||
this._tail = undefined;
|
||||
}
|
||||
else if (item === this._head) {
|
||||
this._head = item.next;
|
||||
@@ -759,7 +759,7 @@ export class LinkedMap<K, V> {
|
||||
if (item === this._tail) {
|
||||
// previous must be defined since item was not head but is tail
|
||||
// So there are more than on item in the map
|
||||
previous!.next = void 0;
|
||||
previous!.next = undefined;
|
||||
this._tail = previous;
|
||||
}
|
||||
else {
|
||||
@@ -769,7 +769,7 @@ export class LinkedMap<K, V> {
|
||||
}
|
||||
|
||||
// Insert the node at head
|
||||
item.previous = void 0;
|
||||
item.previous = undefined;
|
||||
item.next = this._head;
|
||||
this._head.previous = item;
|
||||
this._head = item;
|
||||
@@ -785,14 +785,14 @@ export class LinkedMap<K, V> {
|
||||
if (item === this._head) {
|
||||
// next must be defined since item was not tail but is head
|
||||
// So there are more than on item in the map
|
||||
next!.previous = void 0;
|
||||
next!.previous = undefined;
|
||||
this._head = next;
|
||||
} else {
|
||||
// Both next and previous are not undefined since item was neither head nor tail.
|
||||
next!.previous = previous;
|
||||
previous!.next = next;
|
||||
}
|
||||
item.next = void 0;
|
||||
item.next = undefined;
|
||||
item.previous = this._tail;
|
||||
this._tail.next = item;
|
||||
this._tail = item;
|
||||
|
||||
@@ -82,9 +82,9 @@ function toTextMimeAssociationItem(association: ITextMimeAssociation): ITextMime
|
||||
filepattern: association.filepattern,
|
||||
firstline: association.firstline,
|
||||
userConfigured: association.userConfigured,
|
||||
filenameLowercase: association.filename ? association.filename.toLowerCase() : void 0,
|
||||
extensionLowercase: association.extension ? association.extension.toLowerCase() : void 0,
|
||||
filepatternLowercase: association.filepattern ? association.filepattern.toLowerCase() : void 0,
|
||||
filenameLowercase: association.filename ? association.filename.toLowerCase() : undefined,
|
||||
extensionLowercase: association.extension ? association.extension.toLowerCase() : undefined,
|
||||
filepatternLowercase: association.filepattern ? association.filepattern.toLowerCase() : undefined,
|
||||
filepatternOnPath: association.filepattern ? association.filepattern.indexOf(paths.sep) >= 0 : false
|
||||
};
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ export function normalize(path: null, toOSPath?: boolean): null;
|
||||
export function normalize(path: string, toOSPath?: boolean): string;
|
||||
export function normalize(path: string | null | undefined, toOSPath?: boolean): string | null | undefined {
|
||||
|
||||
if (path === null || path === void 0) {
|
||||
if (path === null || path === undefined) {
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ define([], function () {
|
||||
const result = [];
|
||||
const entries = global._performanceEntries;
|
||||
for (let i = 0; i < entries.length; i += 5) {
|
||||
if (entries[i] === type && (name === void 0 || entries[i + 1] === name)) {
|
||||
if (entries[i] === type && (name === undefined || entries[i + 1] === name)) {
|
||||
result.push({
|
||||
type: entries[i],
|
||||
name: entries[i + 1],
|
||||
|
||||
@@ -186,7 +186,7 @@ export function isMalformedFileUri(candidate: URI): URI | undefined {
|
||||
if (!candidate.scheme || isWindows && candidate.scheme.match(/^[a-zA-Z]$/)) {
|
||||
return URI.file((candidate.scheme ? candidate.scheme + ':' : '') + candidate.path);
|
||||
}
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -215,27 +215,27 @@ export class URI implements UriComponents {
|
||||
}
|
||||
|
||||
let { scheme, authority, path, query, fragment } = change;
|
||||
if (scheme === void 0) {
|
||||
if (scheme === undefined) {
|
||||
scheme = this.scheme;
|
||||
} else if (scheme === null) {
|
||||
scheme = _empty;
|
||||
}
|
||||
if (authority === void 0) {
|
||||
if (authority === undefined) {
|
||||
authority = this.authority;
|
||||
} else if (authority === null) {
|
||||
authority = _empty;
|
||||
}
|
||||
if (path === void 0) {
|
||||
if (path === undefined) {
|
||||
path = this.path;
|
||||
} else if (path === null) {
|
||||
path = _empty;
|
||||
}
|
||||
if (query === void 0) {
|
||||
if (query === undefined) {
|
||||
query = this.query;
|
||||
} else if (query === null) {
|
||||
query = _empty;
|
||||
}
|
||||
if (fragment === void 0) {
|
||||
if (fragment === undefined) {
|
||||
fragment = this.fragment;
|
||||
} else if (fragment === null) {
|
||||
fragment = _empty;
|
||||
|
||||
@@ -83,7 +83,7 @@ export function getFirstFrame(arg0: IRemoteConsoleLog | string | undefined): ISt
|
||||
}
|
||||
}
|
||||
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function findFirstFrame(stack: string | undefined): string | undefined {
|
||||
|
||||
@@ -401,7 +401,7 @@ export function resolveTerminalEncoding(verbose?: boolean): Promise<string> {
|
||||
}
|
||||
}
|
||||
|
||||
return resolve(void 0);
|
||||
return resolve(undefined);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ function doCopyFile(source: string, target: string, mode: number, callback: (err
|
||||
|
||||
export function mkdirp(path: string, mode?: number, token?: CancellationToken): Promise<boolean> {
|
||||
const mkdir = (): Promise<null> => {
|
||||
return nfcall(fs.mkdir, path, mode).then(void 0, (mkdirErr: NodeJS.ErrnoException) => {
|
||||
return nfcall(fs.mkdir, path, mode).then(undefined, (mkdirErr: NodeJS.ErrnoException) => {
|
||||
|
||||
// ENOENT: a parent folder does not exist yet
|
||||
if (mkdirErr.code === 'ENOENT') {
|
||||
@@ -155,7 +155,7 @@ export function mkdirp(path: string, mode?: number, token?: CancellationToken):
|
||||
}
|
||||
|
||||
// recursively mkdir
|
||||
return mkdir().then(void 0, (err: NodeJS.ErrnoException) => {
|
||||
return mkdir().then(undefined, (err: NodeJS.ErrnoException) => {
|
||||
|
||||
// Respect cancellation
|
||||
if (token && token.isCancellationRequested) {
|
||||
|
||||
@@ -36,7 +36,7 @@ export function rimraf(path: string): Promise<void> {
|
||||
}
|
||||
}, (err: NodeJS.ErrnoException) => {
|
||||
if (err.code === 'ENOENT') {
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return Promise.reject(err);
|
||||
@@ -194,7 +194,7 @@ export function whenDeleted(path: string): Promise<void> {
|
||||
|
||||
if (!exists) {
|
||||
clearInterval(interval);
|
||||
resolve(void 0);
|
||||
resolve(undefined);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ export abstract class AbstractProcess<TProgressData> {
|
||||
public constructor(executable: Executable);
|
||||
public constructor(cmd: string, args: string[] | undefined, shell: boolean, options: CommandOptions | undefined);
|
||||
public constructor(arg1: string | Executable, arg2?: string[], arg3?: boolean, arg4?: CommandOptions) {
|
||||
if (arg2 !== void 0 && arg3 !== void 0 && arg4 !== void 0) {
|
||||
if (arg2 !== undefined && arg3 !== undefined && arg4 !== undefined) {
|
||||
this.cmd = <string>arg1;
|
||||
this.args = arg2;
|
||||
this.shell = arg3;
|
||||
@@ -409,7 +409,7 @@ export namespace win32 {
|
||||
if (path.isAbsolute(command)) {
|
||||
return command;
|
||||
}
|
||||
if (cwd === void 0) {
|
||||
if (cwd === undefined) {
|
||||
cwd = process.cwd();
|
||||
}
|
||||
let dir = path.dirname(command);
|
||||
@@ -418,11 +418,11 @@ export namespace win32 {
|
||||
// to the current working directory.
|
||||
return path.join(cwd, command);
|
||||
}
|
||||
if (paths === void 0 && Types.isString(process.env.PATH)) {
|
||||
if (paths === undefined && Types.isString(process.env.PATH)) {
|
||||
paths = process.env.PATH.split(path.delimiter);
|
||||
}
|
||||
// No PATH environment. Make path absolute to the cwd.
|
||||
if (paths === void 0 || paths.length === 0) {
|
||||
if (paths === undefined || paths.length === 0) {
|
||||
return path.join(cwd, command);
|
||||
}
|
||||
// We have a simple file name. We get the path variable from the env
|
||||
|
||||
@@ -136,7 +136,7 @@ export function download(filePath: string, context: IRequestContext): Promise<vo
|
||||
return new Promise<void>((c, e) => {
|
||||
const out = createWriteStream(filePath);
|
||||
|
||||
out.once('finish', () => c(void 0));
|
||||
out.once('finish', () => c(undefined));
|
||||
context.stream.once('error', e);
|
||||
context.stream.pipe(out);
|
||||
});
|
||||
|
||||
@@ -12,9 +12,9 @@ export function registerContextMenuListener(): void {
|
||||
|
||||
menu.popup({
|
||||
window: BrowserWindow.fromWebContents(event.sender),
|
||||
x: options ? options.x : void 0,
|
||||
y: options ? options.y : void 0,
|
||||
positioningItem: options ? options.positioningItem : void 0,
|
||||
x: options ? options.x : undefined,
|
||||
y: options ? options.y : undefined,
|
||||
positioningItem: options ? options.positioningItem : undefined,
|
||||
callback: () => {
|
||||
event.sender.send(CONTEXT_MENU_CLOSE_CHANNEL, contextMenuId);
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ export class ChannelServer<TContext = string> implements IChannelServer<TContext
|
||||
id, data: {
|
||||
message: err.message,
|
||||
name: err.name,
|
||||
stack: err.stack ? (err.stack.split ? err.stack.split('\n') : err.stack) : void 0
|
||||
stack: err.stack ? (err.stack.split ? err.stack.split('\n') : err.stack) : undefined
|
||||
}, type: ResponseType.PromiseError
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -39,7 +39,7 @@ suite('IPC, Child Process', () => {
|
||||
service.onMarco(({ answer }) => {
|
||||
try {
|
||||
assert.equal(answer, 'polo');
|
||||
c(void 0);
|
||||
c(undefined);
|
||||
} catch (err) {
|
||||
e(err);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ suite('IPC, Socket Protocol', () => {
|
||||
const sub = b.onMessage(data => {
|
||||
sub.dispose();
|
||||
assert.equal(data.toString(), 'foobarfarboo');
|
||||
resolve(void 0);
|
||||
resolve(undefined);
|
||||
});
|
||||
a.send(Buffer.from('foobarfarboo'));
|
||||
});
|
||||
@@ -55,7 +55,7 @@ suite('IPC, Socket Protocol', () => {
|
||||
const sub_1 = b.onMessage(data => {
|
||||
sub_1.dispose();
|
||||
assert.equal(data.readInt8(0), 123);
|
||||
resolve(void 0);
|
||||
resolve(undefined);
|
||||
});
|
||||
const buffer = Buffer.allocUnsafe(1);
|
||||
buffer.writeInt8(123, 0);
|
||||
@@ -81,7 +81,7 @@ suite('IPC, Socket Protocol', () => {
|
||||
return new Promise(resolve => {
|
||||
b.onMessage(msg => {
|
||||
assert.deepEqual(JSON.parse(msg.toString()), data);
|
||||
resolve(void 0);
|
||||
resolve(undefined);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -109,7 +109,7 @@ suite('IPC, Socket Protocol', () => {
|
||||
const receiver2 = new Protocol(stream, buffer);
|
||||
receiver2.onMessage((msg) => {
|
||||
assert.equal(JSON.parse(msg.toString()).value, 2);
|
||||
resolve(void 0);
|
||||
resolve(undefined);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ export class QuickOpenItemAccessorClass implements IItemAccessor<QuickOpenEntry>
|
||||
getItemPath(entry: QuickOpenEntry): string {
|
||||
const resource = entry.getResource();
|
||||
|
||||
return resource ? resource.fsPath : void 0;
|
||||
return resource ? resource.fsPath : undefined;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -277,7 +277,7 @@ export class QuickOpenWidget extends Disposable implements IModelProvider {
|
||||
|
||||
this._register(this.tree.onDidChangeSelection(event => {
|
||||
if (event.selection && event.selection.length > 0) {
|
||||
const mouseEvent: StandardMouseEvent = event.payload && event.payload.originalEvent instanceof StandardMouseEvent ? event.payload.originalEvent : void 0;
|
||||
const mouseEvent: StandardMouseEvent = event.payload && event.payload.originalEvent instanceof StandardMouseEvent ? event.payload.originalEvent : undefined;
|
||||
const shouldOpenInBackground = mouseEvent ? this.shouldOpenInBackground(mouseEvent) : false;
|
||||
|
||||
this.elementSelected(event.selection[0], event, shouldOpenInBackground ? Mode.OPEN_IN_BACKGROUND : Mode.OPEN);
|
||||
@@ -574,7 +574,7 @@ export class QuickOpenWidget extends Disposable implements IModelProvider {
|
||||
show(param: any, options?: IShowOptions): void {
|
||||
this.visible = true;
|
||||
this.isLoosingFocus = false;
|
||||
this.quickNavigateConfiguration = options ? options.quickNavigateConfiguration : void 0;
|
||||
this.quickNavigateConfiguration = options ? options.quickNavigateConfiguration : undefined;
|
||||
|
||||
// Adjust UI for quick navigate mode
|
||||
if (this.quickNavigateConfiguration) {
|
||||
|
||||
@@ -380,7 +380,7 @@ function doScoreItem(label: string, description: string, path: string, query: IP
|
||||
|
||||
// 1.) treat identity matches on full path highest
|
||||
if (path && isLinux ? query.original === path : equalsIgnoreCase(query.original, path)) {
|
||||
return { score: PATH_IDENTITY_SCORE, labelMatch: [{ start: 0, end: label.length }], descriptionMatch: description ? [{ start: 0, end: description.length }] : void 0 };
|
||||
return { score: PATH_IDENTITY_SCORE, labelMatch: [{ start: 0, end: label.length }], descriptionMatch: description ? [{ start: 0, end: description.length }] : undefined };
|
||||
}
|
||||
|
||||
// We only consider label matches if the query is not including file path separators
|
||||
|
||||
@@ -189,9 +189,9 @@ export class DefaultController implements _.IController {
|
||||
|
||||
if (this.shouldToggleExpansion(element, event, origin)) {
|
||||
if (tree.isExpanded(element)) {
|
||||
tree.collapse(element).then(void 0, errors.onUnexpectedError);
|
||||
tree.collapse(element).then(undefined, errors.onUnexpectedError);
|
||||
} else {
|
||||
tree.expand(element).then(void 0, errors.onUnexpectedError);
|
||||
tree.expand(element).then(undefined, errors.onUnexpectedError);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -281,7 +281,7 @@ export class DefaultController implements _.IController {
|
||||
tree.clearHighlight(payload);
|
||||
} else {
|
||||
tree.focusPrevious(1, payload);
|
||||
tree.reveal(tree.getFocus()).then(void 0, errors.onUnexpectedError);
|
||||
tree.reveal(tree.getFocus()).then(undefined, errors.onUnexpectedError);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -293,7 +293,7 @@ export class DefaultController implements _.IController {
|
||||
tree.clearHighlight(payload);
|
||||
} else {
|
||||
tree.focusPreviousPage(payload);
|
||||
tree.reveal(tree.getFocus()).then(void 0, errors.onUnexpectedError);
|
||||
tree.reveal(tree.getFocus()).then(undefined, errors.onUnexpectedError);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -305,7 +305,7 @@ export class DefaultController implements _.IController {
|
||||
tree.clearHighlight(payload);
|
||||
} else {
|
||||
tree.focusNext(1, payload);
|
||||
tree.reveal(tree.getFocus()).then(void 0, errors.onUnexpectedError);
|
||||
tree.reveal(tree.getFocus()).then(undefined, errors.onUnexpectedError);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -317,7 +317,7 @@ export class DefaultController implements _.IController {
|
||||
tree.clearHighlight(payload);
|
||||
} else {
|
||||
tree.focusNextPage(payload);
|
||||
tree.reveal(tree.getFocus()).then(void 0, errors.onUnexpectedError);
|
||||
tree.reveal(tree.getFocus()).then(undefined, errors.onUnexpectedError);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -329,7 +329,7 @@ export class DefaultController implements _.IController {
|
||||
tree.clearHighlight(payload);
|
||||
} else {
|
||||
tree.focusFirst(payload);
|
||||
tree.reveal(tree.getFocus()).then(void 0, errors.onUnexpectedError);
|
||||
tree.reveal(tree.getFocus()).then(undefined, errors.onUnexpectedError);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -341,7 +341,7 @@ export class DefaultController implements _.IController {
|
||||
tree.clearHighlight(payload);
|
||||
} else {
|
||||
tree.focusLast(payload);
|
||||
tree.reveal(tree.getFocus()).then(void 0, errors.onUnexpectedError);
|
||||
tree.reveal(tree.getFocus()).then(undefined, errors.onUnexpectedError);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -359,7 +359,7 @@ export class DefaultController implements _.IController {
|
||||
return tree.reveal(tree.getFocus());
|
||||
}
|
||||
return undefined;
|
||||
}).then(void 0, errors.onUnexpectedError);
|
||||
}).then(undefined, errors.onUnexpectedError);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -377,7 +377,7 @@ export class DefaultController implements _.IController {
|
||||
return tree.reveal(tree.getFocus());
|
||||
}
|
||||
return undefined;
|
||||
}).then(void 0, errors.onUnexpectedError);
|
||||
}).then(undefined, errors.onUnexpectedError);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -525,7 +525,7 @@ export class Item {
|
||||
});
|
||||
|
||||
return result
|
||||
.then(void 0, onUnexpectedError)
|
||||
.then(undefined, onUnexpectedError)
|
||||
.then(() => this._onDidRefreshChildren.fire(eventData));
|
||||
};
|
||||
|
||||
|
||||
@@ -97,17 +97,17 @@ suite('dom', () => {
|
||||
let div = $('div', { class: 'test' });
|
||||
assert.equal(div.className, 'test');
|
||||
|
||||
div = $('div', void 0);
|
||||
div = $('div', undefined);
|
||||
assert.equal(div.className, '');
|
||||
});
|
||||
|
||||
test('should build nodes with children', () => {
|
||||
let div = $('div', void 0, $('span', { id: 'demospan' }));
|
||||
let div = $('div', undefined, $('span', { id: 'demospan' }));
|
||||
let firstChild = div.firstChild as HTMLElement;
|
||||
assert.equal(firstChild.tagName, 'SPAN');
|
||||
assert.equal(firstChild.id, 'demospan');
|
||||
|
||||
div = $('div', void 0, 'hello');
|
||||
div = $('div', undefined, 'hello');
|
||||
|
||||
assert.equal(div.firstChild && div.firstChild.textContent, 'hello');
|
||||
});
|
||||
|
||||
@@ -131,7 +131,7 @@ suite('Splitview', () => {
|
||||
let didLayout = false;
|
||||
const layoutDisposable = view.onDidLayout(() => didLayout = true);
|
||||
|
||||
const renderDisposable = view.onDidGetElement(() => void 0);
|
||||
const renderDisposable = view.onDidGetElement(() => undefined);
|
||||
|
||||
splitview.addView(view, 20);
|
||||
|
||||
|
||||
@@ -268,7 +268,7 @@ suite('Arrays', () => {
|
||||
assert.equal(a[1], 2);
|
||||
assert.equal(a[2], 3);
|
||||
|
||||
arrays.coalesce([null, 1, null, void 0, undefined, 2, 3]);
|
||||
arrays.coalesce([null, 1, null, undefined, undefined, 2, 3]);
|
||||
assert.equal(a.length, 3);
|
||||
assert.equal(a[0], 1);
|
||||
assert.equal(a[1], 2);
|
||||
|
||||
@@ -53,7 +53,7 @@ suite('Async', () => {
|
||||
order.push('afterCreate');
|
||||
|
||||
const promise = cancellablePromise
|
||||
.then(void 0, err => null)
|
||||
.then(undefined, err => null)
|
||||
.then(() => order.push('finally'));
|
||||
|
||||
cancellablePromise.cancel();
|
||||
@@ -75,7 +75,7 @@ suite('Async', () => {
|
||||
order.push('afterCreate');
|
||||
|
||||
const promise = cancellablePromise
|
||||
.then(void 0, err => null)
|
||||
.then(undefined, err => null)
|
||||
.then(() => order.push('finally'));
|
||||
|
||||
cancellablePromise.cancel();
|
||||
@@ -208,13 +208,13 @@ suite('Async', () => {
|
||||
|
||||
assert(!delayer.isTriggered());
|
||||
|
||||
promises.push(delayer.trigger(factory).then(void 0, () => { assert(true, 'yes, it was cancelled'); }));
|
||||
promises.push(delayer.trigger(factory).then(undefined, () => { assert(true, 'yes, it was cancelled'); }));
|
||||
assert(delayer.isTriggered());
|
||||
|
||||
promises.push(delayer.trigger(factory).then(void 0, () => { assert(true, 'yes, it was cancelled'); }));
|
||||
promises.push(delayer.trigger(factory).then(undefined, () => { assert(true, 'yes, it was cancelled'); }));
|
||||
assert(delayer.isTriggered());
|
||||
|
||||
promises.push(delayer.trigger(factory).then(void 0, () => { assert(true, 'yes, it was cancelled'); }));
|
||||
promises.push(delayer.trigger(factory).then(undefined, () => { assert(true, 'yes, it was cancelled'); }));
|
||||
assert(delayer.isTriggered());
|
||||
|
||||
delayer.cancel();
|
||||
@@ -239,10 +239,10 @@ suite('Async', () => {
|
||||
assert.equal(result, 1);
|
||||
assert(!delayer.isTriggered());
|
||||
|
||||
promises.push(delayer.trigger(factory).then(void 0, () => { assert(true, 'yes, it was cancelled'); }));
|
||||
promises.push(delayer.trigger(factory).then(undefined, () => { assert(true, 'yes, it was cancelled'); }));
|
||||
assert(delayer.isTriggered());
|
||||
|
||||
promises.push(delayer.trigger(factory).then(void 0, () => { assert(true, 'yes, it was cancelled'); }));
|
||||
promises.push(delayer.trigger(factory).then(undefined, () => { assert(true, 'yes, it was cancelled'); }));
|
||||
assert(delayer.isTriggered());
|
||||
|
||||
delayer.cancel();
|
||||
@@ -444,7 +444,7 @@ suite('Async', () => {
|
||||
|
||||
queue.queue(f1);
|
||||
queue.queue(f2);
|
||||
queue.queue(f3).then(void 0, () => error = true);
|
||||
queue.queue(f3).then(undefined, () => error = true);
|
||||
queue.queue(f4);
|
||||
return queue.queue(f5).then(() => {
|
||||
assert.equal(res[0], 1);
|
||||
|
||||
@@ -42,7 +42,7 @@ suite('Cache', () => {
|
||||
let result = cache.get();
|
||||
assert.equal(counter1, 1);
|
||||
assert.equal(counter2, 0);
|
||||
result.promise.then(void 0, () => assert(true));
|
||||
result.promise.then(undefined, () => assert(true));
|
||||
result.dispose();
|
||||
assert.equal(counter1, 1);
|
||||
assert.equal(counter2, 0);
|
||||
|
||||
@@ -448,7 +448,7 @@ suite('Event utils', () => {
|
||||
e(err);
|
||||
}
|
||||
|
||||
c(void 0);
|
||||
c(undefined);
|
||||
});
|
||||
|
||||
setTimeout(() => emitter.fire(), 10);
|
||||
|
||||
@@ -39,7 +39,7 @@ suite('Hash', () => {
|
||||
test('object', () => {
|
||||
assert.equal(hash({}), hash({}));
|
||||
assert.equal(hash({ 'foo': 'bar' }), hash({ 'foo': 'bar' }));
|
||||
assert.equal(hash({ 'foo': 'bar', 'foo2': void 0 }), hash({ 'foo2': void 0, 'foo': 'bar' }));
|
||||
assert.equal(hash({ 'foo': 'bar', 'foo2': undefined }), hash({ 'foo2': undefined, 'foo': 'bar' }));
|
||||
assert.notEqual(hash({ 'foo': 'bar' }), hash({ 'foo': 'bar2' }));
|
||||
assert.notEqual(hash({}), hash([]));
|
||||
});
|
||||
|
||||
@@ -132,31 +132,31 @@ suite('JSON - edits', () => {
|
||||
|
||||
test('remove item in array with one item', () => {
|
||||
let content = '[\n 1\n]';
|
||||
let edits = setProperty(content, [0], void 0, formatterOptions);
|
||||
let edits = setProperty(content, [0], undefined, formatterOptions);
|
||||
assertEdit(content, edits, '[]');
|
||||
});
|
||||
|
||||
test('remove item in the middle of the array', () => {
|
||||
let content = '[\n 1,\n 2,\n 3\n]';
|
||||
let edits = setProperty(content, [1], void 0, formatterOptions);
|
||||
let edits = setProperty(content, [1], undefined, formatterOptions);
|
||||
assertEdit(content, edits, '[\n 1,\n 3\n]');
|
||||
});
|
||||
|
||||
test('remove last item in the array', () => {
|
||||
let content = '[\n 1,\n 2,\n "bar"\n]';
|
||||
let edits = setProperty(content, [2], void 0, formatterOptions);
|
||||
let edits = setProperty(content, [2], undefined, formatterOptions);
|
||||
assertEdit(content, edits, '[\n 1,\n 2\n]');
|
||||
});
|
||||
|
||||
test('remove last item in the array if ends with comma', () => {
|
||||
let content = '[\n 1,\n "foo",\n "bar",\n]';
|
||||
let edits = setProperty(content, [2], void 0, formatterOptions);
|
||||
let edits = setProperty(content, [2], undefined, formatterOptions);
|
||||
assertEdit(content, edits, '[\n 1,\n "foo"\n]');
|
||||
});
|
||||
|
||||
test('remove last item in the array if there is a comment in the beginning', () => {
|
||||
let content = '// This is a comment\n[\n 1,\n "foo",\n "bar"\n]';
|
||||
let edits = setProperty(content, [2], void 0, formatterOptions);
|
||||
let edits = setProperty(content, [2], undefined, formatterOptions);
|
||||
assertEdit(content, edits, '// This is a comment\n[\n 1,\n "foo"\n]');
|
||||
});
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import * as assert from 'assert';
|
||||
suite('JSON - formatter', () => {
|
||||
|
||||
function format(content: string, expected: string, insertSpaces = true) {
|
||||
let range: Formatter.Range | undefined = void 0;
|
||||
let range: Formatter.Range | undefined = undefined;
|
||||
var rangeStart = content.indexOf('|');
|
||||
var rangeEnd = content.lastIndexOf('|');
|
||||
if (rangeStart !== -1 && rangeEnd !== -1) {
|
||||
|
||||
@@ -193,13 +193,13 @@ suite('Objects', () => {
|
||||
three: {
|
||||
3: true
|
||||
},
|
||||
four: void 0
|
||||
four: undefined
|
||||
};
|
||||
|
||||
diff = objects.distinct(base, obj);
|
||||
assert.deepEqual(diff, {
|
||||
one: null,
|
||||
four: void 0
|
||||
four: undefined
|
||||
});
|
||||
|
||||
obj = {
|
||||
|
||||
@@ -221,10 +221,10 @@ suite('Resources', () => {
|
||||
}
|
||||
assertMalformedFileUri('/foo/bar', 'file:///foo/bar');
|
||||
|
||||
assertMalformedFileUri('file:///foo/bar', void 0);
|
||||
assertMalformedFileUri('file:///c%3A/foo/bar', void 0);
|
||||
assertMalformedFileUri('file://localhost/c$/devel/test', void 0);
|
||||
assertMalformedFileUri('foo://dadie/foo/bar', void 0);
|
||||
assertMalformedFileUri('foo:///dadie/foo/bar', void 0);
|
||||
assertMalformedFileUri('file:///foo/bar', undefined);
|
||||
assertMalformedFileUri('file:///c%3A/foo/bar', undefined);
|
||||
assertMalformedFileUri('file://localhost/c$/devel/test', undefined);
|
||||
assertMalformedFileUri('foo://dadie/foo/bar', undefined);
|
||||
assertMalformedFileUri('foo:///dadie/foo/bar', undefined);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -320,7 +320,7 @@ suite('Strings', () => {
|
||||
});
|
||||
|
||||
test('fuzzyContains', () => {
|
||||
assert.ok(!strings.fuzzyContains((void 0)!, null!));
|
||||
assert.ok(!strings.fuzzyContains((undefined)!, null!));
|
||||
assert.ok(strings.fuzzyContains('hello world', 'h'));
|
||||
assert.ok(!strings.fuzzyContains('hello world', 'q'));
|
||||
assert.ok(strings.fuzzyContains('hello world', 'hw'));
|
||||
|
||||
@@ -8,8 +8,8 @@ var Workforce;
|
||||
return Company;
|
||||
})();
|
||||
(function (property, Workforce, IEmployee) {
|
||||
if (property === void 0) { property = employees; }
|
||||
if (IEmployee === void 0) { IEmployee = []; }
|
||||
if (property === undefined) { property = employees; }
|
||||
if (IEmployee === undefined) { IEmployee = []; }
|
||||
property;
|
||||
calculateMonthlyExpenses();
|
||||
{
|
||||
|
||||
@@ -7,9 +7,9 @@ var Conway;
|
||||
return Cell;
|
||||
})();
|
||||
(function (property, number, property, number, property, boolean) {
|
||||
if (property === void 0) { property = row; }
|
||||
if (property === void 0) { property = col; }
|
||||
if (property === void 0) { property = live; }
|
||||
if (property === undefined) { property = row; }
|
||||
if (property === undefined) { property = col; }
|
||||
if (property === undefined) { property = live; }
|
||||
});
|
||||
var GameOfLife = (function () {
|
||||
function GameOfLife() {
|
||||
|
||||
@@ -7,10 +7,10 @@ var M;
|
||||
return C;
|
||||
})();
|
||||
(function (x, property, number) {
|
||||
if (property === void 0) { property = w; }
|
||||
if (property === undefined) { property = w; }
|
||||
var local = 1;
|
||||
// unresolved symbol because x is local
|
||||
//self.x++;
|
||||
//self.x++;
|
||||
self.w--; // ok because w is a property
|
||||
property;
|
||||
f = function (y) {
|
||||
|
||||
@@ -73,11 +73,11 @@ suite('PFS', () => {
|
||||
assert.ok(fs.existsSync(newDir));
|
||||
|
||||
return Promise.all([
|
||||
pfs.writeFile(testFile, 'Hello World 1', void 0),
|
||||
pfs.writeFile(testFile, 'Hello World 2', void 0),
|
||||
timeout(10).then(() => pfs.writeFile(testFile, 'Hello World 3', void 0)),
|
||||
pfs.writeFile(testFile, 'Hello World 4', void 0),
|
||||
timeout(10).then(() => pfs.writeFile(testFile, 'Hello World 5', void 0))
|
||||
pfs.writeFile(testFile, 'Hello World 1', undefined),
|
||||
pfs.writeFile(testFile, 'Hello World 2', undefined),
|
||||
timeout(10).then(() => pfs.writeFile(testFile, 'Hello World 3', undefined)),
|
||||
pfs.writeFile(testFile, 'Hello World 4', undefined),
|
||||
timeout(10).then(() => pfs.writeFile(testFile, 'Hello World 5', undefined))
|
||||
]).then(() => {
|
||||
assert.equal(fs.readFileSync(testFile), 'Hello World 5');
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ suite('Ports', () => {
|
||||
|
||||
// create a server to block this port
|
||||
const server = net.createServer();
|
||||
server.listen(initialPort, void 0, void 0, () => {
|
||||
server.listen(initialPort, undefined, undefined, () => {
|
||||
|
||||
// once listening, find another free port and assert that the port is different from the opened one
|
||||
ports.findFreePort(7000, 50, 300000).then(freePort => {
|
||||
|
||||
@@ -135,14 +135,14 @@ suite('Storage Library', () => {
|
||||
changes.clear();
|
||||
|
||||
// Delete is accepted
|
||||
change.set('foo', void 0);
|
||||
change.set('foo', undefined);
|
||||
database.fireDidChangeItemsExternal({ items: change });
|
||||
ok(changes.has('foo'));
|
||||
equal(storage.get('foo', null!), null);
|
||||
changes.clear();
|
||||
|
||||
// Nothing happens if changing to same value
|
||||
change.set('foo', void 0);
|
||||
change.set('foo', undefined);
|
||||
database.fireDidChangeItemsExternal({ items: change });
|
||||
equal(changes.size, 0);
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ export class LanguagePackCachedDataCleaner {
|
||||
|
||||
this._disposables.push({
|
||||
dispose() {
|
||||
if (handle !== void 0) {
|
||||
if (handle !== undefined) {
|
||||
clearTimeout(handle);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ export class LogsDataCleaner extends Disposable {
|
||||
|
||||
private cleanUpOldLogsSoon(): void {
|
||||
let handle: any = setTimeout(() => {
|
||||
handle = void 0;
|
||||
handle = undefined;
|
||||
|
||||
const currentLog = basename(this.environmentService.logsPath);
|
||||
const logsRoot = dirname(this.environmentService.logsPath);
|
||||
|
||||
@@ -25,7 +25,7 @@ export class StorageDataCleaner extends Disposable {
|
||||
|
||||
private cleanUpStorageSoon(): void {
|
||||
let handle: any = setTimeout(() => {
|
||||
handle = void 0;
|
||||
handle = undefined;
|
||||
|
||||
// Leverage the backup workspace file to find out which empty workspace is currently in use to
|
||||
// determine which empty workspace storage can safely be deleted
|
||||
|
||||
@@ -474,7 +474,7 @@ export class CodeApplication extends Disposable {
|
||||
this.lifecycleService.onWillShutdown(e => e.join(storageMainService.close()));
|
||||
|
||||
// Initialize storage service
|
||||
return storageMainService.initialize().then(void 0, error => {
|
||||
return storageMainService.initialize().then(undefined, error => {
|
||||
errors.onUnexpectedError(error);
|
||||
this.logService.error(error);
|
||||
}).then(() => {
|
||||
|
||||
@@ -346,7 +346,7 @@ function main(): void {
|
||||
console.error(err.message);
|
||||
app.exit(1);
|
||||
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// If we are started with --wait create a random temporary file
|
||||
|
||||
@@ -105,7 +105,7 @@ export class SharedProcess implements ISharedProcess {
|
||||
});
|
||||
|
||||
disposables.push(toDisposable(() => sender.send('handshake:goodbye')));
|
||||
ipcMain.once('handshake:im ready', () => c(void 0));
|
||||
ipcMain.once('handshake:im ready', () => c(undefined));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -253,19 +253,19 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
}
|
||||
|
||||
get backupPath(): string {
|
||||
return this.currentConfig ? this.currentConfig.backupPath : void 0;
|
||||
return this.currentConfig ? this.currentConfig.backupPath : undefined;
|
||||
}
|
||||
|
||||
get openedWorkspace(): IWorkspaceIdentifier {
|
||||
return this.currentConfig ? this.currentConfig.workspace : void 0;
|
||||
return this.currentConfig ? this.currentConfig.workspace : undefined;
|
||||
}
|
||||
|
||||
get openedFolderUri(): URI {
|
||||
return this.currentConfig ? this.currentConfig.folderUri : void 0;
|
||||
return this.currentConfig ? this.currentConfig.folderUri : undefined;
|
||||
}
|
||||
|
||||
get remoteAuthority(): string {
|
||||
return this.currentConfig ? this.currentConfig.remoteAuthority : void 0;
|
||||
return this.currentConfig ? this.currentConfig.remoteAuthority : undefined;
|
||||
}
|
||||
|
||||
setReady(): void {
|
||||
@@ -444,7 +444,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
// Make sure to update our workspace config if we detect that it
|
||||
// was deleted
|
||||
if (this.openedWorkspace && this.openedWorkspace.id === workspace.id) {
|
||||
this.currentConfig.workspace = void 0;
|
||||
this.currentConfig.workspace = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -602,13 +602,13 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
windowConfiguration.perfEntries = perf.exportEntries();
|
||||
|
||||
// Parts splash
|
||||
windowConfiguration.partsSplashData = this.storageMainService.get('parts-splash-data', void 0);
|
||||
windowConfiguration.partsSplashData = this.storageMainService.get('parts-splash-data', undefined);
|
||||
|
||||
// Config (combination of process.argv and window configuration)
|
||||
const environment = parseArgs(process.argv);
|
||||
const config = objects.assign(environment, windowConfiguration);
|
||||
for (let key in config) {
|
||||
if (config[key] === void 0 || config[key] === null || config[key] === '' || config[key] === false) {
|
||||
if (config[key] === undefined || config[key] === null || config[key] === '' || config[key] === false) {
|
||||
delete config[key]; // only send over properties that have a true value
|
||||
}
|
||||
}
|
||||
@@ -648,7 +648,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
|
||||
const res = {
|
||||
mode: WindowMode.Fullscreen,
|
||||
display: display ? display.id : void 0,
|
||||
display: display ? display.id : undefined,
|
||||
|
||||
// Still carry over window dimensions from previous sessions
|
||||
// if we can compute it in fullscreen state.
|
||||
@@ -1033,13 +1033,13 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
if (item.iconLocation && item.iconLocation.dark.scheme === 'file') {
|
||||
icon = nativeImage.createFromPath(URI.revive(item.iconLocation.dark).fsPath);
|
||||
if (icon.isEmpty()) {
|
||||
icon = void 0;
|
||||
icon = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
id: item.id,
|
||||
label: !icon ? item.title as string : void 0,
|
||||
label: !icon ? item.title as string : undefined,
|
||||
icon
|
||||
};
|
||||
});
|
||||
|
||||
@@ -248,7 +248,7 @@ export class WindowsManager implements IWindowsMainService {
|
||||
// clear last closed window state when a new window opens. this helps on macOS where
|
||||
// otherwise closing the last window, opening a new window and then quitting would
|
||||
// use the state of the previously closed window when restarting.
|
||||
this.lastClosedWindowState = void 0;
|
||||
this.lastClosedWindowState = undefined;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -386,7 +386,7 @@ export class WindowsManager implements IWindowsMainService {
|
||||
}
|
||||
|
||||
// collect all file inputs
|
||||
let fileInputs: IFileInputs = void 0;
|
||||
let fileInputs: IFileInputs = undefined;
|
||||
for (const path of pathsToOpen) {
|
||||
if (path.fileUri) {
|
||||
if (!fileInputs) {
|
||||
@@ -512,7 +512,7 @@ export class WindowsManager implements IWindowsMainService {
|
||||
// used for the edit operation is closed or loaded to a different folder so that the waiting
|
||||
// process can continue. We do this by deleting the waitMarkerFilePath.
|
||||
if (openConfig.context === OpenContext.CLI && openConfig.cli.wait && openConfig.cli.waitMarkerFilePath && usedWindows.length === 1 && usedWindows[0]) {
|
||||
this.waitForWindowCloseOrLoad(usedWindows[0].id).then(() => fs.unlink(openConfig.cli.waitMarkerFilePath, error => void 0));
|
||||
this.waitForWindowCloseOrLoad(usedWindows[0].id).then(() => fs.unlink(openConfig.cli.waitMarkerFilePath, error => undefined));
|
||||
}
|
||||
|
||||
return usedWindows;
|
||||
@@ -594,7 +594,7 @@ export class WindowsManager implements IWindowsMainService {
|
||||
usedWindows.push(this.doOpenFilesInExistingWindow(openConfig, bestWindowOrFolder, fileInputs));
|
||||
|
||||
// Reset these because we handled them
|
||||
fileInputs = void 0;
|
||||
fileInputs = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -611,7 +611,7 @@ export class WindowsManager implements IWindowsMainService {
|
||||
}));
|
||||
|
||||
// Reset these because we handled them
|
||||
fileInputs = void 0;
|
||||
fileInputs = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -623,14 +623,14 @@ export class WindowsManager implements IWindowsMainService {
|
||||
const windowsOnWorkspace = arrays.coalesce(allWorkspacesToOpen.map(workspaceToOpen => findWindowOnWorkspace(WindowsManager.WINDOWS, workspaceToOpen)));
|
||||
if (windowsOnWorkspace.length > 0) {
|
||||
const windowOnWorkspace = windowsOnWorkspace[0];
|
||||
const fileInputsForWindow = (fileInputs && fileInputs.remoteAuthority === windowOnWorkspace.remoteAuthority) ? fileInputs : void 0;
|
||||
const fileInputsForWindow = (fileInputs && fileInputs.remoteAuthority === windowOnWorkspace.remoteAuthority) ? fileInputs : undefined;
|
||||
|
||||
// Do open files
|
||||
usedWindows.push(this.doOpenFilesInExistingWindow(openConfig, windowOnWorkspace, fileInputsForWindow));
|
||||
|
||||
// Reset these because we handled them
|
||||
if (fileInputsForWindow) {
|
||||
fileInputs = void 0;
|
||||
fileInputs = undefined;
|
||||
}
|
||||
|
||||
openFolderInNewWindow = true; // any other folders to open must open in new window then
|
||||
@@ -642,14 +642,14 @@ export class WindowsManager implements IWindowsMainService {
|
||||
return; // ignore folders that are already open
|
||||
}
|
||||
|
||||
const fileInputsForWindow = (fileInputs && !fileInputs.remoteAuthority) ? fileInputs : void 0;
|
||||
const fileInputsForWindow = (fileInputs && !fileInputs.remoteAuthority) ? fileInputs : undefined;
|
||||
|
||||
// Do open folder
|
||||
usedWindows.push(this.doOpenFolderOrWorkspace(openConfig, { workspace: workspaceToOpen }, openFolderInNewWindow, fileInputsForWindow));
|
||||
|
||||
// Reset these because we handled them
|
||||
if (fileInputsForWindow) {
|
||||
fileInputs = void 0;
|
||||
fileInputs = undefined;
|
||||
}
|
||||
|
||||
openFolderInNewWindow = true; // any other folders to open must open in new window then
|
||||
@@ -665,14 +665,14 @@ export class WindowsManager implements IWindowsMainService {
|
||||
const windowsOnFolderPath = arrays.coalesce(allFoldersToOpen.map(folderToOpen => findWindowOnWorkspace(WindowsManager.WINDOWS, folderToOpen)));
|
||||
if (windowsOnFolderPath.length > 0) {
|
||||
const windowOnFolderPath = windowsOnFolderPath[0];
|
||||
const fileInputsForWindow = fileInputs && fileInputs.remoteAuthority === windowOnFolderPath.remoteAuthority ? fileInputs : void 0;
|
||||
const fileInputsForWindow = fileInputs && fileInputs.remoteAuthority === windowOnFolderPath.remoteAuthority ? fileInputs : undefined;
|
||||
|
||||
// Do open files
|
||||
usedWindows.push(this.doOpenFilesInExistingWindow(openConfig, windowOnFolderPath, fileInputsForWindow));
|
||||
|
||||
// Reset these because we handled them
|
||||
if (fileInputsForWindow) {
|
||||
fileInputs = void 0;
|
||||
fileInputs = undefined;
|
||||
}
|
||||
|
||||
openFolderInNewWindow = true; // any other folders to open must open in new window then
|
||||
@@ -686,14 +686,14 @@ export class WindowsManager implements IWindowsMainService {
|
||||
}
|
||||
|
||||
const remoteAuthority = getRemoteAuthority(folderToOpen);
|
||||
const fileInputsForWindow = (fileInputs && fileInputs.remoteAuthority === remoteAuthority) ? fileInputs : void 0;
|
||||
const fileInputsForWindow = (fileInputs && fileInputs.remoteAuthority === remoteAuthority) ? fileInputs : undefined;
|
||||
|
||||
// Do open folder
|
||||
usedWindows.push(this.doOpenFolderOrWorkspace(openConfig, { folderUri: folderToOpen, remoteAuthority }, openFolderInNewWindow, fileInputsForWindow));
|
||||
|
||||
// Reset these because we handled them
|
||||
if (fileInputsForWindow) {
|
||||
fileInputs = void 0;
|
||||
fileInputs = undefined;
|
||||
}
|
||||
|
||||
openFolderInNewWindow = true; // any other folders to open must open in new window then
|
||||
@@ -704,7 +704,7 @@ export class WindowsManager implements IWindowsMainService {
|
||||
if (emptyToRestore.length > 0) {
|
||||
emptyToRestore.forEach(emptyWindowBackupInfo => {
|
||||
const remoteAuthority = emptyWindowBackupInfo.remoteAuthority;
|
||||
const fileInputsForWindow = (fileInputs && fileInputs.remoteAuthority === remoteAuthority) ? fileInputs : void 0;
|
||||
const fileInputsForWindow = (fileInputs && fileInputs.remoteAuthority === remoteAuthority) ? fileInputs : undefined;
|
||||
|
||||
usedWindows.push(this.openInBrowserWindow({
|
||||
userEnv: openConfig.userEnv,
|
||||
@@ -719,7 +719,7 @@ export class WindowsManager implements IWindowsMainService {
|
||||
|
||||
// Reset these because we handled them
|
||||
if (fileInputsForWindow) {
|
||||
fileInputs = void 0;
|
||||
fileInputs = undefined;
|
||||
}
|
||||
|
||||
openFolderInNewWindow = true; // any other folders to open must open in new window then
|
||||
@@ -731,7 +731,7 @@ export class WindowsManager implements IWindowsMainService {
|
||||
if (fileInputs && !emptyToOpen) {
|
||||
emptyToOpen++;
|
||||
}
|
||||
const remoteAuthority = fileInputs ? fileInputs.remoteAuthority : (openConfig.cli && openConfig.cli.remote || void 0);
|
||||
const remoteAuthority = fileInputs ? fileInputs.remoteAuthority : (openConfig.cli && openConfig.cli.remote || undefined);
|
||||
for (let i = 0; i < emptyToOpen; i++) {
|
||||
usedWindows.push(this.openInBrowserWindow({
|
||||
userEnv: openConfig.userEnv,
|
||||
@@ -744,7 +744,7 @@ export class WindowsManager implements IWindowsMainService {
|
||||
}));
|
||||
|
||||
// Reset these because we handled them
|
||||
fileInputs = void 0;
|
||||
fileInputs = undefined;
|
||||
openFolderInNewWindow = true; // any other window to open must open in new window then
|
||||
}
|
||||
}
|
||||
@@ -885,7 +885,7 @@ export class WindowsManager implements IWindowsMainService {
|
||||
|
||||
private doExtractPathsFromCLI(cli: ParsedArgs): IPath[] {
|
||||
const pathsToOpen: IPathToOpen[] = [];
|
||||
const parseOptions: IPathParseOptions = { ignoreFileNotFound: true, gotoLineMode: cli.goto, remoteAuthority: cli.remote || void 0 };
|
||||
const parseOptions: IPathParseOptions = { ignoreFileNotFound: true, gotoLineMode: cli.goto, remoteAuthority: cli.remote || undefined };
|
||||
|
||||
// folder uris
|
||||
const folderUris = asArray(cli['folder-uri']);
|
||||
@@ -1073,8 +1073,8 @@ export class WindowsManager implements IWindowsMainService {
|
||||
// File
|
||||
return {
|
||||
fileUri: URI.file(candidate),
|
||||
lineNumber: gotoLineMode ? parsedPath.line : void 0,
|
||||
columnNumber: gotoLineMode ? parsedPath.column : void 0,
|
||||
lineNumber: gotoLineMode ? parsedPath.line : undefined,
|
||||
columnNumber: gotoLineMode ? parsedPath.column : undefined,
|
||||
remoteAuthority
|
||||
};
|
||||
}
|
||||
@@ -1472,7 +1472,7 @@ export class WindowsManager implements IWindowsMainService {
|
||||
// Only reload when the window has not vetoed this
|
||||
this.lifecycleService.unload(win, UnloadReason.RELOAD).then(veto => {
|
||||
if (!veto) {
|
||||
win.reload(void 0, cli);
|
||||
win.reload(undefined, cli);
|
||||
|
||||
// Emit
|
||||
this._onWindowReload.fire(win.id);
|
||||
@@ -1574,7 +1574,7 @@ export class WindowsManager implements IWindowsMainService {
|
||||
|
||||
openNewWindow(context: OpenContext, options?: INewWindowOptions): ICodeWindow[] {
|
||||
let cli = this.environmentService.args;
|
||||
let remote = options && options.remoteAuthority || void 0;
|
||||
let remote = options && options.remoteAuthority || undefined;
|
||||
if (cli && (cli.remote !== remote)) {
|
||||
cli = { ...cli, remote };
|
||||
}
|
||||
@@ -1866,7 +1866,7 @@ class Dialogs {
|
||||
|
||||
// Ensure properties
|
||||
if (typeof options.pickFiles === 'boolean' || typeof options.pickFolders === 'boolean') {
|
||||
options.dialogOptions.properties = void 0; // let it override based on the booleans
|
||||
options.dialogOptions.properties = undefined; // let it override based on the booleans
|
||||
|
||||
if (options.pickFiles && options.pickFolders) {
|
||||
options.dialogOptions.properties = ['multiSelections', 'openDirectory', 'openFile', 'createDirectory'];
|
||||
@@ -1893,7 +1893,7 @@ class Dialogs {
|
||||
return paths.map(path => URI.file(path));
|
||||
}
|
||||
|
||||
return void 0;
|
||||
return undefined;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1914,7 +1914,7 @@ class Dialogs {
|
||||
showMessageBox(options: Electron.MessageBoxOptions, window?: ICodeWindow): Promise<IMessageBoxResult> {
|
||||
return this.getDialogQueue(window).queue(() => {
|
||||
return new Promise(resolve => {
|
||||
dialog.showMessageBox(window ? window.win : void 0, options, (response: number, checkboxChecked: boolean) => {
|
||||
dialog.showMessageBox(window ? window.win : undefined, options, (response: number, checkboxChecked: boolean) => {
|
||||
resolve({ button: response, checkboxChecked });
|
||||
});
|
||||
});
|
||||
@@ -1933,7 +1933,7 @@ class Dialogs {
|
||||
|
||||
return this.getDialogQueue(window).queue(() => {
|
||||
return new Promise(resolve => {
|
||||
dialog.showSaveDialog(window ? window.win : void 0, options, path => {
|
||||
dialog.showSaveDialog(window ? window.win : undefined, options, path => {
|
||||
resolve(normalizePath(path));
|
||||
});
|
||||
});
|
||||
@@ -1958,14 +1958,14 @@ class Dialogs {
|
||||
if (options.defaultPath) {
|
||||
validatePathPromise = exists(options.defaultPath).then(exists => {
|
||||
if (!exists) {
|
||||
options.defaultPath = void 0;
|
||||
options.defaultPath = undefined;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Show dialog and wrap as promise
|
||||
validatePathPromise.then(() => {
|
||||
dialog.showOpenDialog(window ? window.win : void 0, options, paths => {
|
||||
dialog.showOpenDialog(window ? window.win : undefined, options, paths => {
|
||||
resolve(normalizePaths(paths));
|
||||
});
|
||||
});
|
||||
@@ -2073,7 +2073,7 @@ class WorkspacesManager {
|
||||
}
|
||||
|
||||
// Update window configuration properly based on transition to workspace
|
||||
window.config.folderUri = void 0;
|
||||
window.config.folderUri = undefined;
|
||||
window.config.workspace = workspace;
|
||||
window.config.backupPath = backupPath;
|
||||
|
||||
@@ -2084,7 +2084,7 @@ class WorkspacesManager {
|
||||
const window = this.windowsMainService.getWindowById(options.windowId) || this.windowsMainService.getFocusedWindow() || this.windowsMainService.getLastActiveWindow();
|
||||
|
||||
this.windowsMainService.pickFileAndOpen({
|
||||
windowId: window ? window.id : void 0,
|
||||
windowId: window ? window.id : undefined,
|
||||
dialogOptions: {
|
||||
buttonLabel: mnemonicButtonLabel(localize({ key: 'openWorkspace', comment: ['&& denotes a mnemonic'] }, "&&Open")),
|
||||
title: localize('openWorkspaceTitle', "Open Workspace"),
|
||||
@@ -2166,7 +2166,7 @@ class WorkspacesManager {
|
||||
private getUntitledWorkspaceSaveDialogDefaultPath(workspace?: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier): string {
|
||||
if (workspace) {
|
||||
if (isSingleFolderWorkspaceIdentifier(workspace)) {
|
||||
return workspace.scheme === Schemas.file ? dirname(workspace.fsPath) : void 0;
|
||||
return workspace.scheme === Schemas.file ? dirname(workspace.fsPath) : undefined;
|
||||
}
|
||||
|
||||
const resolvedWorkspace = this.workspacesMainService.resolveWorkspaceSync(workspace.configPath);
|
||||
@@ -2179,6 +2179,6 @@ class WorkspacesManager {
|
||||
}
|
||||
}
|
||||
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,14 +206,14 @@ export async function main(argv: string[]): Promise<any> {
|
||||
console.log(`Run with '${product.applicationName} -' to read from stdin (e.g. 'ps aux | grep code | ${product.applicationName} -').`);
|
||||
}
|
||||
|
||||
c(void 0);
|
||||
c(undefined);
|
||||
};
|
||||
|
||||
// wait for 1s maximum...
|
||||
setTimeout(() => {
|
||||
process.stdin.removeListener('data', dataListener);
|
||||
|
||||
c(void 0);
|
||||
c(undefined);
|
||||
}, 1000);
|
||||
|
||||
// ...but finish early if we detect data
|
||||
@@ -360,7 +360,7 @@ export async function main(argv: string[]): Promise<any> {
|
||||
return new Promise<void>(c => {
|
||||
|
||||
// Complete when process exits
|
||||
child.once('exit', () => c(void 0));
|
||||
child.once('exit', () => c(undefined));
|
||||
|
||||
// Complete when wait marker file is deleted
|
||||
whenDeleted(waitMarkerFilePath!).then(c, c);
|
||||
|
||||
@@ -58,7 +58,7 @@ export function getIdAndVersion(id: string): [string, string | undefined] {
|
||||
if (matches && matches[1]) {
|
||||
return [adoptToGalleryExtensionId(matches[1]), matches[2]];
|
||||
}
|
||||
return [adoptToGalleryExtensionId(id), void 0];
|
||||
return [adoptToGalleryExtensionId(id), undefined];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -119,8 +119,8 @@ export function parseLineAndColumnAware(rawPath: string): IPathWithLineAndColumn
|
||||
|
||||
return {
|
||||
path: path,
|
||||
line: line !== null ? line : void 0,
|
||||
column: column !== null ? column : line !== null ? 1 : void 0 // if we have a line, make sure column is also set
|
||||
line: line !== null ? line : undefined,
|
||||
column: column !== null ? column : line !== null ? 1 : undefined // if we have a line, make sure column is also set
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -645,7 +645,7 @@ export class MouseTargetFactory {
|
||||
// This most likely indicates it happened after the last view-line
|
||||
const lineCount = ctx.model.getLineCount();
|
||||
const maxLineColumn = ctx.model.getLineMaxColumn(lineCount);
|
||||
return request.fulfill(MouseTargetType.CONTENT_EMPTY, new Position(lineCount, maxLineColumn), void 0, EMPTY_CONTENT_AFTER_LINES);
|
||||
return request.fulfill(MouseTargetType.CONTENT_EMPTY, new Position(lineCount, maxLineColumn), undefined, EMPTY_CONTENT_AFTER_LINES);
|
||||
}
|
||||
|
||||
if (domHitTestExecuted) {
|
||||
@@ -656,7 +656,7 @@ export class MouseTargetFactory {
|
||||
if (ctx.model.getLineLength(lineNumber) === 0) {
|
||||
const lineWidth = ctx.getLineWidth(lineNumber);
|
||||
const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);
|
||||
return request.fulfill(MouseTargetType.CONTENT_EMPTY, new Position(lineNumber, 1), void 0, detail);
|
||||
return request.fulfill(MouseTargetType.CONTENT_EMPTY, new Position(lineNumber, 1), undefined, detail);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -731,10 +731,10 @@ export class MouseTargetFactory {
|
||||
if (browser.isEdge && pos.column === 1) {
|
||||
// See https://github.com/Microsoft/vscode/issues/10875
|
||||
const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);
|
||||
return request.fulfill(MouseTargetType.CONTENT_EMPTY, new Position(lineNumber, ctx.model.getLineMaxColumn(lineNumber)), void 0, detail);
|
||||
return request.fulfill(MouseTargetType.CONTENT_EMPTY, new Position(lineNumber, ctx.model.getLineMaxColumn(lineNumber)), undefined, detail);
|
||||
}
|
||||
const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);
|
||||
return request.fulfill(MouseTargetType.CONTENT_EMPTY, pos, void 0, detail);
|
||||
return request.fulfill(MouseTargetType.CONTENT_EMPTY, pos, undefined, detail);
|
||||
}
|
||||
|
||||
const visibleRange = ctx.visibleRangeForPosition2(lineNumber, column);
|
||||
|
||||
@@ -147,7 +147,7 @@ class DecorationTypeOptionsProvider implements IModelDecorationOptionsProvider {
|
||||
if (rules.hasContent) {
|
||||
return rules.className;
|
||||
}
|
||||
return void 0;
|
||||
return undefined;
|
||||
};
|
||||
const createInlineCSSRules = (type: ModelDecorationCSSRuleType) => {
|
||||
const rules = new DecorationCSSRules(type, providerArgs, themeService);
|
||||
|
||||
@@ -47,13 +47,13 @@ export class ViewOutgoingEvents extends Disposable {
|
||||
|
||||
public emitViewFocusGained(): void {
|
||||
if (this.onDidGainFocus) {
|
||||
this.onDidGainFocus(void 0);
|
||||
this.onDidGainFocus(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
public emitViewFocusLost(): void {
|
||||
if (this.onDidLoseFocus) {
|
||||
this.onDidLoseFocus(void 0);
|
||||
this.onDidLoseFocus(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -930,7 +930,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
|
||||
|
||||
const action = this.getAction(handlerId);
|
||||
if (action) {
|
||||
Promise.resolve(action.run()).then(void 0, onUnexpectedError);
|
||||
Promise.resolve(action.run()).then(undefined, onUnexpectedError);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -951,7 +951,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
|
||||
payload = payload || {};
|
||||
payload.source = source;
|
||||
this._instantiationService.invokeFunction((accessor) => {
|
||||
Promise.resolve(command.runEditorCommand(accessor, this, payload)).then(void 0, onUnexpectedError);
|
||||
Promise.resolve(command.runEditorCommand(accessor, this, payload)).then(undefined, onUnexpectedError);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
@@ -1328,7 +1328,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
|
||||
}));
|
||||
|
||||
listenersToRemove.push(cursor.onDidAttemptReadOnlyEdit(() => {
|
||||
this._onDidAttemptReadOnlyEdit.fire(void 0);
|
||||
this._onDidAttemptReadOnlyEdit.fire(undefined);
|
||||
}));
|
||||
|
||||
listenersToRemove.push(cursor.onDidChange((e: CursorStateChangedEvent) => {
|
||||
@@ -1767,11 +1767,11 @@ class CodeEditorWidgetFocusTracker extends Disposable {
|
||||
|
||||
this._register(this._domFocusTracker.onDidFocus(() => {
|
||||
this._hasFocus = true;
|
||||
this._onChange.fire(void 0);
|
||||
this._onChange.fire(undefined);
|
||||
}));
|
||||
this._register(this._domFocusTracker.onDidBlur(() => {
|
||||
this._hasFocus = false;
|
||||
this._onChange.fire(void 0);
|
||||
this._onChange.fire(undefined);
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ export class Cursor extends viewEvents.ViewEventEmitter implements ICursors {
|
||||
public setStates(source: string, reason: CursorChangeReason, states: PartialCursorState[] | null): void {
|
||||
if (states !== null && states.length > Cursor.MAX_CURSOR_COUNT) {
|
||||
states = states.slice(0, Cursor.MAX_CURSOR_COUNT);
|
||||
this._onDidReachMaxCursorCount.fire(void 0);
|
||||
this._onDidReachMaxCursorCount.fire(undefined);
|
||||
}
|
||||
|
||||
const oldState = new CursorModelState(this._model, this);
|
||||
@@ -467,7 +467,7 @@ export class Cursor extends viewEvents.ViewEventEmitter implements ICursors {
|
||||
if (this._configuration.editor.readOnly) {
|
||||
// All the remaining handlers will try to edit the model,
|
||||
// but we cannot edit when read only...
|
||||
this._onDidAttemptReadOnlyEdit.fire(void 0);
|
||||
this._onDidAttemptReadOnlyEdit.fire(undefined);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,10 +38,10 @@ export class InternalEditorAction implements IEditorAction {
|
||||
|
||||
public run(): Promise<void> {
|
||||
if (!this.isSupported()) {
|
||||
return Promise.resolve(void 0);
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
const r = this._run();
|
||||
return r ? r : Promise.resolve(void 0);
|
||||
return r ? r : Promise.resolve(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,11 +32,11 @@ export class EditorModesRegistry {
|
||||
|
||||
public registerLanguage(def: ILanguageExtensionPoint): void {
|
||||
this._languages.push(def);
|
||||
this._onDidChangeLanguages.fire(void 0);
|
||||
this._onDidChangeLanguages.fire(undefined);
|
||||
}
|
||||
public setDynamicLanguages(def: ILanguageExtensionPoint[]): void {
|
||||
this._dynamicLanguages = def;
|
||||
this._onDidChangeLanguages.fire(void 0);
|
||||
this._onDidChangeLanguages.fire(undefined);
|
||||
}
|
||||
public getLanguages(): ILanguageExtensionPoint[] {
|
||||
return (<ILanguageExtensionPoint[]>[]).concat(this._languages).concat(this._dynamicLanguages);
|
||||
|
||||
@@ -361,7 +361,7 @@ export class EditorWorkerClient extends Disposable {
|
||||
}
|
||||
|
||||
protected _getProxy(): Promise<EditorSimpleWorkerImpl> {
|
||||
return this._getOrCreateWorker().getProxyObject().then(void 0, (err) => {
|
||||
return this._getOrCreateWorker().getProxyObject().then(undefined, (err) => {
|
||||
logOnceWebWorkerWarning(err);
|
||||
this._worker = new SynchronousWorkerClient(new EditorSimpleWorkerImpl(null));
|
||||
return this._getOrCreateWorker().getProxyObject();
|
||||
|
||||
@@ -38,7 +38,7 @@ export class TextResourceConfigurationService extends Disposable implements ITex
|
||||
}
|
||||
|
||||
private _getValue<T>(resource: URI, position: IPosition | null, section: string | undefined): T {
|
||||
const language = resource ? this.getLanguage(resource, position) : void 0;
|
||||
const language = resource ? this.getLanguage(resource, position) : undefined;
|
||||
if (typeof section === 'undefined') {
|
||||
return this.configurationService.getValue<T>({ resource, overrideIdentifier: language });
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user