From ef2547d547204c9a2ff6bf6c7edc7ae871193484 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Fri, 28 Dec 2018 13:15:41 -0800 Subject: [PATCH] replace void 0 with undefined --- build/gulpfile.vscode.js | 6 +- build/lib/git.ts | 6 +- build/lib/watch/index.js | 2 +- .../server/src/cssServerMain.ts | 2 +- .../server/src/languageModelCache.ts | 4 +- .../server/src/utils/documentContext.ts | 2 +- extensions/git/src/git.ts | 18 +-- extensions/git/src/util.ts | 2 +- .../client/src/tagClosing.ts | 6 +- .../server/src/htmlServerMain.ts | 2 +- .../server/src/languageModelCache.ts | 4 +- .../server/src/modes/embeddedSupport.ts | 2 +- .../server/src/modes/htmlFolding.ts | 2 +- .../server/src/modes/javascriptMode.ts | 2 +- .../server/src/modes/languageModes.ts | 2 +- .../server/src/test/embedded.test.ts | 2 +- .../server/src/test/folding.test.ts | 2 +- .../server/src/test/formatting.test.ts | 6 +- .../server/src/utils/documentContext.ts | 2 +- .../client/src/jsonMain.ts | 2 +- .../server/src/jsonServerMain.ts | 6 +- .../server/src/languageModelCache.ts | 4 +- .../src/commands/openDocumentLink.ts | 4 +- .../npm/src/features/bowerJSONContribution.ts | 4 +- .../src/features/validationProvider.ts | 4 +- .../src/features/bufferSyncSupport.ts | 6 +- .../src/singlefolder-tests/commands.test.ts | 6 +- src/bootstrap-window.js | 2 +- src/main.js | 2 +- src/vs/base/browser/dom.ts | 4 +- src/vs/base/browser/ui/actionbar/actionbar.ts | 12 +- src/vs/base/browser/ui/iconLabel/iconLabel.ts | 4 +- .../ui/scrollbar/horizontalScrollbar.ts | 8 +- .../browser/ui/scrollbar/verticalScrollbar.ts | 8 +- src/vs/base/browser/ui/toolbar/toolbar.ts | 8 +- src/vs/base/common/decorators.ts | 4 +- src/vs/base/common/event.ts | 2 +- src/vs/base/common/htmlContent.ts | 2 +- src/vs/base/common/json.ts | 34 ++-- src/vs/base/common/jsonEdit.ts | 18 +-- src/vs/base/common/labels.ts | 2 +- src/vs/base/common/map.ts | 16 +- src/vs/base/common/mime.ts | 6 +- src/vs/base/common/paths.ts | 2 +- src/vs/base/common/performance.js | 2 +- src/vs/base/common/resources.ts | 2 +- src/vs/base/common/uri.ts | 10 +- src/vs/base/node/console.ts | 2 +- src/vs/base/node/encoding.ts | 2 +- src/vs/base/node/extfs.ts | 4 +- src/vs/base/node/pfs.ts | 4 +- src/vs/base/node/processes.ts | 8 +- src/vs/base/node/request.ts | 2 +- .../contextmenu/electron-main/contextmenu.ts | 6 +- src/vs/base/parts/ipc/node/ipc.ts | 2 +- .../base/parts/ipc/test/node/ipc.cp.test.ts | 2 +- .../base/parts/ipc/test/node/ipc.net.test.ts | 8 +- .../parts/quickopen/browser/quickOpenModel.ts | 2 +- .../quickopen/browser/quickOpenWidget.ts | 4 +- .../parts/quickopen/common/quickOpenScorer.ts | 2 +- .../base/parts/tree/browser/treeDefaults.ts | 20 +-- src/vs/base/parts/tree/browser/treeModel.ts | 2 +- src/vs/base/test/browser/dom.test.ts | 6 +- .../browser/ui/splitview/splitview.test.ts | 2 +- src/vs/base/test/common/arrays.test.ts | 2 +- src/vs/base/test/common/async.test.ts | 16 +- src/vs/base/test/common/cache.test.ts | 2 +- src/vs/base/test/common/event.test.ts | 2 +- src/vs/base/test/common/hash.test.ts | 2 +- src/vs/base/test/common/jsonEdit.test.ts | 10 +- src/vs/base/test/common/jsonFormatter.test.ts | 2 +- src/vs/base/test/common/objects.test.ts | 4 +- src/vs/base/test/common/resources.test.ts | 10 +- src/vs/base/test/common/strings.test.ts | 2 +- .../node/extfs/fixtures/examples/company.jxs | 4 +- .../node/extfs/fixtures/examples/conway.jxs | 6 +- .../node/extfs/fixtures/examples/small.jxs | 4 +- src/vs/base/test/node/pfs.test.ts | 10 +- src/vs/base/test/node/port.test.ts | 2 +- src/vs/base/test/node/storage/storage.test.ts | 4 +- .../contrib/languagePackCachedDataCleaner.ts | 2 +- .../sharedProcess/contrib/logsDataCleaner.ts | 2 +- .../contrib/storageDataCleaner.ts | 2 +- src/vs/code/electron-main/app.ts | 2 +- src/vs/code/electron-main/main.ts | 2 +- src/vs/code/electron-main/sharedProcess.ts | 2 +- src/vs/code/electron-main/window.ts | 20 +-- src/vs/code/electron-main/windows.ts | 64 ++++---- src/vs/code/node/cli.ts | 6 +- src/vs/code/node/cliProcessMain.ts | 2 +- src/vs/code/node/paths.ts | 4 +- .../editor/browser/controller/mouseTarget.ts | 8 +- .../browser/services/codeEditorServiceImpl.ts | 2 +- .../editor/browser/view/viewOutgoingEvents.ts | 4 +- .../editor/browser/widget/codeEditorWidget.ts | 10 +- src/vs/editor/common/controller/cursor.ts | 4 +- src/vs/editor/common/editorAction.ts | 4 +- src/vs/editor/common/modes/modesRegistry.ts | 4 +- .../services/editorWorkerServiceImpl.ts | 2 +- .../services/resourceConfigurationImpl.ts | 2 +- .../editor/common/view/minimapCharRenderer.ts | 2 +- .../codeAction/test/codeActionModel.test.ts | 2 +- .../contrib/codelens/codelensController.ts | 4 +- .../contrib/documentSymbols/outlineModel.ts | 4 +- src/vs/editor/contrib/find/findWidget.ts | 10 +- .../contrib/find/test/findController.test.ts | 4 +- src/vs/editor/contrib/folding/folding.ts | 4 +- src/vs/editor/contrib/folding/foldingModel.ts | 2 +- .../editor/contrib/folding/foldingRanges.ts | 2 +- .../contrib/folding/indentRangeProvider.ts | 2 +- .../folding/intializingRangeProvider.ts | 4 +- .../contrib/folding/syntaxRangeProvider.ts | 2 +- .../contrib/folding/test/foldingModel.test.ts | 14 +- .../folding/test/hiddenRangeModel.test.ts | 2 +- .../goToDefinition/goToDefinitionCommands.ts | 4 +- src/vs/editor/contrib/gotoError/gotoError.ts | 10 +- .../contrib/inPlaceReplace/inPlaceReplace.ts | 6 +- .../multicursor/test/multicursor.test.ts | 2 +- .../referenceSearch/referencesWidget.ts | 2 +- .../editor/contrib/smartSelect/smartSelect.ts | 2 +- .../contrib/snippet/snippetVariables.ts | 2 +- .../browser/quickOpen/quickCommand.ts | 2 +- .../standalone/browser/simpleServices.ts | 10 +- src/vs/loader.js | 14 +- src/vs/nls.build.js | 2 +- src/vs/nls.js | 4 +- .../platform/commands/test/commands.test.ts | 4 +- .../common/configurationModels.ts | 6 +- .../common/configurationRegistry.ts | 4 +- .../configuration/node/configuration.ts | 2 +- .../node/configurationService.ts | 4 +- .../test/common/configuration.test.ts | 2 +- .../test/common/testConfigurationService.ts | 6 +- .../test/node/configurationService.test.ts | 10 +- src/vs/platform/download/node/downloadIpc.ts | 2 +- .../environment/node/environmentService.ts | 2 +- .../common/extensionEnablementService.ts | 2 +- .../node/extensionGalleryService.ts | 8 +- .../node/extensionLifecycle.ts | 6 +- .../node/extensionManagementService.ts | 32 ++-- .../node/multiExtensionManagement.ts | 2 +- .../extensionEnablementService.test.ts | 12 +- .../test/common/instantiationService.test.ts | 2 +- .../test/common/instantiationServiceMock.ts | 2 +- .../issue/electron-main/issueService.ts | 4 +- .../common/abstractKeybindingService.test.ts | 2 +- src/vs/platform/label/common/label.ts | 2 +- .../launch/electron-main/launchService.ts | 6 +- .../electron-browser/lifecycleService.ts | 2 +- .../lifecycle/electron-main/lifecycleMain.ts | 2 +- .../localizations/node/localizations.ts | 2 +- .../platform/markers/common/markerService.ts | 4 +- src/vs/platform/markers/common/markers.ts | 10 +- .../platform/menubar/electron-main/menubar.ts | 2 +- .../menubar/electron-main/menubarService.ts | 2 +- src/vs/platform/node/zip.ts | 10 +- src/vs/platform/progress/common/progress.ts | 2 +- src/vs/platform/remote/common/remoteHosts.ts | 2 +- .../node/remoteAgentFileSystemChannel.ts | 2 +- src/vs/platform/state/node/stateService.ts | 2 +- src/vs/platform/state/test/node/state.test.ts | 2 +- .../storage/node/storageMainService.ts | 2 +- .../platform/storage/node/storageService.ts | 18 +-- .../storage/test/node/storageService.test.ts | 16 +- .../telemetry/common/telemetryUtils.ts | 2 +- .../telemetry/node/appInsightsAppender.ts | 2 +- .../electron-browser/commonProperties.test.ts | 4 +- .../electron-main/abstractUpdateService.ts | 4 +- .../electron-main/updateService.linux.ts | 2 +- .../electron-main/updateService.snap.ts | 8 +- .../electron-main/updateService.win32.ts | 10 +- .../windows/electron-main/windowsService.ts | 6 +- src/vs/platform/workspace/common/workspace.ts | 2 +- .../workspacesMainService.test.ts | 4 +- .../browser/viewsContainersExtensionPoint.ts | 2 +- .../api/browser/viewsExtensionPoint.ts | 2 +- .../mainThreadDebugService.ts | 4 +- .../electron-browser/mainThreadDecorations.ts | 2 +- .../electron-browser/mainThreadDocuments.ts | 2 +- .../api/electron-browser/mainThreadEditors.ts | 18 +-- .../electron-browser/mainThreadHeapService.ts | 2 +- .../mainThreadMessageService.ts | 4 +- .../api/electron-browser/mainThreadTask.ts | 24 +-- .../electron-browser/mainThreadTreeViews.ts | 4 +- .../api/electron-browser/mainThreadUrls.ts | 6 +- src/vs/workbench/api/node/extHost.api.impl.ts | 2 +- .../workbench/api/node/extHostApiCommands.ts | 16 +- .../api/node/extHostConfiguration.ts | 10 +- .../workbench/api/node/extHostDebugService.ts | 22 +-- .../workbench/api/node/extHostDecorations.ts | 2 +- .../api/node/extHostExtensionActivator.ts | 14 +- .../api/node/extHostExtensionService.ts | 30 ++-- .../api/node/extHostLanguageFeatures.ts | 2 +- src/vs/workbench/api/node/extHostQuickOpen.ts | 4 +- src/vs/workbench/api/node/extHostSCM.ts | 12 +- src/vs/workbench/api/node/extHostStatusBar.ts | 2 +- src/vs/workbench/api/node/extHostTask.ts | 50 +++--- .../workbench/api/node/extHostTextEditor.ts | 2 +- src/vs/workbench/api/node/extHostTreeViews.ts | 30 ++-- .../api/node/extHostTypeConverters.ts | 4 +- src/vs/workbench/api/node/extHostTypes.ts | 14 +- src/vs/workbench/api/node/extHostUrls.ts | 4 +- src/vs/workbench/api/node/extHostWebview.ts | 2 +- src/vs/workbench/api/node/extHostWorkspace.ts | 2 +- .../browser/actions/workspaceCommands.ts | 6 +- src/vs/workbench/browser/dnd.ts | 20 +-- src/vs/workbench/browser/labels.ts | 34 ++-- .../parts/activitybar/activitybarActions.ts | 2 +- .../parts/activitybar/activitybarPart.ts | 10 +- .../workbench/browser/parts/compositeBar.ts | 4 +- .../workbench/browser/parts/compositePart.ts | 2 +- .../browser/parts/editor/baseEditor.ts | 4 +- .../browser/parts/editor/binaryEditor.ts | 4 +- .../parts/editor/editor.contribution.ts | 2 +- .../workbench/browser/parts/editor/editor.ts | 2 +- .../browser/parts/editor/editorActions.ts | 14 +- .../browser/parts/editor/editorCommands.ts | 46 +++--- .../browser/parts/editor/editorDropTarget.ts | 14 +- .../browser/parts/editor/editorGroupView.ts | 20 +-- .../browser/parts/editor/editorPart.ts | 6 +- .../browser/parts/editor/editorStatus.ts | 8 +- .../parts/editor/noTabsTitleControl.ts | 2 +- .../browser/parts/editor/resourceViewer.ts | 6 +- .../browser/parts/editor/sideBySideEditor.ts | 2 +- .../browser/parts/editor/tabsTitleControl.ts | 10 +- .../browser/parts/editor/textDiffEditor.ts | 4 +- .../browser/parts/editor/textEditor.ts | 4 +- .../parts/editor/textResourceEditor.ts | 4 +- .../browser/parts/editor/titleControl.ts | 2 +- .../notifications/notificationsActions.ts | 2 +- .../notifications/notificationsCenter.ts | 2 +- .../notifications/notificationsCommands.ts | 2 +- .../notifications/notificationsViewer.ts | 4 +- .../browser/parts/panel/panelPart.ts | 4 +- .../browser/parts/quickinput/quickInput.ts | 2 +- .../browser/parts/quickinput/quickInputBox.ts | 2 +- .../parts/quickopen/quickOpenController.ts | 14 +- .../browser/parts/quickopen/quickopen.ts | 6 +- .../browser/parts/statusbar/statusbarPart.ts | 2 +- .../browser/parts/views/customView.ts | 18 +-- src/vs/workbench/browser/parts/views/views.ts | 2 +- src/vs/workbench/browser/quickopen.ts | 2 +- src/vs/workbench/common/actions.ts | 4 +- src/vs/workbench/common/editor/editorGroup.ts | 4 +- .../common/editor/untitledEditorInput.ts | 2 +- src/vs/workbench/common/notifications.ts | 26 +-- src/vs/workbench/electron-browser/actions.ts | 16 +- src/vs/workbench/electron-browser/commands.ts | 22 +-- src/vs/workbench/electron-browser/shell.ts | 2 +- src/vs/workbench/electron-browser/window.ts | 4 +- .../workbench/electron-browser/workbench.ts | 6 +- .../parts/backup/common/backupRestorer.ts | 6 +- .../cli/electron-browser/cli.contribution.ts | 14 +- .../languageConfigurationExtensionPoint.ts | 2 +- .../electron-browser/toggleWordWrap.ts | 4 +- .../electron-browser/commentService.ts | 2 +- .../electron-browser/commentsPanel.ts | 4 +- .../electron-browser/commentsTreeViewer.ts | 2 +- .../parts/debug/browser/debugEditorActions.ts | 4 +- .../parts/debug/common/debugModel.ts | 4 +- .../debugConfigurationManager.ts | 2 +- .../debug/electron-browser/debugHover.ts | 2 +- .../debug/electron-browser/debugService.ts | 8 +- .../debug/electron-browser/debugSession.ts | 14 +- .../parts/debug/node/debugAdapter.ts | 4 +- .../workbench/parts/debug/node/terminals.ts | 2 +- .../parts/debug/test/common/mockDebug.ts | 2 +- .../browser/actions/showEmmetCommands.ts | 2 +- .../execution/electron-browser/terminal.ts | 2 +- .../electron-browser/terminalService.ts | 6 +- .../extensions/browser/extensionsQuickOpen.ts | 2 +- .../electron-browser/extensionEditor.ts | 4 +- .../extensionProfileService.ts | 4 +- .../electron-browser/extensionTipsService.ts | 16 +- .../electron-browser/extensionsActions.ts | 30 ++-- .../electron-browser/extensionsUtils.ts | 2 +- .../electron-browser/extensionsViewlet.ts | 2 +- .../electron-browser/extensionsViews.ts | 2 +- .../node/extensionsWorkbenchService.ts | 22 +-- .../extensionsActions.test.ts | 2 +- .../electron-browser/extensionsViews.test.ts | 2 +- .../extensionsWorkbenchService.test.ts | 4 +- .../electron-browser/feedbackStatusbarItem.ts | 2 +- .../files/browser/editors/binaryFileEditor.ts | 4 +- .../browser/editors/fileEditorTracker.ts | 6 +- .../files/browser/editors/textFileEditor.ts | 2 +- .../parts/files/common/explorerModel.ts | 2 +- .../fileActions.contribution.ts | 2 +- .../files/electron-browser/fileActions.ts | 24 +-- .../files/electron-browser/fileCommands.ts | 16 +- .../electron-browser/views/explorerView.ts | 22 +-- .../electron-browser/views/explorerViewer.ts | 22 +-- .../electron-browser/views/openEditorsView.ts | 6 +- .../test/browser/fileEditorInput.test.ts | 30 ++-- .../electron-browser/localizationsActions.ts | 2 +- .../logs/electron-browser/logsActions.ts | 2 +- .../parts/markers/electron-browser/markers.ts | 4 +- .../markers/electron-browser/markersModel.ts | 2 +- .../markers/electron-browser/markersPanel.ts | 2 +- .../parts/output/browser/outputPanel.ts | 2 +- .../output/electron-browser/outputServices.ts | 18 +-- .../preferences/browser/keybindingsEditor.ts | 8 +- .../preferences/browser/preferencesEditor.ts | 10 +- .../preferences/browser/preferencesWidgets.ts | 2 +- .../parts/preferences/browser/settingsTree.ts | 4 +- .../common/preferencesContribution.ts | 6 +- .../electron-browser/settingsEditor2.ts | 6 +- .../quickopen/browser/commandsHandler.ts | 12 +- .../quickopen/browser/gotoSymbolHandler.ts | 6 +- .../quickopen/browser/viewPickerHandler.ts | 2 +- .../relauncher.contribution.ts | 8 +- .../parts/scm/electron-browser/scmActivity.ts | 2 +- .../parts/scm/electron-browser/scmMenus.ts | 2 +- .../parts/scm/electron-browser/scmViewlet.ts | 2 +- .../parts/search/browser/openFileHandler.ts | 6 +- .../parts/search/browser/openSymbolHandler.ts | 2 +- .../parts/search/browser/searchActions.ts | 6 +- .../parts/search/browser/searchView.ts | 4 +- .../parts/search/browser/searchWidget.ts | 2 +- .../electron-browser/search.contribution.ts | 6 +- .../search/test/browser/searchActions.test.ts | 4 +- .../parts/stats/node/workspaceStats.ts | 6 +- .../parts/tasks/common/problemCollectors.ts | 4 +- .../parts/tasks/common/problemMatcher.ts | 26 +-- .../tasks/common/taskDefinitionRegistry.ts | 4 +- src/vs/workbench/parts/tasks/common/tasks.ts | 14 +- .../electron-browser/runAutomaticTasks.ts | 6 +- .../electron-browser/task.contribution.ts | 60 +++---- .../electron-browser/terminalTaskSystem.ts | 20 +-- .../parts/tasks/node/processTaskSystem.ts | 2 +- .../parts/tasks/node/taskConfiguration.ts | 148 +++++++++--------- src/vs/workbench/parts/tasks/node/tasks.ts | 6 +- .../parts/terminal/common/terminalCommands.ts | 2 +- .../parts/terminal/common/terminalService.ts | 12 +- .../electron-browser/terminalActions.ts | 78 ++++----- .../electron-browser/terminalInstance.ts | 2 +- .../terminalProcessManager.ts | 2 +- .../parts/terminal/node/terminalProcess.ts | 2 +- .../electron-browser/themes.contribution.ts | 6 +- .../themes.test.contribution.ts | 2 +- .../electron-browser/releaseNotesEditor.ts | 2 +- .../parts/update/electron-browser/update.ts | 2 +- .../electron-browser/webviewEditorService.ts | 4 +- .../electron-browser/telemetryOptOut.ts | 2 +- .../page/electron-browser/welcomePage.ts | 12 +- .../electron-browser/menusExtensionPoint.ts | 2 +- .../services/backup/node/backupFileService.ts | 4 +- .../configuration/node/configuration.ts | 16 +- .../node/configurationService.ts | 32 ++-- .../configurationEditingService.test.ts | 4 +- .../configurationService.test.ts | 56 +++---- .../configurationResolverService.test.ts | 2 +- .../electron-browser/contextmenuService.ts | 4 +- .../electron-browser/crashReporterService.ts | 2 +- .../dialogs/electron-browser/dialogService.ts | 14 +- .../services/editor/browser/editorService.ts | 10 +- .../editor/test/browser/editorService.test.ts | 2 +- .../cachedExtensionScanner.ts | 2 +- .../electron-browser/extensionHost.ts | 4 +- .../extensionHostProcessManager.ts | 2 +- .../electron-browser/extensionService.ts | 4 +- .../files/electron-browser/fileService.ts | 46 +++--- .../electron-browser/remoteFileService.ts | 2 +- .../node/watcher/nsfw/nsfwWatcherService.ts | 6 +- .../test/electron-browser/fileService.test.ts | 16 +- .../fixtures/resolver/examples/company.js | 4 +- .../fixtures/resolver/examples/conway.js | 6 +- .../fixtures/resolver/examples/small.js | 4 +- .../fixtures/resolver/other/deep/company.js | 4 +- .../fixtures/resolver/other/deep/conway.js | 6 +- .../fixtures/resolver/other/deep/small.js | 4 +- .../fixtures/service/deep/company.js | 4 +- .../fixtures/service/deep/conway.js | 6 +- .../fixtures/service/deep/small.js | 4 +- .../test/electron-browser/resolver.test.ts | 2 +- .../test/browser/editorGroupsService.test.ts | 2 +- .../history/electron-browser/history.ts | 26 +-- .../keybinding/common/keybindingEditing.ts | 4 +- .../keybindingEditing.test.ts | 6 +- .../preferences/browser/preferencesService.ts | 12 +- .../common/keybindingsEditorModel.test.ts | 2 +- .../progress/browser/progressService.ts | 18 +-- .../progress/browser/progressService2.ts | 2 +- .../services/search/node/legacy/textSearch.ts | 4 +- .../search/node/legacy/worker/searchWorker.ts | 8 +- .../fixtures/examples/NullPoinderException.js | 6 +- .../test/node/fixtures/examples/company.js | 4 +- .../test/node/fixtures/examples/small.js | 4 +- .../textfile/common/textFileEditorModel.ts | 26 +-- .../common/textFileEditorModelManager.ts | 2 +- .../textfile/common/textFileService.ts | 26 +-- .../electron-browser/textFileService.ts | 2 +- .../textfile/test/textFileService.test.ts | 2 +- .../test/textModelResolverService.test.ts | 2 +- .../themes/electron-browser/colorThemeData.ts | 2 +- .../electron-browser/colorThemeStore.ts | 4 +- .../electron-browser/workbenchThemeService.ts | 10 +- .../untitled/common/untitledEditorService.ts | 4 +- .../workspace/node/workspaceEditingService.ts | 6 +- .../workbench/test/browser/quickopen.test.ts | 2 +- .../common/editor/dataUriEditorInput.test.ts | 2 +- .../test/common/editor/editorGroups.test.ts | 18 +-- .../api/extHostConfiguration.test.ts | 2 +- .../extHostDocumentSaveParticipant.test.ts | 2 +- .../api/extHostMessagerService.test.ts | 2 +- .../api/extHostTextEditor.test.ts | 2 +- .../api/extHostTreeViews.test.ts | 6 +- .../api/mainThreadEditors.test.ts | 6 +- .../quickopen.perf.integrationTest.ts | 4 +- .../workbench/test/workbenchTestServices.ts | 44 +++--- test/assert.js | 2 +- test/smoke/src/areas/editor/peek.ts | 2 +- test/smoke/src/vscode/code.ts | 2 +- 413 files changed, 1515 insertions(+), 1515 deletions(-) diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index 2e6a939dcfa31..e9cba1cd25f40 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -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) { diff --git a/build/lib/git.ts b/build/lib/git.ts index 482c39e9af1de..dc9c667c21b22 100644 --- a/build/lib/git.ts +++ b/build/lib/git.ts @@ -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; diff --git a/build/lib/watch/index.js b/build/lib/watch/index.js index 94f73cdd4a058..0a4af2a798f86 100644 --- a/build/lib/watch/index.js +++ b/build/lib/watch/index.js @@ -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'); diff --git a/extensions/css-language-features/server/src/cssServerMain.ts b/extensions/css-language-features/server/src/cssServerMain.ts index bc65684420892..8c516fb859808 100644 --- a/extensions/css-language-features/server/src/cssServerMain.ts +++ b/extensions/css-language-features/server/src/cssServerMain.ts @@ -126,7 +126,7 @@ function getDocumentSettings(textDocument: TextDocument): Thenable(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(maxEntries: number, cleanupIntervalTime dispose() { if (typeof cleanupInterval !== 'undefined') { clearInterval(cleanupInterval); - cleanupInterval = void 0; + cleanupInterval = undefined; languageModels = {}; nModels = 0; } diff --git a/extensions/css-language-features/server/src/utils/documentContext.ts b/extensions/css-language-features/server/src/utils/documentContext.ts index 21030e801b416..9858ca8436727 100644 --- a/extensions/css-language-features/server/src/utils/documentContext.ts +++ b/extensions/css-language-features/server/src/utils/documentContext.ts @@ -19,7 +19,7 @@ export function getDocumentContext(documentUri: string, workspaceFolders: Worksp return folderURI; } } - return void 0; + return undefined; } return { diff --git a/extensions/git/src/git.ts b/extensions/git/src/git.ts index 380ee42f411a8..941e308719c32 100644 --- a/extensions/git/src/git.ts +++ b/extensions/git/src/git.ts @@ -114,17 +114,17 @@ function findGitWin32InPath(onLookup: (path: string) => void): Promise { function findGitWin32(onLookup: (path: string) => void): Promise { 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 { const first = hint ? findSpecificGit(hint, onLookup) : Promise.reject(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 }; } } diff --git a/extensions/git/src/util.ts b/extensions/git/src/util.ts index 14cbb0a65d3f9..7bf81adccd90c 100644 --- a/extensions/git/src/util.ts +++ b/extensions/git/src/util.ts @@ -69,7 +69,7 @@ export function anyEvent(...events: Event[]): Event { } export function done(promise: Promise): Promise { - return promise.then(() => void 0); + return promise.then(() => undefined); } export function onceEvent(event: Event): Event { diff --git a/extensions/html-language-features/client/src/tagClosing.ts b/extensions/html-language-features/client/src/tagClosing.ts index a74362a0d3dcc..35511e63f43d7 100644 --- a/extensions/html-language-features/client/src/tagClosing.ts +++ b/extensions/html-language-features/client/src/tagClosing.ts @@ -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(configName)) { + if (!workspace.getConfiguration(undefined, document.uri).get(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); diff --git a/extensions/html-language-features/server/src/htmlServerMain.ts b/extensions/html-language-features/server/src/htmlServerMain.ts index 0c564a164c1b4..1b32205c2e3a2 100644 --- a/extensions/html-language-features/server/src/htmlServerMain.ts +++ b/extensions/html-language-features/server/src/htmlServerMain.ts @@ -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 diff --git a/extensions/html-language-features/server/src/languageModelCache.ts b/extensions/html-language-features/server/src/languageModelCache.ts index 7ce4adca9d433..561de4a9a7afa 100644 --- a/extensions/html-language-features/server/src/languageModelCache.ts +++ b/extensions/html-language-features/server/src/languageModelCache.ts @@ -15,7 +15,7 @@ export function getLanguageModelCache(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(maxEntries: number, cleanupIntervalTime dispose() { if (typeof cleanupInterval !== 'undefined') { clearInterval(cleanupInterval); - cleanupInterval = void 0; + cleanupInterval = undefined; languageModels = {}; nModels = 0; } diff --git a/extensions/html-language-features/server/src/modes/embeddedSupport.ts b/extensions/html-language-features/server/src/modes/embeddedSupport.ts index 68fc91625d61d..6757a9e8689df 100644 --- a/extensions/html-language-features/server/src/modes/embeddedSupport.ts +++ b/extensions/html-language-features/server/src/modes/embeddedSupport.ts @@ -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!); diff --git a/extensions/html-language-features/server/src/modes/htmlFolding.ts b/extensions/html-language-features/server/src/modes/htmlFolding.ts index c228c14bdcc7f..cd33bcadf35e6 100644 --- a/extensions/html-language-features/server/src/modes/htmlFolding.ts +++ b/extensions/html-language-features/server/src/modes/htmlFolding.ts @@ -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[] = []; diff --git a/extensions/html-language-features/server/src/modes/javascriptMode.ts b/extensions/html-language-features/server/src/modes/javascriptMode.ts index fd85f8d8a7509..c4d46d3eb24c8 100644 --- a/extensions/html-language-features/server/src/modes/javascriptMode.ts +++ b/extensions/html-language-features/server/src/modes/javascriptMode.ts @@ -58,7 +58,7 @@ export function getJavaScriptMode(documentRegions: LanguageModelCache text.substring(start, end), getLength: () => text.length, - getChangeRange: () => void 0 + getChangeRange: () => undefined }; }, getCurrentDirectory: () => '', diff --git a/extensions/html-language-features/server/src/modes/languageModes.ts b/extensions/html-language-features/server/src/modes/languageModes.ts index 28f7b2a120c38..49b251b767336 100644 --- a/extensions/html-language-features/server/src/modes/languageModes.ts +++ b/extensions/html-language-features/server/src/modes/languageModes.ts @@ -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 => { diff --git a/extensions/html-language-features/server/src/test/embedded.test.ts b/extensions/html-language-features/server/src/test/embedded.test.ts index 961dc96db230f..de44dd3d80e34 100644 --- a/extensions/html-language-features/server/src/test/embedded.test.ts +++ b/extensions/html-language-features/server/src/test/embedded.test.ts @@ -89,7 +89,7 @@ suite('HTML Embedded Support', () => { assertLanguageId('', 'javascript'); assertLanguageId('', 'javascript'); assertLanguageId('', 'javascript'); - assertLanguageId('', void 0); + assertLanguageId('', undefined); assertLanguageId('', 'javascript'); }); diff --git a/extensions/html-language-features/server/src/test/folding.test.ts b/extensions/html-language-features/server/src/test/folding.test.ts index 1ca958dcdf33e..3ce2816185b75 100644 --- a/extensions/html-language-features/server/src/test/folding.test.ts +++ b/extensions/html-language-features/server/src/test/folding.test.ts @@ -200,7 +200,7 @@ suite('HTML Folding', () => { /*19*/' ', /*20*/'', ]; - 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); diff --git a/extensions/html-language-features/server/src/test/formatting.test.ts b/extensions/html-language-features/server/src/test/formatting.test.ts index 46de4b56d7cd7..702aa76da6c77 100644 --- a/extensions/html-language-features/server/src/test/formatting.test.ts +++ b/extensions/html-language-features/server/src/test/formatting.test.ts @@ -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'); }); diff --git a/extensions/html-language-features/server/src/utils/documentContext.ts b/extensions/html-language-features/server/src/utils/documentContext.ts index cd00f40358df7..bfd26d1aa8ddb 100644 --- a/extensions/html-language-features/server/src/utils/documentContext.ts +++ b/extensions/html-language-features/server/src/utils/documentContext.ts @@ -19,7 +19,7 @@ export function getDocumentContext(documentUri: string, workspaceFolders: Worksp return folderURI; } } - return void 0; + return undefined; } return { diff --git a/extensions/json-language-features/client/src/jsonMain.ts b/extensions/json-language-features/client/src/jsonMain.ts index 759ef0381cd3b..79d30295ff1d2 100644 --- a/extensions/json-language-features/client/src/jsonMain.ts +++ b/extensions/json-language-features/client/src/jsonMain.ts @@ -338,7 +338,7 @@ function getPackageInfo(context: ExtensionContext): IPackageInfo | undefined { aiKey: extensionPackage.aiKey }; } - return void 0; + return undefined; } function readJSONFile(location: string) { diff --git a/extensions/json-language-features/server/src/jsonServerMain.ts b/extensions/json-language-features/server/src/jsonServerMain.ts index 8a8ce6423318b..f7e8414293503 100644 --- a/extensions/json-language-features/server/src/jsonServerMain.ts +++ b/extensions/json-language-features/server/src/jsonServerMain.ts @@ -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 | null = null; // The settings have changed. Is send on server activation as well. diff --git a/extensions/json-language-features/server/src/languageModelCache.ts b/extensions/json-language-features/server/src/languageModelCache.ts index 7ce4adca9d433..561de4a9a7afa 100644 --- a/extensions/json-language-features/server/src/languageModelCache.ts +++ b/extensions/json-language-features/server/src/languageModelCache.ts @@ -15,7 +15,7 @@ export function getLanguageModelCache(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(maxEntries: number, cleanupIntervalTime dispose() { if (typeof cleanupInterval !== 'undefined') { clearInterval(cleanupInterval); - cleanupInterval = void 0; + cleanupInterval = undefined; languageModels = {}; nModels = 0; } diff --git a/extensions/markdown-language-features/src/commands/openDocumentLink.ts b/extensions/markdown-language-features/src/commands/openDocumentLink.ts index eed32d6efb0d4..42dfe67df25da 100644 --- a/extensions/markdown-language-features/src/commands/openDocumentLink.ts +++ b/extensions/markdown-language-features/src/commands/openDocumentLink.ts @@ -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); }); } diff --git a/extensions/npm/src/features/bowerJSONContribution.ts b/extensions/npm/src/features/bowerJSONContribution.ts index aec8fcbd44d7a..da3c49a7d71a2 100644 --- a/extensions/npm/src/features/bowerJSONContribution.ts +++ b/extensions/npm/src/features/bowerJSONContribution.ts @@ -175,9 +175,9 @@ export class BowerJSONContribution implements IJSONContribution { } catch (e) { // ignore } - return void 0; + return undefined; }, () => { - return void 0; + return undefined; }); } diff --git a/extensions/php-language-features/src/features/validationProvider.ts b/extensions/php-language-features/src/features/validationProvider.ts index 85b2bb652f914..e3db6438ce571 100644 --- a/extensions/php-language-features/src/features/validationProvider.ts +++ b/extensions/php-language-features/src/features/validationProvider.ts @@ -146,7 +146,7 @@ export default class PHPValidationProvider { } this.trigger = RunTrigger.from(section.get('validate.run', RunTrigger.strings.onSave)); } - if (this.executableIsUserDefined !== true && this.workspaceStore.get(CheckedExecutablePath, undefined) !== void 0) { + if (this.executableIsUserDefined !== true && this.workspaceStore.get(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(CheckedExecutablePath, undefined); if (!checkedExecutablePath || checkedExecutablePath !== this.executable) { vscode.window.showInformationMessage( diff --git a/extensions/typescript-language-features/src/features/bufferSyncSupport.ts b/extensions/typescript-language-features/src/features/bufferSyncSupport.ts index f84f9d31aabdf..4cf76147d167a 100644 --- a/extensions/typescript-language-features/src/features/bufferSyncSupport.ts +++ b/extensions/typescript-language-features/src/features/bufferSyncSupport.ts @@ -124,7 +124,7 @@ class PendingDiagnostics extends ResourceMap { const map = new ResourceMap(); 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); } } diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/commands.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/commands.test.ts index 2629f516aac3f..c007e2168f0a4 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/commands.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/commands.test.ts @@ -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(); }); diff --git a/src/bootstrap-window.js b/src/bootstrap-window.js index 18778b2a3127f..c41965b30ae30 100644 --- a/src/bootstrap-window.js +++ b/src/bootstrap-window.js @@ -185,7 +185,7 @@ function registerDeveloperKeybindings() { return function () { if (listener) { window.removeEventListener('keydown', listener); - listener = void 0; + listener = undefined; } }; } diff --git a/src/main.js b/src/main.js index 1d9712137541d..6b2bfae32c6f6 100644 --- a/src/main.js +++ b/src/main.js @@ -414,7 +414,7 @@ function rimraf(location) { } }, err => { if (err.code === 'ENOENT') { - return void 0; + return undefined; } throw err; }); diff --git a/src/vs/base/browser/dom.ts b/src/vs/base/browser/dom.ts index 96f48dd607636..d765620746f64 100644 --- a/src/vs/base/browser/dom.ts +++ b/src/vs/base/browser/dom.ts @@ -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); } } diff --git a/src/vs/base/browser/ui/actionbar/actionbar.ts b/src/vs/base/browser/ui/actionbar/actionbar.ts index 97a47778cdd5c..8c071f5934df1 100644 --- a/src/vs/base/browser/ui/actionbar/actionbar.ts +++ b/src/vs/base/browser/ui/actionbar/actionbar.ts @@ -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') { diff --git a/src/vs/base/browser/ui/iconLabel/iconLabel.ts b/src/vs/base/browser/ui/iconLabel/iconLabel.ts index 635e5228bf22c..be99067ee1d95 100644 --- a/src/vs/base/browser/ui/iconLabel/iconLabel.ts +++ b/src/vs/base/browser/ui/iconLabel/iconLabel.ts @@ -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 { diff --git a/src/vs/base/browser/ui/scrollbar/horizontalScrollbar.ts b/src/vs/base/browser/ui/scrollbar/horizontalScrollbar.ts index 2be752aa68dc8..1c36edb215ab5 100644 --- a/src/vs/base/browser/ui/scrollbar/horizontalScrollbar.ts +++ b/src/vs/base/browser/ui/scrollbar/horizontalScrollbar.ts @@ -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, diff --git a/src/vs/base/browser/ui/scrollbar/verticalScrollbar.ts b/src/vs/base/browser/ui/scrollbar/verticalScrollbar.ts index 9851f932bf2b6..8c1bb82823fe7 100644 --- a/src/vs/base/browser/ui/scrollbar/verticalScrollbar.ts +++ b/src/vs/base/browser/ui/scrollbar/verticalScrollbar.ts @@ -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)), diff --git a/src/vs/base/browser/ui/toolbar/toolbar.ts b/src/vs/base/browser/ui/toolbar/toolbar.ts index fc570d2848689..171b8e827c7b7 100644 --- a/src/vs/base/browser/ui/toolbar/toolbar.ts +++ b/src/vs/base/browser/ui/toolbar/toolbar.ts @@ -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; } diff --git a/src/vs/base/common/decorators.ts b/src/vs/base/common/decorators.ts index 01478d3c3ad48..e48ad1564e58a 100644 --- a/src/vs/base/common/decorators.ts +++ b/src/vs/base/common/decorators.ts @@ -71,7 +71,7 @@ export function debounce(delay: number, reducer?: IDebouceReducer, 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(delay: number, reducer?: IDebouceReducer, initial this[timerKey] = setTimeout(() => { fn.apply(this, args); - this[resultKey] = initialValueProvider ? initialValueProvider() : void 0; + this[resultKey] = initialValueProvider ? initialValueProvider() : undefined; }, delay); }; }); diff --git a/src/vs/base/common/event.ts b/src/vs/base/common/event.ts index 4fde520b56dd0..a32498be85633 100644 --- a/src/vs/base/common/event.ts +++ b/src/vs/base/common/event.ts @@ -727,7 +727,7 @@ export class EventBufferer { } else { listener.call(thisArgs, i); } - }, void 0, disposables); + }, undefined, disposables); }; } diff --git a/src/vs/base/common/htmlContent.ts b/src/vs/base/common/htmlContent.ts index 4060e867f81cd..def335d55d21b 100644 --- a/src/vs/base/common/htmlContent.ts +++ b/src/vs/base/common/htmlContent.ts @@ -58,7 +58,7 @@ export function isMarkdownString(thing: any): thing is IMarkdownString { return true; } else if (thing && typeof thing === 'object') { return typeof (thing).value === 'string' - && (typeof (thing).isTrusted === 'boolean' || (thing).isTrusted === void 0); + && (typeof (thing).isTrusted === 'boolean' || (thing).isTrusted === undefined); } return false; } diff --git a/src/vs/base/common/json.ts b/src/vs/base/common/json.ts index 9158a73fe1e7d..6a0ccd3aec1a5 100644 --- a/src/vs/base/common/json.ts +++ b/src/vs/base/common/json.ts @@ -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 = 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(); diff --git a/src/vs/base/common/jsonEdit.ts b/src/vs/base/common/jsonEdit.ts index 485d9f48b4c6e..7675ea160495a 100644 --- a/src/vs/base/common/jsonEdit.ts +++ b/src/vs/base/common/jsonEdit.ts @@ -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]; diff --git a/src/vs/base/common/labels.ts b/src/vs/base/common/labels.ts index 6c46a5a5fd33e..2bdf7cbb84042 100644 --- a/src/vs/base/common/labels.ts +++ b/src/vs/base/common/labels.ts @@ -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 }; diff --git a/src/vs/base/common/map.ts b/src/vs/base/common/map.ts index 4fd8b8ca642ff..05aed148d23fa 100644 --- a/src/vs/base/common/map.ts +++ b/src/vs/base/common/map.ts @@ -24,7 +24,7 @@ export function keys(map: Map): K[] { export function getOrSet(map: Map, 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 { this._head = current; this._size = currentSize; if (current) { - current.previous = void 0; + current.previous = undefined; } } @@ -719,8 +719,8 @@ export class LinkedMap { private removeItem(item: Item): 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 { 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 { } // 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 { 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; diff --git a/src/vs/base/common/mime.ts b/src/vs/base/common/mime.ts index ec27303ee4bbb..6d94268844482 100644 --- a/src/vs/base/common/mime.ts +++ b/src/vs/base/common/mime.ts @@ -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 }; } diff --git a/src/vs/base/common/paths.ts b/src/vs/base/common/paths.ts index 1255aed38cfaa..d96b751708247 100644 --- a/src/vs/base/common/paths.ts +++ b/src/vs/base/common/paths.ts @@ -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; } diff --git a/src/vs/base/common/performance.js b/src/vs/base/common/performance.js index 5590211c6d5bb..14c5a33e72e8d 100644 --- a/src/vs/base/common/performance.js +++ b/src/vs/base/common/performance.js @@ -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], diff --git a/src/vs/base/common/resources.ts b/src/vs/base/common/resources.ts index 05be7f7037a24..d3170eb406bf4 100644 --- a/src/vs/base/common/resources.ts +++ b/src/vs/base/common/resources.ts @@ -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; } diff --git a/src/vs/base/common/uri.ts b/src/vs/base/common/uri.ts index 21746704dfbfe..6cca3b8acb720 100644 --- a/src/vs/base/common/uri.ts +++ b/src/vs/base/common/uri.ts @@ -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; diff --git a/src/vs/base/node/console.ts b/src/vs/base/node/console.ts index 047bca70f2723..2ac39e3d70719 100644 --- a/src/vs/base/node/console.ts +++ b/src/vs/base/node/console.ts @@ -83,7 +83,7 @@ export function getFirstFrame(arg0: IRemoteConsoleLog | string | undefined): ISt } } - return void 0; + return undefined; } function findFirstFrame(stack: string | undefined): string | undefined { diff --git a/src/vs/base/node/encoding.ts b/src/vs/base/node/encoding.ts index 0f975015eb61e..5768a147fef13 100644 --- a/src/vs/base/node/encoding.ts +++ b/src/vs/base/node/encoding.ts @@ -401,7 +401,7 @@ export function resolveTerminalEncoding(verbose?: boolean): Promise { } } - return resolve(void 0); + return resolve(undefined); }); }); } diff --git a/src/vs/base/node/extfs.ts b/src/vs/base/node/extfs.ts index 9d265f5cf455c..08d2beab731c1 100644 --- a/src/vs/base/node/extfs.ts +++ b/src/vs/base/node/extfs.ts @@ -128,7 +128,7 @@ function doCopyFile(source: string, target: string, mode: number, callback: (err export function mkdirp(path: string, mode?: number, token?: CancellationToken): Promise { const mkdir = (): Promise => { - 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) { diff --git a/src/vs/base/node/pfs.ts b/src/vs/base/node/pfs.ts index 48727abe9a0bd..5c4120904f65c 100644 --- a/src/vs/base/node/pfs.ts +++ b/src/vs/base/node/pfs.ts @@ -36,7 +36,7 @@ export function rimraf(path: string): Promise { } }, (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 { if (!exists) { clearInterval(interval); - resolve(void 0); + resolve(undefined); } }); } diff --git a/src/vs/base/node/processes.ts b/src/vs/base/node/processes.ts index dbe416c83a403..36b95e0f378e1 100644 --- a/src/vs/base/node/processes.ts +++ b/src/vs/base/node/processes.ts @@ -107,7 +107,7 @@ export abstract class AbstractProcess { 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 = 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 diff --git a/src/vs/base/node/request.ts b/src/vs/base/node/request.ts index 143778dd52bad..0d8d7434f66d6 100644 --- a/src/vs/base/node/request.ts +++ b/src/vs/base/node/request.ts @@ -136,7 +136,7 @@ export function download(filePath: string, context: IRequestContext): Promise((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); }); diff --git a/src/vs/base/parts/contextmenu/electron-main/contextmenu.ts b/src/vs/base/parts/contextmenu/electron-main/contextmenu.ts index e2dea11301d41..fa5793219061a 100644 --- a/src/vs/base/parts/contextmenu/electron-main/contextmenu.ts +++ b/src/vs/base/parts/contextmenu/electron-main/contextmenu.ts @@ -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); } diff --git a/src/vs/base/parts/ipc/node/ipc.ts b/src/vs/base/parts/ipc/node/ipc.ts index 61a97a3ff5cb9..e6c84e6b9499e 100644 --- a/src/vs/base/parts/ipc/node/ipc.ts +++ b/src/vs/base/parts/ipc/node/ipc.ts @@ -309,7 +309,7 @@ export class ChannelServer implements IChannelServer { service.onMarco(({ answer }) => { try { assert.equal(answer, 'polo'); - c(void 0); + c(undefined); } catch (err) { e(err); } diff --git a/src/vs/base/parts/ipc/test/node/ipc.net.test.ts b/src/vs/base/parts/ipc/test/node/ipc.net.test.ts index 085b4728adc44..439dce11f5276 100644 --- a/src/vs/base/parts/ipc/test/node/ipc.net.test.ts +++ b/src/vs/base/parts/ipc/test/node/ipc.net.test.ts @@ -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); }); }); diff --git a/src/vs/base/parts/quickopen/browser/quickOpenModel.ts b/src/vs/base/parts/quickopen/browser/quickOpenModel.ts index 132f1207facd5..e2081d584292a 100644 --- a/src/vs/base/parts/quickopen/browser/quickOpenModel.ts +++ b/src/vs/base/parts/quickopen/browser/quickOpenModel.ts @@ -46,7 +46,7 @@ export class QuickOpenItemAccessorClass implements IItemAccessor getItemPath(entry: QuickOpenEntry): string { const resource = entry.getResource(); - return resource ? resource.fsPath : void 0; + return resource ? resource.fsPath : undefined; } } diff --git a/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts b/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts index 2e6255c31b573..8ae01d2ad6386 100644 --- a/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts +++ b/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts @@ -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) { diff --git a/src/vs/base/parts/quickopen/common/quickOpenScorer.ts b/src/vs/base/parts/quickopen/common/quickOpenScorer.ts index 5c4a56a8924ee..9abbda5ac13c6 100644 --- a/src/vs/base/parts/quickopen/common/quickOpenScorer.ts +++ b/src/vs/base/parts/quickopen/common/quickOpenScorer.ts @@ -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 diff --git a/src/vs/base/parts/tree/browser/treeDefaults.ts b/src/vs/base/parts/tree/browser/treeDefaults.ts index 5980bea0d0822..89122b80d2fb2 100644 --- a/src/vs/base/parts/tree/browser/treeDefaults.ts +++ b/src/vs/base/parts/tree/browser/treeDefaults.ts @@ -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; } diff --git a/src/vs/base/parts/tree/browser/treeModel.ts b/src/vs/base/parts/tree/browser/treeModel.ts index 9be92db0bc697..d9778a1bb5b9e 100644 --- a/src/vs/base/parts/tree/browser/treeModel.ts +++ b/src/vs/base/parts/tree/browser/treeModel.ts @@ -525,7 +525,7 @@ export class Item { }); return result - .then(void 0, onUnexpectedError) + .then(undefined, onUnexpectedError) .then(() => this._onDidRefreshChildren.fire(eventData)); }; diff --git a/src/vs/base/test/browser/dom.test.ts b/src/vs/base/test/browser/dom.test.ts index 089be6deeb87a..61252159d230e 100644 --- a/src/vs/base/test/browser/dom.test.ts +++ b/src/vs/base/test/browser/dom.test.ts @@ -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'); }); diff --git a/src/vs/base/test/browser/ui/splitview/splitview.test.ts b/src/vs/base/test/browser/ui/splitview/splitview.test.ts index 8ca22616e4178..7f25e55619da8 100644 --- a/src/vs/base/test/browser/ui/splitview/splitview.test.ts +++ b/src/vs/base/test/browser/ui/splitview/splitview.test.ts @@ -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); diff --git a/src/vs/base/test/common/arrays.test.ts b/src/vs/base/test/common/arrays.test.ts index 1226465c6129b..b999d91e2c4ff 100644 --- a/src/vs/base/test/common/arrays.test.ts +++ b/src/vs/base/test/common/arrays.test.ts @@ -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); diff --git a/src/vs/base/test/common/async.test.ts b/src/vs/base/test/common/async.test.ts index f354e5edc2285..b22a84ac046ac 100644 --- a/src/vs/base/test/common/async.test.ts +++ b/src/vs/base/test/common/async.test.ts @@ -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); diff --git a/src/vs/base/test/common/cache.test.ts b/src/vs/base/test/common/cache.test.ts index 3bb4f3dfd09c6..81b3214efe379 100644 --- a/src/vs/base/test/common/cache.test.ts +++ b/src/vs/base/test/common/cache.test.ts @@ -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); diff --git a/src/vs/base/test/common/event.test.ts b/src/vs/base/test/common/event.test.ts index b042b60fe8354..bb2618bc423b1 100644 --- a/src/vs/base/test/common/event.test.ts +++ b/src/vs/base/test/common/event.test.ts @@ -448,7 +448,7 @@ suite('Event utils', () => { e(err); } - c(void 0); + c(undefined); }); setTimeout(() => emitter.fire(), 10); diff --git a/src/vs/base/test/common/hash.test.ts b/src/vs/base/test/common/hash.test.ts index 2691c16b4440f..b8fc9de69580c 100644 --- a/src/vs/base/test/common/hash.test.ts +++ b/src/vs/base/test/common/hash.test.ts @@ -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([])); }); diff --git a/src/vs/base/test/common/jsonEdit.test.ts b/src/vs/base/test/common/jsonEdit.test.ts index a7c5978d96b81..194f246a402f9 100644 --- a/src/vs/base/test/common/jsonEdit.test.ts +++ b/src/vs/base/test/common/jsonEdit.test.ts @@ -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]'); }); diff --git a/src/vs/base/test/common/jsonFormatter.test.ts b/src/vs/base/test/common/jsonFormatter.test.ts index 2ef51e1b38338..5e037ba1755ca 100644 --- a/src/vs/base/test/common/jsonFormatter.test.ts +++ b/src/vs/base/test/common/jsonFormatter.test.ts @@ -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) { diff --git a/src/vs/base/test/common/objects.test.ts b/src/vs/base/test/common/objects.test.ts index 0ce34acb43298..37e428d8a866c 100644 --- a/src/vs/base/test/common/objects.test.ts +++ b/src/vs/base/test/common/objects.test.ts @@ -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 = { diff --git a/src/vs/base/test/common/resources.test.ts b/src/vs/base/test/common/resources.test.ts index 29d80e654f2c9..919855add12b5 100644 --- a/src/vs/base/test/common/resources.test.ts +++ b/src/vs/base/test/common/resources.test.ts @@ -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); }); }); diff --git a/src/vs/base/test/common/strings.test.ts b/src/vs/base/test/common/strings.test.ts index cee9c7a1b55f5..758bfb246d11c 100644 --- a/src/vs/base/test/common/strings.test.ts +++ b/src/vs/base/test/common/strings.test.ts @@ -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')); diff --git a/src/vs/base/test/node/extfs/fixtures/examples/company.jxs b/src/vs/base/test/node/extfs/fixtures/examples/company.jxs index ca4a62bf248b6..b65b52ade6906 100644 --- a/src/vs/base/test/node/extfs/fixtures/examples/company.jxs +++ b/src/vs/base/test/node/extfs/fixtures/examples/company.jxs @@ -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(); { diff --git a/src/vs/base/test/node/extfs/fixtures/examples/conway.jxs b/src/vs/base/test/node/extfs/fixtures/examples/conway.jxs index 306c906ce6f2c..248f26be20538 100644 --- a/src/vs/base/test/node/extfs/fixtures/examples/conway.jxs +++ b/src/vs/base/test/node/extfs/fixtures/examples/conway.jxs @@ -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() { diff --git a/src/vs/base/test/node/extfs/fixtures/examples/small.jxs b/src/vs/base/test/node/extfs/fixtures/examples/small.jxs index 5e57b4c9439a3..2fb478319a52c 100644 --- a/src/vs/base/test/node/extfs/fixtures/examples/small.jxs +++ b/src/vs/base/test/node/extfs/fixtures/examples/small.jxs @@ -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) { diff --git a/src/vs/base/test/node/pfs.test.ts b/src/vs/base/test/node/pfs.test.ts index 172ef642d5d82..6c107274a7d2a 100644 --- a/src/vs/base/test/node/pfs.test.ts +++ b/src/vs/base/test/node/pfs.test.ts @@ -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'); diff --git a/src/vs/base/test/node/port.test.ts b/src/vs/base/test/node/port.test.ts index 3b4453fba442a..87d8eca9ebfe6 100644 --- a/src/vs/base/test/node/port.test.ts +++ b/src/vs/base/test/node/port.test.ts @@ -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 => { diff --git a/src/vs/base/test/node/storage/storage.test.ts b/src/vs/base/test/node/storage/storage.test.ts index f8f7cd58dfaa6..847fc67ad9686 100644 --- a/src/vs/base/test/node/storage/storage.test.ts +++ b/src/vs/base/test/node/storage/storage.test.ts @@ -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); diff --git a/src/vs/code/electron-browser/sharedProcess/contrib/languagePackCachedDataCleaner.ts b/src/vs/code/electron-browser/sharedProcess/contrib/languagePackCachedDataCleaner.ts index 2da898399abaf..1271ff2866f4f 100644 --- a/src/vs/code/electron-browser/sharedProcess/contrib/languagePackCachedDataCleaner.ts +++ b/src/vs/code/electron-browser/sharedProcess/contrib/languagePackCachedDataCleaner.ts @@ -103,7 +103,7 @@ export class LanguagePackCachedDataCleaner { this._disposables.push({ dispose() { - if (handle !== void 0) { + if (handle !== undefined) { clearTimeout(handle); } } diff --git a/src/vs/code/electron-browser/sharedProcess/contrib/logsDataCleaner.ts b/src/vs/code/electron-browser/sharedProcess/contrib/logsDataCleaner.ts index 2cf74b7bfa020..7b88cb167e67d 100644 --- a/src/vs/code/electron-browser/sharedProcess/contrib/logsDataCleaner.ts +++ b/src/vs/code/electron-browser/sharedProcess/contrib/logsDataCleaner.ts @@ -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); diff --git a/src/vs/code/electron-browser/sharedProcess/contrib/storageDataCleaner.ts b/src/vs/code/electron-browser/sharedProcess/contrib/storageDataCleaner.ts index 1328e4edb8d30..bc6396b9db595 100644 --- a/src/vs/code/electron-browser/sharedProcess/contrib/storageDataCleaner.ts +++ b/src/vs/code/electron-browser/sharedProcess/contrib/storageDataCleaner.ts @@ -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 diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index a496a5505beb1..bdcb1ff26c7bf 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -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(() => { diff --git a/src/vs/code/electron-main/main.ts b/src/vs/code/electron-main/main.ts index 2165dcc944fbb..df2b83a177e93 100644 --- a/src/vs/code/electron-main/main.ts +++ b/src/vs/code/electron-main/main.ts @@ -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 diff --git a/src/vs/code/electron-main/sharedProcess.ts b/src/vs/code/electron-main/sharedProcess.ts index 0c939fbdddd2e..441277600e284 100644 --- a/src/vs/code/electron-main/sharedProcess.ts +++ b/src/vs/code/electron-main/sharedProcess.ts @@ -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)); }); }); } diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts index d018472775746..b6ca73f6b9cd0 100644 --- a/src/vs/code/electron-main/window.ts +++ b/src/vs/code/electron-main/window.ts @@ -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 }; }); diff --git a/src/vs/code/electron-main/windows.ts b/src/vs/code/electron-main/windows.ts index 7769bea62500f..0a6142a3435a6 100644 --- a/src/vs/code/electron-main/windows.ts +++ b/src/vs/code/electron-main/windows.ts @@ -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 { 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; } } diff --git a/src/vs/code/node/cli.ts b/src/vs/code/node/cli.ts index fdf5f292fe1de..23e859420ae2e 100644 --- a/src/vs/code/node/cli.ts +++ b/src/vs/code/node/cli.ts @@ -206,14 +206,14 @@ export async function main(argv: string[]): Promise { 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 { return new Promise(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); diff --git a/src/vs/code/node/cliProcessMain.ts b/src/vs/code/node/cliProcessMain.ts index 4c33ff46c8376..2d4860f656eee 100644 --- a/src/vs/code/node/cliProcessMain.ts +++ b/src/vs/code/node/cliProcessMain.ts @@ -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]; } diff --git a/src/vs/code/node/paths.ts b/src/vs/code/node/paths.ts index f322145cbac6a..678b91022ae29 100644 --- a/src/vs/code/node/paths.ts +++ b/src/vs/code/node/paths.ts @@ -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 }; } diff --git a/src/vs/editor/browser/controller/mouseTarget.ts b/src/vs/editor/browser/controller/mouseTarget.ts index 5129952e837de..3fa9c88ab279d 100644 --- a/src/vs/editor/browser/controller/mouseTarget.ts +++ b/src/vs/editor/browser/controller/mouseTarget.ts @@ -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); diff --git a/src/vs/editor/browser/services/codeEditorServiceImpl.ts b/src/vs/editor/browser/services/codeEditorServiceImpl.ts index a4cccb9e658a8..36dd7415722d6 100644 --- a/src/vs/editor/browser/services/codeEditorServiceImpl.ts +++ b/src/vs/editor/browser/services/codeEditorServiceImpl.ts @@ -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); diff --git a/src/vs/editor/browser/view/viewOutgoingEvents.ts b/src/vs/editor/browser/view/viewOutgoingEvents.ts index e95fd142a9e39..9c8c23470ad30 100644 --- a/src/vs/editor/browser/view/viewOutgoingEvents.ts +++ b/src/vs/editor/browser/view/viewOutgoingEvents.ts @@ -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); } } diff --git a/src/vs/editor/browser/widget/codeEditorWidget.ts b/src/vs/editor/browser/widget/codeEditorWidget.ts index 3f9069edce81f..b24e2563341b3 100644 --- a/src/vs/editor/browser/widget/codeEditorWidget.ts +++ b/src/vs/editor/browser/widget/codeEditorWidget.ts @@ -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); })); } diff --git a/src/vs/editor/common/controller/cursor.ts b/src/vs/editor/common/controller/cursor.ts index c79a039360c8c..195f9d8db3a7a 100644 --- a/src/vs/editor/common/controller/cursor.ts +++ b/src/vs/editor/common/controller/cursor.ts @@ -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; } diff --git a/src/vs/editor/common/editorAction.ts b/src/vs/editor/common/editorAction.ts index c1e4fb1e68e71..be4fec789a1d1 100644 --- a/src/vs/editor/common/editorAction.ts +++ b/src/vs/editor/common/editorAction.ts @@ -38,10 +38,10 @@ export class InternalEditorAction implements IEditorAction { public run(): Promise { 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); } } diff --git a/src/vs/editor/common/modes/modesRegistry.ts b/src/vs/editor/common/modes/modesRegistry.ts index 21b81b383ec33..ea7a8f05d1a27 100644 --- a/src/vs/editor/common/modes/modesRegistry.ts +++ b/src/vs/editor/common/modes/modesRegistry.ts @@ -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 ([]).concat(this._languages).concat(this._dynamicLanguages); diff --git a/src/vs/editor/common/services/editorWorkerServiceImpl.ts b/src/vs/editor/common/services/editorWorkerServiceImpl.ts index 65ed68d323e2a..1339cfffb487a 100644 --- a/src/vs/editor/common/services/editorWorkerServiceImpl.ts +++ b/src/vs/editor/common/services/editorWorkerServiceImpl.ts @@ -361,7 +361,7 @@ export class EditorWorkerClient extends Disposable { } protected _getProxy(): Promise { - 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(); diff --git a/src/vs/editor/common/services/resourceConfigurationImpl.ts b/src/vs/editor/common/services/resourceConfigurationImpl.ts index 6cd3f5fdb269d..e5ef124aa434a 100644 --- a/src/vs/editor/common/services/resourceConfigurationImpl.ts +++ b/src/vs/editor/common/services/resourceConfigurationImpl.ts @@ -38,7 +38,7 @@ export class TextResourceConfigurationService extends Disposable implements ITex } private _getValue(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({ resource, overrideIdentifier: language }); } diff --git a/src/vs/editor/common/view/minimapCharRenderer.ts b/src/vs/editor/common/view/minimapCharRenderer.ts index 9df6019705085..adae1644741ea 100644 --- a/src/vs/editor/common/view/minimapCharRenderer.ts +++ b/src/vs/editor/common/view/minimapCharRenderer.ts @@ -46,7 +46,7 @@ export class MinimapTokensColorTracker { } let backgroundLuminosity = colorMap[ColorId.DefaultBackground].getRelativeLuminance(); this._backgroundIsLight = (backgroundLuminosity >= 0.5); - this._onDidChange.fire(void 0); + this._onDidChange.fire(undefined); } public getColor(colorId: ColorId): RGBA8 { diff --git a/src/vs/editor/contrib/codeAction/test/codeActionModel.test.ts b/src/vs/editor/contrib/codeAction/test/codeActionModel.test.ts index db0f7b5d65650..98b9de1f31763 100644 --- a/src/vs/editor/contrib/codeAction/test/codeActionModel.test.ts +++ b/src/vs/editor/contrib/codeAction/test/codeActionModel.test.ts @@ -130,7 +130,7 @@ suite('CodeAction', () => { assert.deepEqual(e.position, { lineNumber: 3, column: 1 }); oracle.dispose(); - resolve(void 0); + resolve(undefined); }, 5); editor.setSelection({ startLineNumber: 1, startColumn: 1, endLineNumber: 4, endColumn: 1 }); diff --git a/src/vs/editor/contrib/codelens/codelensController.ts b/src/vs/editor/contrib/codelens/codelensController.ts index c75eb2498c589..5cda01790a397 100644 --- a/src/vs/editor/contrib/codelens/codelensController.ts +++ b/src/vs/editor/contrib/codelens/codelensController.ts @@ -176,7 +176,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { scrollState.restore(this._editor); } else { // No accessors available - this._disposeAllLenses(void 0, void 0); + this._disposeAllLenses(undefined, undefined); } })); this._localToDispose.push(this._editor.onDidChangeConfiguration(e => { @@ -315,7 +315,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { }); } resolvedSymbols[i] = request.symbol; - return Promise.resolve(void 0); + return Promise.resolve(undefined); }); return Promise.all(promises).then(() => { diff --git a/src/vs/editor/contrib/documentSymbols/outlineModel.ts b/src/vs/editor/contrib/documentSymbols/outlineModel.ts index 2e58a1967244b..8692ff8c96033 100644 --- a/src/vs/editor/contrib/documentSymbols/outlineModel.ts +++ b/src/vs/editor/contrib/documentSymbols/outlineModel.ts @@ -36,13 +36,13 @@ export abstract class TreeElement { candidateId = `${container.id}/${candidate}`; } else { candidateId = `${container.id}/${candidate.name}`; - if (container.children[candidateId] !== void 0) { + if (container.children[candidateId] !== undefined) { candidateId = `${container.id}/${candidate.name}_${candidate.range.startLineNumber}_${candidate.range.startColumn}`; } } let id = candidateId; - for (let i = 0; container.children[id] !== void 0; i++) { + for (let i = 0; container.children[id] !== undefined; i++) { id = `${candidateId}_${i}`; } diff --git a/src/vs/editor/contrib/find/findWidget.ts b/src/vs/editor/contrib/find/findWidget.ts index cb3b9273f73a6..bda8474369d14 100644 --- a/src/vs/editor/contrib/find/findWidget.ts +++ b/src/vs/editor/contrib/find/findWidget.ts @@ -643,13 +643,13 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas private _onFindInputKeyDown(e: IKeyboardEvent): void { if (e.equals(KeyCode.Enter)) { - this._codeEditor.getAction(FIND_IDS.NextMatchFindAction).run().then(void 0, onUnexpectedError); + this._codeEditor.getAction(FIND_IDS.NextMatchFindAction).run().then(undefined, onUnexpectedError); e.preventDefault(); return; } if (e.equals(KeyMod.Shift | KeyCode.Enter)) { - this._codeEditor.getAction(FIND_IDS.PreviousMatchFindAction).run().then(void 0, onUnexpectedError); + this._codeEditor.getAction(FIND_IDS.PreviousMatchFindAction).run().then(undefined, onUnexpectedError); e.preventDefault(); return; } @@ -789,7 +789,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas label: NLS_PREVIOUS_MATCH_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.PreviousMatchFindAction), className: 'previous', onTrigger: () => { - this._codeEditor.getAction(FIND_IDS.PreviousMatchFindAction).run().then(void 0, onUnexpectedError); + this._codeEditor.getAction(FIND_IDS.PreviousMatchFindAction).run().then(undefined, onUnexpectedError); } })); @@ -798,7 +798,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas label: NLS_NEXT_MATCH_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.NextMatchFindAction), className: 'next', onTrigger: () => { - this._codeEditor.getAction(FIND_IDS.NextMatchFindAction).run().then(void 0, onUnexpectedError); + this._codeEditor.getAction(FIND_IDS.NextMatchFindAction).run().then(undefined, onUnexpectedError); } })); @@ -861,7 +861,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas let replaceInput = document.createElement('div'); replaceInput.className = 'replace-input'; replaceInput.style.width = REPLACE_INPUT_AREA_WIDTH + 'px'; - this._replaceInputBox = this._register(new ContextScopedHistoryInputBox(replaceInput, void 0, { + this._replaceInputBox = this._register(new ContextScopedHistoryInputBox(replaceInput, undefined, { ariaLabel: NLS_REPLACE_INPUT_LABEL, placeholder: NLS_REPLACE_INPUT_PLACEHOLDER, history: [] diff --git a/src/vs/editor/contrib/find/test/findController.test.ts b/src/vs/editor/contrib/find/test/findController.test.ts index e659e4d596890..41b06546a593a 100644 --- a/src/vs/editor/contrib/find/test/findController.test.ts +++ b/src/vs/editor/contrib/find/test/findController.test.ts @@ -67,7 +67,7 @@ suite('FindController', () => { getBoolean: (key: string) => !!queryState[key], getInteger: (key: string) => undefined, store: (key: string, value: any) => { queryState[key] = value; return Promise.resolve(); }, - remove: (key) => void 0 + remove: (key) => undefined } as any); if (platform.isMacintosh) { @@ -442,7 +442,7 @@ suite('FindController query options persistence', () => { getBoolean: (key: string) => !!queryState[key], getInteger: (key: string) => undefined, store: (key: string, value: any) => { queryState[key] = value; return Promise.resolve(); }, - remove: (key) => void 0 + remove: (key) => undefined } as any); test('matchCase', () => { diff --git a/src/vs/editor/contrib/folding/folding.ts b/src/vs/editor/contrib/folding/folding.ts index 698296e20c7d4..d06e204813ec7 100644 --- a/src/vs/editor/contrib/folding/folding.ts +++ b/src/vs/editor/contrib/folding/folding.ts @@ -136,10 +136,10 @@ export class FoldingController implements IEditorContribution { } if (this.foldingModel) { // disposed ? let collapsedRegions = this.foldingModel.isInitialized ? this.foldingModel.getMemento() : this.hiddenRangeModel!.getMemento(); - let provider = this.rangeProvider ? this.rangeProvider.id : void 0; + let provider = this.rangeProvider ? this.rangeProvider.id : undefined; return { collapsedRegions, lineCount: model.getLineCount(), provider }; } - return void 0; + return undefined; } /** diff --git a/src/vs/editor/contrib/folding/foldingModel.ts b/src/vs/editor/contrib/folding/foldingModel.ts index 90b333216362f..56bc6c8c91482 100644 --- a/src/vs/editor/contrib/folding/foldingModel.ts +++ b/src/vs/editor/contrib/folding/foldingModel.ts @@ -153,7 +153,7 @@ export class FoldingModel { if (collapsedRanges.length > 0) { return collapsedRanges; } - return void 0; + return undefined; } /** diff --git a/src/vs/editor/contrib/folding/foldingRanges.ts b/src/vs/editor/contrib/folding/foldingRanges.ts index d540f57df780f..bdd2558322ddd 100644 --- a/src/vs/editor/contrib/folding/foldingRanges.ts +++ b/src/vs/editor/contrib/folding/foldingRanges.ts @@ -68,7 +68,7 @@ export class FoldingRegions { } public getType(index: number): string | undefined { - return this._types ? this._types[index] : void 0; + return this._types ? this._types[index] : undefined; } public hasTypes() { diff --git a/src/vs/editor/contrib/folding/indentRangeProvider.ts b/src/vs/editor/contrib/folding/indentRangeProvider.ts index 886dcbb6bab61..894482f017d80 100644 --- a/src/vs/editor/contrib/folding/indentRangeProvider.ts +++ b/src/vs/editor/contrib/folding/indentRangeProvider.ts @@ -113,7 +113,7 @@ export function computeRanges(model: ITextModel, offSide: boolean, markers?: Fol const tabSize = model.getOptions().tabSize; let result = new RangesCollector(foldingRangesLimit); - let pattern: RegExp | undefined = void 0; + let pattern: RegExp | undefined = undefined; if (markers) { pattern = new RegExp(`(${markers.start.source})|(?:${markers.end.source})`); } diff --git a/src/vs/editor/contrib/folding/intializingRangeProvider.ts b/src/vs/editor/contrib/folding/intializingRangeProvider.ts index a783ffa97552b..35e4703a8537f 100644 --- a/src/vs/editor/contrib/folding/intializingRangeProvider.ts +++ b/src/vs/editor/contrib/folding/intializingRangeProvider.ts @@ -40,11 +40,11 @@ export class InitializingRangeProvider implements RangeProvider { dispose(): void { if (this.decorationIds) { this.editorModel.deltaDecorations(this.decorationIds, []); - this.decorationIds = void 0; + this.decorationIds = undefined; } if (typeof this.timeout === 'number') { clearTimeout(this.timeout); - this.timeout = void 0; + this.timeout = undefined; } } diff --git a/src/vs/editor/contrib/folding/syntaxRangeProvider.ts b/src/vs/editor/contrib/folding/syntaxRangeProvider.ts index fe12f1b7887f7..745d38964038b 100644 --- a/src/vs/editor/contrib/folding/syntaxRangeProvider.ts +++ b/src/vs/editor/contrib/folding/syntaxRangeProvider.ts @@ -155,7 +155,7 @@ export function sanitizeRanges(rangeData: IFoldingRangeData[], limit: number): F }); let collector = new RangesCollector(limit); - let top: IFoldingRangeData | undefined = void 0; + let top: IFoldingRangeData | undefined = undefined; let previous: IFoldingRangeData[] = []; for (let entry of sorted) { if (!top) { diff --git a/src/vs/editor/contrib/folding/test/foldingModel.test.ts b/src/vs/editor/contrib/folding/test/foldingModel.test.ts index fae51d077efc3..00bc4241abc4f 100644 --- a/src/vs/editor/contrib/folding/test/foldingModel.test.ts +++ b/src/vs/editor/contrib/folding/test/foldingModel.test.ts @@ -96,7 +96,7 @@ suite('Folding Model', () => { try { let foldingModel = new FoldingModel(textModel, new TestDecorationProvider(textModel)); - let ranges = computeRanges(textModel, false, void 0); + let ranges = computeRanges(textModel, false, undefined); foldingModel.update(ranges); let r1 = r(1, 3, false); @@ -135,7 +135,7 @@ suite('Folding Model', () => { try { let foldingModel = new FoldingModel(textModel, new TestDecorationProvider(textModel)); - let ranges = computeRanges(textModel, false, void 0); + let ranges = computeRanges(textModel, false, undefined); foldingModel.update(ranges); let r1 = r(1, 3, false); @@ -181,7 +181,7 @@ suite('Folding Model', () => { try { let foldingModel = new FoldingModel(textModel, new TestDecorationProvider(textModel)); - let ranges = computeRanges(textModel, false, void 0); + let ranges = computeRanges(textModel, false, undefined); foldingModel.update(ranges); let r1 = r(1, 3, false); @@ -193,7 +193,7 @@ suite('Folding Model', () => { textModel.applyEdits([EditOperation.insert(new Position(4, 1), '//hello\n')]); - foldingModel.update(computeRanges(textModel, false, void 0)); + foldingModel.update(computeRanges(textModel, false, undefined)); assertRanges(foldingModel, [r(1, 3, true), r(5, 8, false), r(6, 7, true)]); } finally { @@ -221,7 +221,7 @@ suite('Folding Model', () => { try { let foldingModel = new FoldingModel(textModel, new TestDecorationProvider(textModel)); - let ranges = computeRanges(textModel, false, void 0); + let ranges = computeRanges(textModel, false, undefined); foldingModel.update(ranges); let r1 = r(1, 12, false); @@ -235,7 +235,7 @@ suite('Folding Model', () => { textModel.applyEdits([EditOperation.delete(new Range(6, 11, 9, 0))]); - foldingModel.update(computeRanges(textModel, false, void 0)); + foldingModel.update(computeRanges(textModel, false, undefined)); assertRanges(foldingModel, [r(1, 9, false), r(2, 8, false), r(3, 5, false), r(6, 8, false)]); } finally { @@ -258,7 +258,7 @@ suite('Folding Model', () => { try { let foldingModel = new FoldingModel(textModel, new TestDecorationProvider(textModel)); - let ranges = computeRanges(textModel, false, void 0); + let ranges = computeRanges(textModel, false, undefined); foldingModel.update(ranges); let r1 = r(1, 3, false); diff --git a/src/vs/editor/contrib/folding/test/hiddenRangeModel.test.ts b/src/vs/editor/contrib/folding/test/hiddenRangeModel.test.ts index 5c33929fa2d83..18fa5acd3fe8d 100644 --- a/src/vs/editor/contrib/folding/test/hiddenRangeModel.test.ts +++ b/src/vs/editor/contrib/folding/test/hiddenRangeModel.test.ts @@ -44,7 +44,7 @@ suite('Hidden Range Model', () => { assert.equal(hiddenRangeModel.hasRanges(), false); - let ranges = computeRanges(textModel, false, void 0); + let ranges = computeRanges(textModel, false, undefined); foldingModel.update(ranges); foldingModel.toggleCollapseState([foldingModel.getRegionAtLine(1)!, foldingModel.getRegionAtLine(6)!]); diff --git a/src/vs/editor/contrib/goToDefinition/goToDefinitionCommands.ts b/src/vs/editor/contrib/goToDefinition/goToDefinitionCommands.ts index 305635d8524e5..62e7ebb3e090c 100644 --- a/src/vs/editor/contrib/goToDefinition/goToDefinitionCommands.ts +++ b/src/vs/editor/contrib/goToDefinition/goToDefinitionCommands.ts @@ -232,7 +232,7 @@ export class PeekDefinitionAction extends DefinitionAction { static readonly id = 'editor.action.peekDefinition'; constructor() { - super(new DefinitionActionConfig(void 0, true, false), { + super(new DefinitionActionConfig(undefined, true, false), { id: PeekDefinitionAction.id, label: nls.localize('actions.previewDecl.label', "Peek Definition"), alias: 'Peek Definition', @@ -304,7 +304,7 @@ export class GoToDeclarationAction extends DeclarationAction { export class PeekDeclarationAction extends DeclarationAction { constructor() { - super(new DefinitionActionConfig(void 0, true, false), { + super(new DefinitionActionConfig(undefined, true, false), { id: 'editor.action.peekDeclaration', label: nls.localize('actions.peekDecl.label', "Peek Declaration"), alias: 'Peek Declaration', diff --git a/src/vs/editor/contrib/gotoError/gotoError.ts b/src/vs/editor/contrib/gotoError/gotoError.ts index 58cda9b9d4ffb..997d3ab7607d1 100644 --- a/src/vs/editor/contrib/gotoError/gotoError.ts +++ b/src/vs/editor/contrib/gotoError/gotoError.ts @@ -326,24 +326,24 @@ class MarkerNavigationAction extends EditorAction { const editorService = accessor.get(ICodeEditorService); const controller = MarkerController.get(editor); if (!controller) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } const model = controller.getOrCreateModel(); const atEdge = model.move(this._isNext, !this._multiFile); if (!atEdge || !this._multiFile) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } // try with the next/prev file let markers = markerService.read({ severities: MarkerSeverity.Error | MarkerSeverity.Warning | MarkerSeverity.Info }).sort(MarkerNavigationAction.compareMarker); if (markers.length === 0) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } let editorModel = editor.getModel(); if (!editorModel) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } let oldMarker = model.currentMarker || { resource: editorModel!.uri, severity: MarkerSeverity.Error, startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 1 }; @@ -363,7 +363,7 @@ class MarkerNavigationAction extends EditorAction { // the next `resource` is this resource which // means we cycle within this file model.move(this._isNext, true); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } // close the widget for this editor-instance, open the resource diff --git a/src/vs/editor/contrib/inPlaceReplace/inPlaceReplace.ts b/src/vs/editor/contrib/inPlaceReplace/inPlaceReplace.ts index 2ef007b748406..195d83b849c3c 100644 --- a/src/vs/editor/contrib/inPlaceReplace/inPlaceReplace.ts +++ b/src/vs/editor/contrib/inPlaceReplace/inPlaceReplace.ts @@ -76,7 +76,7 @@ class InPlaceReplaceController implements IEditorContribution { const state = new EditorState(this.editor, CodeEditorStateFlag.Value | CodeEditorStateFlag.Position); const modelURI = model.uri; if (!this.editorWorkerService.canNavigateValueSet(modelURI)) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } this.currentRequest = createCancelablePromise(token => this.editorWorkerService.navigateValueSet(modelURI, selection!, up)); @@ -152,7 +152,7 @@ class InPlaceReplaceUp extends EditorAction { public run(accessor: ServicesAccessor, editor: ICodeEditor): Promise | undefined { const controller = InPlaceReplaceController.get(editor); if (!controller) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } return controller.run(this.id, true); } @@ -177,7 +177,7 @@ class InPlaceReplaceDown extends EditorAction { public run(accessor: ServicesAccessor, editor: ICodeEditor): Promise | undefined { const controller = InPlaceReplaceController.get(editor); if (!controller) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } return controller.run(this.id, false); } diff --git a/src/vs/editor/contrib/multicursor/test/multicursor.test.ts b/src/vs/editor/contrib/multicursor/test/multicursor.test.ts index 5629cc79a002a..c26d0b0fd584d 100644 --- a/src/vs/editor/contrib/multicursor/test/multicursor.test.ts +++ b/src/vs/editor/contrib/multicursor/test/multicursor.test.ts @@ -67,7 +67,7 @@ suite('Multicursor selection', () => { getBoolean: (key: string) => !!queryState[key], getInteger: (key: string) => undefined!, store: (key: string, value: any) => { queryState[key] = value; return Promise.resolve(); }, - remove: (key) => void 0 + remove: (key) => undefined } as IStorageService); test('issue #8817: Cursor position changes when you cancel multicursor', () => { diff --git a/src/vs/editor/contrib/referenceSearch/referencesWidget.ts b/src/vs/editor/contrib/referenceSearch/referencesWidget.ts index affb6a2eb52ad..4298222736a66 100644 --- a/src/vs/editor/contrib/referenceSearch/referencesWidget.ts +++ b/src/vs/editor/contrib/referenceSearch/referencesWidget.ts @@ -462,7 +462,7 @@ export class ReferenceWidget extends PeekViewWidget { this.setTitle(''); this._messageContainer.innerHTML = nls.localize('noResults', "No results"); dom.show(this._messageContainer); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } dom.hide(this._messageContainer); diff --git a/src/vs/editor/contrib/smartSelect/smartSelect.ts b/src/vs/editor/contrib/smartSelect/smartSelect.ts index dba9b52f7b0ab..73878ae4990f2 100644 --- a/src/vs/editor/contrib/smartSelect/smartSelect.ts +++ b/src/vs/editor/contrib/smartSelect/smartSelect.ts @@ -81,7 +81,7 @@ class SmartSelectController implements IEditorContribution { } - let promise: Promise = Promise.resolve(void 0); + let promise: Promise = Promise.resolve(undefined); if (!this._state) { promise = provideSelectionRanges(model, selection.getPosition(), CancellationToken.None).then(ranges => { diff --git a/src/vs/editor/contrib/snippet/snippetVariables.ts b/src/vs/editor/contrib/snippet/snippetVariables.ts index 92b27d62f6057..9545c299890bd 100644 --- a/src/vs/editor/contrib/snippet/snippetVariables.ts +++ b/src/vs/editor/contrib/snippet/snippetVariables.ts @@ -49,7 +49,7 @@ export class CompositeSnippetVariableResolver implements VariableResolver { resolve(variable: Variable): string | undefined { for (const delegate of this._delegates) { let value = delegate.resolve(variable); - if (value !== void 0) { + if (value !== undefined) { return value; } } diff --git a/src/vs/editor/standalone/browser/quickOpen/quickCommand.ts b/src/vs/editor/standalone/browser/quickOpen/quickCommand.ts index 61834bf62e530..dde2443923b7d 100644 --- a/src/vs/editor/standalone/browser/quickOpen/quickCommand.ts +++ b/src/vs/editor/standalone/browser/quickOpen/quickCommand.ts @@ -61,7 +61,7 @@ export class EditorActionCommandEntry extends QuickOpenEntryGroup { try { let promise = this.action.run() || Promise.resolve(); - promise.then(void 0, onUnexpectedError); + promise.then(undefined, onUnexpectedError); } catch (error) { onUnexpectedError(error); } diff --git a/src/vs/editor/standalone/browser/simpleServices.ts b/src/vs/editor/standalone/browser/simpleServices.ts index 84cc477a801d0..8e007e8133bed 100644 --- a/src/vs/editor/standalone/browser/simpleServices.ts +++ b/src/vs/editor/standalone/browser/simpleServices.ts @@ -146,7 +146,7 @@ export class SimpleProgressService implements IProgressService { } showWhile(promise: Promise, delay?: number): Promise { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -408,7 +408,7 @@ export class SimpleConfigurationService implements IConfigurationService { getValue(overrides: IConfigurationOverrides): T; getValue(section: string, overrides: IConfigurationOverrides): T; getValue(arg1?: any, arg2?: any): any { - const section = typeof arg1 === 'string' ? arg1 : void 0; + const section = typeof arg1 === 'string' ? arg1 : undefined; const overrides = isConfigurationOverrides(arg1) ? arg1 : isConfigurationOverrides(arg2) ? arg2 : {}; return this.configuration().getValue(section, overrides, null); } @@ -433,7 +433,7 @@ export class SimpleConfigurationService implements IConfigurationService { } public reloadConfiguration(): Promise { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } public getConfigurationData(): IConfigurationData | null { @@ -458,7 +458,7 @@ export class SimpleResourceConfigurationService implements ITextResourceConfigur getValue(resource: URI, position?: IPosition, section?: string): T; getValue(resource: any, arg2?: any, arg3?: any) { const position: IPosition | null = Pos.isIPosition(arg2) ? arg2 : null; - const section: string | undefined = position ? (typeof arg3 === 'string' ? arg3 : void 0) : (typeof arg2 === 'string' ? arg2 : void 0); + const section: string | undefined = position ? (typeof arg3 === 'string' ? arg3 : undefined) : (typeof arg2 === 'string' ? arg2 : undefined); if (typeof section === 'undefined') { return this.configurationService.getValue(); } @@ -492,7 +492,7 @@ export class StandaloneTelemetryService implements ITelemetryService { public isOptedIn = false; public publicLog(eventName: string, data?: any): Promise { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } public getTelemetryInfo(): Promise { diff --git a/src/vs/loader.js b/src/vs/loader.js index 2bf7fe37d7583..50f91caa43ee7 100644 --- a/src/vs/loader.js +++ b/src/vs/loader.js @@ -179,7 +179,7 @@ var AMDLoader; }; Utilities.forEachProperty = function (obj, callback) { if (obj) { - var key = void 0; + var key = undefined; for (key in obj) { if (obj.hasOwnProperty(key)) { callback(key, obj[key]); @@ -327,8 +327,8 @@ var AMDLoader; return options; }; ConfigurationOptionsUtil.mergeConfigurationOptions = function (overwrite, base) { - if (overwrite === void 0) { overwrite = null; } - if (base === void 0) { base = null; } + if (overwrite === undefined) { overwrite = null; } + if (base === undefined) { base = null; } var result = AMDLoader.Utilities.recursiveClone(base || {}); // Merge known properties and overwrite the unknown ones AMDLoader.Utilities.forEachProperty(overwrite, function (key, value) { @@ -1067,7 +1067,7 @@ var AMDLoader; AMDLoader.PluginDependency = PluginDependency; var ModuleManager = (function () { function ModuleManager(env, scriptLoader, defineFunc, requireFunc, loaderAvailableTimestamp) { - if (loaderAvailableTimestamp === void 0) { loaderAvailableTimestamp = 0; } + if (loaderAvailableTimestamp === undefined) { loaderAvailableTimestamp = 0; } this._env = env; this._scriptLoader = scriptLoader; this._loaderAvailableTimestamp = loaderAvailableTimestamp; @@ -1186,7 +1186,7 @@ var AMDLoader; */ ModuleManager.prototype.defineModule = function (strModuleId, dependencies, callback, errorback, stack, moduleIdResolver) { var _this = this; - if (moduleIdResolver === void 0) { moduleIdResolver = new ModuleIdResolver(strModuleId); } + if (moduleIdResolver === undefined) { moduleIdResolver = new ModuleIdResolver(strModuleId); } var moduleId = this._moduleIdProvider.getModuleId(strModuleId); if (this._modules2[moduleId]) { if (!this._config.isDuplicateMessageIgnoredFor(strModuleId)) { @@ -1245,7 +1245,7 @@ var AMDLoader; * @return The exports of module 'id' */ ModuleManager.prototype.synchronousRequire = function (_strModuleId, moduleIdResolver) { - if (moduleIdResolver === void 0) { moduleIdResolver = new ModuleIdResolver(_strModuleId); } + if (moduleIdResolver === undefined) { moduleIdResolver = new ModuleIdResolver(_strModuleId); } var dependency = this._normalizeDependency(_strModuleId, moduleIdResolver); var m = this._modules2[dependency.id]; if (!m) { @@ -1637,7 +1637,7 @@ var AMDLoader; jQuery: true }; var _requireFunc_config = function (params, shouldOverwrite) { - if (shouldOverwrite === void 0) { shouldOverwrite = false; } + if (shouldOverwrite === undefined) { shouldOverwrite = false; } moduleManager.configure(params, shouldOverwrite); }; var RequireFunc = function () { diff --git a/src/vs/nls.build.js b/src/vs/nls.build.js index 37077e8c32f8d..cccc15f70490d 100644 --- a/src/vs/nls.build.js +++ b/src/vs/nls.build.js @@ -79,7 +79,7 @@ var NLSBuildLoaderPlugin; }); } else { - var suffix = void 0; + var suffix = undefined; if (Resources && Resources.getString) { suffix = '.nls.keys'; req([name + suffix], function (keyMap) { diff --git a/src/vs/nls.js b/src/vs/nls.js index 8e178e8d0ea24..972e274207b2a 100644 --- a/src/vs/nls.js +++ b/src/vs/nls.js @@ -51,7 +51,7 @@ var NLSLoaderPlugin; if (typeof arg === 'string') { result = arg; } - else if (typeof arg === 'number' || typeof arg === 'boolean' || arg === void 0 || arg === null) { + else if (typeof arg === 'number' || typeof arg === 'boolean' || arg === undefined || arg === null) { result = String(arg); } return result; @@ -94,7 +94,7 @@ var NLSLoaderPlugin; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } - return localize.apply(void 0, [_this._env, data, message].concat(args)); + return localize.apply(undefined, [_this._env, data, message].concat(args)); }; } NLSPlugin.prototype.setPseudoTranslation = function (value) { diff --git a/src/vs/platform/commands/test/commands.test.ts b/src/vs/platform/commands/test/commands.test.ts index 054c0ff499780..02e019154ffdc 100644 --- a/src/vs/platform/commands/test/commands.test.ts +++ b/src/vs/platform/commands/test/commands.test.ts @@ -33,7 +33,7 @@ suite('Command Tests', function () { assert.ok(CommandsRegistry.getCommand('foo')!.handler === command1); reg1.dispose(); - assert.ok(CommandsRegistry.getCommand('foo') === void 0); + assert.ok(CommandsRegistry.getCommand('foo') === undefined); // dispose override command first reg1 = CommandsRegistry.registerCommand('foo', command1); @@ -44,7 +44,7 @@ suite('Command Tests', function () { assert.ok(CommandsRegistry.getCommand('foo')!.handler === command2); reg2.dispose(); - assert.ok(CommandsRegistry.getCommand('foo') === void 0); + assert.ok(CommandsRegistry.getCommand('foo') === undefined); }); test('command with description', function () { diff --git a/src/vs/platform/configuration/common/configurationModels.ts b/src/vs/platform/configuration/common/configurationModels.ts index 4673ec11065b3..5e587b50bc475 100644 --- a/src/vs/platform/configuration/common/configurationModels.ts +++ b/src/vs/platform/configuration/common/configurationModels.ts @@ -308,7 +308,7 @@ export class Configuration { memoryConfiguration = this._memoryConfiguration; } - if (value === void 0) { + if (value === undefined) { memoryConfiguration.removeValue(key); } else { memoryConfiguration.setValue(key, value); @@ -333,8 +333,8 @@ export class Configuration { return { default: overrides.overrideIdentifier ? this._defaultConfiguration.freeze().override(overrides.overrideIdentifier).getValue(key) : this._defaultConfiguration.freeze().getValue(key), user: overrides.overrideIdentifier ? this._userConfiguration.freeze().override(overrides.overrideIdentifier).getValue(key) : this._userConfiguration.freeze().getValue(key), - workspace: workspace ? overrides.overrideIdentifier ? this._workspaceConfiguration.freeze().override(overrides.overrideIdentifier).getValue(key) : this._workspaceConfiguration.freeze().getValue(key) : void 0, //Check on workspace exists or not because _workspaceConfiguration is never null - workspaceFolder: folderConfigurationModel ? overrides.overrideIdentifier ? folderConfigurationModel.freeze().override(overrides.overrideIdentifier).getValue(key) : folderConfigurationModel.freeze().getValue(key) : void 0, + workspace: workspace ? overrides.overrideIdentifier ? this._workspaceConfiguration.freeze().override(overrides.overrideIdentifier).getValue(key) : this._workspaceConfiguration.freeze().getValue(key) : undefined, //Check on workspace exists or not because _workspaceConfiguration is never null + workspaceFolder: folderConfigurationModel ? overrides.overrideIdentifier ? folderConfigurationModel.freeze().override(overrides.overrideIdentifier).getValue(key) : folderConfigurationModel.freeze().getValue(key) : undefined, memory: overrides.overrideIdentifier ? memoryConfigurationModel.freeze().override(overrides.overrideIdentifier).getValue(key) : memoryConfigurationModel.freeze().getValue(key), value: consolidateConfigurationModel.getValue(key) }; diff --git a/src/vs/platform/configuration/common/configurationRegistry.ts b/src/vs/platform/configuration/common/configurationRegistry.ts index 4cea7236d0d32..1c1a2f65f5051 100644 --- a/src/vs/platform/configuration/common/configurationRegistry.ts +++ b/src/vs/platform/configuration/common/configurationRegistry.ts @@ -209,7 +209,7 @@ class ConfigurationRegistry implements IConfigurationRegistry { } if (OVERRIDE_PROPERTY_PATTERN.test(key)) { - property.scope = void 0; // No scope for overridable properties `[${identifier}]` + property.scope = undefined; // No scope for overridable properties `[${identifier}]` } else { property.scope = types.isUndefinedOrNull(property.scope) ? scope : property.scope; } @@ -361,7 +361,7 @@ export function validateProperty(property: string): string | null { if (OVERRIDE_PROPERTY_PATTERN.test(property)) { return nls.localize('config.property.languageDefault', "Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.", property); } - if (configurationRegistry.getConfigurationProperties()[property] !== void 0) { + if (configurationRegistry.getConfigurationProperties()[property] !== undefined) { return nls.localize('config.property.duplicate', "Cannot register '{0}'. This property is already registered.", property); } return null; diff --git a/src/vs/platform/configuration/node/configuration.ts b/src/vs/platform/configuration/node/configuration.ts index 61c54a4543ccb..da87cfd3dec59 100644 --- a/src/vs/platform/configuration/node/configuration.ts +++ b/src/vs/platform/configuration/node/configuration.ts @@ -30,7 +30,7 @@ export class UserConfiguration extends Disposable { userConfigModelParser.parse(content); parseErrors = [...userConfigModelParser.errors]; return userConfigModelParser; - }, initCallback: () => c(void 0) + }, initCallback: () => c(undefined) }); this._register(this.userConfigModelWatcher); diff --git a/src/vs/platform/configuration/node/configurationService.ts b/src/vs/platform/configuration/node/configurationService.ts index c86f0522dadbb..b5b8d40189349 100644 --- a/src/vs/platform/configuration/node/configurationService.ts +++ b/src/vs/platform/configuration/node/configurationService.ts @@ -53,7 +53,7 @@ export class ConfigurationService extends Disposable implements IConfigurationSe getValue(overrides: IConfigurationOverrides): T; getValue(section: string, overrides: IConfigurationOverrides): T; getValue(arg1?: any, arg2?: any): any { - const section = typeof arg1 === 'string' ? arg1 : void 0; + const section = typeof arg1 === 'string' ? arg1 : undefined; const overrides = isConfigurationOverrides(arg1) ? arg1 : isConfigurationOverrides(arg2) ? arg2 : {}; return this.configuration.getValue(section, overrides, null); } @@ -86,7 +86,7 @@ export class ConfigurationService extends Disposable implements IConfigurationSe } reloadConfiguration(folder?: IWorkspaceFolder): Promise { - return folder ? Promise.resolve(void 0) : + return folder ? Promise.resolve(undefined) : this.userConfiguration.reload().then(userConfigurationModel => this.onDidChangeUserConfiguration(userConfigurationModel)); } diff --git a/src/vs/platform/configuration/test/common/configuration.test.ts b/src/vs/platform/configuration/test/common/configuration.test.ts index 313a2bd7618e1..c8b2927673073 100644 --- a/src/vs/platform/configuration/test/common/configuration.test.ts +++ b/src/vs/platform/configuration/test/common/configuration.test.ts @@ -41,7 +41,7 @@ suite('Configuration', () => { }); test('removeFromValueTree: remove a single segemented key when its value is undefined', () => { - let target = { 'a': void 0 }; + let target = { 'a': undefined }; removeFromValueTree(target, 'a'); diff --git a/src/vs/platform/configuration/test/common/testConfigurationService.ts b/src/vs/platform/configuration/test/common/testConfigurationService.ts index 3fd7eac379b87..21dd4c609ee08 100644 --- a/src/vs/platform/configuration/test/common/testConfigurationService.ts +++ b/src/vs/platform/configuration/test/common/testConfigurationService.ts @@ -20,7 +20,7 @@ export class TestConfigurationService implements IConfigurationService { public getValue(arg1?: any, arg2?: any): any { let configuration; - const overrides = isConfigurationOverrides(arg1) ? arg1 : isConfigurationOverrides(arg2) ? arg2 : void 0; + const overrides = isConfigurationOverrides(arg1) ? arg1 : isConfigurationOverrides(arg2) ? arg2 : undefined; if (overrides) { if (overrides.resource) { configuration = this.configurationByRoot.findSubstr(overrides.resource.fsPath); @@ -34,7 +34,7 @@ export class TestConfigurationService implements IConfigurationService { } public updateValue(key: string, overrides?: IConfigurationOverrides): Promise { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } public setUserConfiguration(key: any, value: any, root?: URI): Promise { @@ -46,7 +46,7 @@ export class TestConfigurationService implements IConfigurationService { this.configuration[key] = value; } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } public onDidChangeConfiguration() { diff --git a/src/vs/platform/configuration/test/node/configurationService.test.ts b/src/vs/platform/configuration/test/node/configurationService.test.ts index 75cf4af432d59..21a7975776872 100644 --- a/src/vs/platform/configuration/test/node/configurationService.test.ts +++ b/src/vs/platform/configuration/test/node/configurationService.test.ts @@ -207,14 +207,14 @@ suite('ConfigurationService - Node', () => { const r = await testFile('config', 'config.json'); const service = new ConfigurationService(new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, r.testFile)); let res = service.inspect('something.missing'); - assert.strictEqual(res.value, void 0); - assert.strictEqual(res.default, void 0); - assert.strictEqual(res.user, void 0); + assert.strictEqual(res.value, undefined); + assert.strictEqual(res.default, undefined); + assert.strictEqual(res.user, undefined); res = service.inspect('lookup.service.testSetting'); assert.strictEqual(res.default, 'isSet'); assert.strictEqual(res.value, 'isSet'); - assert.strictEqual(res.user, void 0); + assert.strictEqual(res.user, undefined); fs.writeFileSync(r.testFile, '{ "lookup.service.testSetting": "bar" }'); @@ -245,7 +245,7 @@ suite('ConfigurationService - Node', () => { let res = service.inspect('lookup.service.testNullSetting'); assert.strictEqual(res.default, null); assert.strictEqual(res.value, null); - assert.strictEqual(res.user, void 0); + assert.strictEqual(res.user, undefined); fs.writeFileSync(r.testFile, '{ "lookup.service.testNullSetting": null }'); diff --git a/src/vs/platform/download/node/downloadIpc.ts b/src/vs/platform/download/node/downloadIpc.ts index 61a9da3f35462..09781ffb3c3c9 100644 --- a/src/vs/platform/download/node/downloadIpc.ts +++ b/src/vs/platform/download/node/downloadIpc.ts @@ -58,7 +58,7 @@ export class DownloadServiceChannelClient implements IDownloadService { out.once('error', e); const uploadStream = this.channel.listen('upload', from); const disposable = uploadStream(result => { - if (result === void 0) { + if (result === undefined) { disposable.dispose(); out.end(c); } else if (Buffer.isBuffer(result)) { diff --git a/src/vs/platform/environment/node/environmentService.ts b/src/vs/platform/environment/node/environmentService.ts index 4a1511936978d..5ecf265cdbdea 100644 --- a/src/vs/platform/environment/node/environmentService.ts +++ b/src/vs/platform/environment/node/environmentService.ts @@ -180,7 +180,7 @@ export class EnvironmentService implements IEnvironmentService { } return URI.file(path.normalize(s)); } - return void 0; + return undefined; } @memoize diff --git a/src/vs/platform/extensionManagement/common/extensionEnablementService.ts b/src/vs/platform/extensionManagement/common/extensionEnablementService.ts index c470c3dbd20a9..bd03abcd01bcb 100644 --- a/src/vs/platform/extensionManagement/common/extensionEnablementService.ts +++ b/src/vs/platform/extensionManagement/common/extensionEnablementService.ts @@ -356,7 +356,7 @@ class StorageManager extends Disposable { delete this.storage[key]; } } - this._set(key, value.length ? newValue : void 0, scope); + this._set(key, value.length ? newValue : undefined, scope); } } diff --git a/src/vs/platform/extensionManagement/node/extensionGalleryService.ts b/src/vs/platform/extensionManagement/node/extensionGalleryService.ts index 7cac49ca50730..7e4b52ba1f50f 100644 --- a/src/vs/platform/extensionManagement/node/extensionGalleryService.ts +++ b/src/vs/platform/extensionManagement/node/extensionGalleryService.ts @@ -493,7 +493,7 @@ export class ExtensionGalleryService implements IExtensionGalleryService { reportStatistic(publisher: string, name: string, version: string, type: StatisticType): Promise { if (!this.isEnabled()) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } return this.commonHeadersPromise.then(commonHeaders => { @@ -503,7 +503,7 @@ export class ExtensionGalleryService implements IExtensionGalleryService { type: 'POST', url: this.api(`/publishers/${publisher}/extensions/${name}/${version}/stats?statType=${type}`), headers - }, CancellationToken.None).then(void 0, () => void 0); + }, CancellationToken.None).then(undefined, () => undefined); }); } @@ -728,7 +728,7 @@ export class ExtensionGalleryService implements IExtensionGalleryService { return asText(context) .then(message => Promise.reject(new Error(`Expected 200, got back ${context.res.statusCode} instead.\n\n${message}`))); }) - .then(void 0, err => { + .then(undefined, err => { if (isPromiseCanceledError(err)) { return Promise.reject(err); } @@ -751,7 +751,7 @@ export class ExtensionGalleryService implements IExtensionGalleryService { this.telemetryService.publicLog('galleryService:cdnFallback', { url, message }); const fallbackOptions = assign({}, options, { url: fallbackUrl }); - return this.requestService.request(fallbackOptions, token).then(void 0, err => { + return this.requestService.request(fallbackOptions, token).then(undefined, err => { if (isPromiseCanceledError(err)) { return Promise.reject(err); } diff --git a/src/vs/platform/extensionManagement/node/extensionLifecycle.ts b/src/vs/platform/extensionManagement/node/extensionLifecycle.ts index a65f031756531..9238c8e500f94 100644 --- a/src/vs/platform/extensionManagement/node/extensionLifecycle.ts +++ b/src/vs/platform/extensionManagement/node/extensionLifecycle.ts @@ -34,7 +34,7 @@ export class ExtensionsLifecycle extends Disposable { this.runLifecycleHook(script.script, 'uninstall', script.args, true, extension) .then(() => this.logService.info(extension.identifier.id, `Finished running post uninstall script`), err => this.logService.error(extension.identifier.id, `Failed to run post uninstall script: ${err}`))); } - return rimraf(this.getExtensionStoragePath(extension)).then(void 0, e => this.logService.error('Error while removing extension storage path', e)); + return rimraf(this.getExtensionStoragePath(extension)).then(undefined, e => this.logService.error('Error while removing extension storage path', e)); } private parseScript(extension: ILocalExtension, type: string): { script: string, args: string[] } | null { @@ -64,7 +64,7 @@ export class ExtensionsLifecycle extends Disposable { if (error) { e(error); } else { - c(void 0); + c(undefined); } }; @@ -75,7 +75,7 @@ export class ExtensionsLifecycle extends Disposable { // on exit extensionLifecycleProcess.on('exit', (code: number, signal: string) => { - onexit(code ? `post-${lifecycleType} process exited with code ${code}` : void 0); + onexit(code ? `post-${lifecycleType} process exited with code ${code}` : undefined); }); if (timeout) { diff --git a/src/vs/platform/extensionManagement/node/extensionManagementService.ts b/src/vs/platform/extensionManagement/node/extensionManagementService.ts index d624f1c600ed2..041b9f8f705dc 100644 --- a/src/vs/platform/extensionManagement/node/extensionManagementService.ts +++ b/src/vs/platform/extensionManagement/node/extensionManagementService.ts @@ -80,7 +80,7 @@ function readManifest(extensionPath: string): Promise<{ manifest: IExtensionMani pfs.readFile(path.join(extensionPath, 'package.json'), 'utf8') .then(raw => parseManifest(raw)), pfs.readFile(path.join(extensionPath, 'package.nls.json'), 'utf8') - .then(void 0, err => err.code !== 'ENOENT' ? Promise.reject(err) : '{}') + .then(undefined, err => err.code !== 'ENOENT' ? Promise.reject(err) : '{}') .then(raw => JSON.parse(raw)) ]; @@ -204,7 +204,7 @@ export class ExtensionManagementService extends Disposable implements IExtension return this.getInstalled(LocalExtensionType.User) .then(installedExtensions => { const newer = installedExtensions.filter(local => areSameExtensions(extensionIdentifier, { id: getGalleryExtensionIdFromLocal(local) }) && semver.gt(local.manifest.version, manifest.version))[0]; - return newer ? this.uninstall(newer, true) : void 0; + return newer ? this.uninstall(newer, true) : undefined; }) .then(() => { this.logService.info('Installing the extension:', identifier.id); @@ -241,7 +241,7 @@ export class ExtensionManagementService extends Disposable implements IExtension private removeIfExists(id: string): Promise { return this.getInstalled(LocalExtensionType.User) .then(installed => installed.filter(i => i.identifier.id === id)[0]) - .then(existing => existing ? this.removeExtension(existing, 'existing') : void 0); + .then(existing => existing ? this.removeExtension(existing, 'existing') : undefined); } private installFromZipPath(identifier: IExtensionIdentifier, zipPath: string, metadata: IGalleryMetadata | null, type: LocalExtensionType, token: CancellationToken): Promise { @@ -266,7 +266,7 @@ export class ExtensionManagementService extends Disposable implements IExtension const onDidInstallExtensionSuccess = (extension: IGalleryExtension, operation: InstallOperation, local: ILocalExtension) => { this.logService.info(`Extensions installed successfully:`, extension.identifier.id); this._onDidInstallExtension.fire({ identifier: { id: getLocalExtensionIdFromGallery(extension, extension.version), uuid: extension.identifier.uuid }, gallery: extension, local, operation }); - this.reportTelemetry(this.getTelemetryEvent(operation), getGalleryExtensionTelemetryData(extension), new Date().getTime() - startTime, void 0); + this.reportTelemetry(this.getTelemetryEvent(operation), getGalleryExtensionTelemetryData(extension), new Date().getTime() - startTime, undefined); }; const onDidInstallExtensionFailure = (extension: IGalleryExtension, operation: InstallOperation, error) => { @@ -478,7 +478,7 @@ export class ExtensionManagementService extends Disposable implements IExtension private rename(id: string, extractPath: string, renamePath: string, retryUntil: number): Promise { return pfs.rename(extractPath, renamePath) - .then(void 0, error => { + .then(undefined, error => { if (isWindows && error && error.code === 'EPERM' && Date.now() < retryUntil) { this.logService.info(`Failed renaming ${extractPath} to ${renamePath} with 'EPERM' error. Trying again...`); return this.rename(id, extractPath, renamePath, retryUntil); @@ -517,7 +517,7 @@ export class ExtensionManagementService extends Disposable implements IExtension }); } } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } private rollback(extensions: IGalleryExtension[]): Promise { @@ -525,7 +525,7 @@ export class ExtensionManagementService extends Disposable implements IExtension .then(installed => Promise.all(installed.filter(local => extensions.some(galleryExtension => local.identifier.id === getLocalExtensionIdFromGallery(galleryExtension, galleryExtension.version))) // Only check id (pub.name-version) because we want to rollback the exact version .map(local => this.uninstall(local, true)))) - .then(() => void 0, () => void 0); + .then(() => undefined, () => undefined); } uninstall(extension: ILocalExtension, force = false): Promise { @@ -620,7 +620,7 @@ export class ExtensionManagementService extends Disposable implements IExtension return Promise.reject(new Error(this.getDependentsErrorMessage(extension, remainingDependents))); } } - return Promise.all([this.uninstallExtension(extension), ...otherExtensionsToUninstall.map(d => this.doUninstall(d))]).then(() => void 0); + return Promise.all([this.uninstallExtension(extension), ...otherExtensionsToUninstall.map(d => this.doUninstall(d))]).then(() => undefined); } private getDependentsErrorMessage(extension: ILocalExtension, dependents: ILocalExtension[]): string { @@ -699,8 +699,8 @@ export class ExtensionManagementService extends Disposable implements IExtension await this.galleryService.reportStatistic(extension.manifest.publisher, extension.manifest.name, extension.manifest.version, StatisticType.Uninstall); } } - this.reportTelemetry('extensionGallery:uninstall', getLocalExtensionTelemetryData(extension), void 0, error); - const errorcode = error ? error instanceof ExtensionManagementError ? error.code : ERROR_UNKNOWN : void 0; + this.reportTelemetry('extensionGallery:uninstall', getLocalExtensionTelemetryData(extension), undefined, error); + const errorcode = error ? error instanceof ExtensionManagementError ? error.code : ERROR_UNKNOWN : undefined; this._onDidUninstallExtension.fire({ identifier: extension.identifier, error: errorcode }); } @@ -789,7 +789,7 @@ export class ExtensionManagementService extends Disposable implements IExtension const galleryIdentifier = { id: getGalleryExtensionId(manifest.publisher, manifest.name), uuid: identifier.uuid }; return { type, identifier, galleryIdentifier, manifest, metadata, location: URI.file(extensionPath), readmeUrl, changelogUrl }; })) - .then(void 0, () => null); + .then(undefined, () => null); } removeDeprecatedExtensions(): Promise { @@ -804,7 +804,7 @@ export class ExtensionManagementService extends Disposable implements IExtension const toRemove: ILocalExtension[] = extensions.filter(e => uninstalled[e.identifier.id]); return Promise.all(toRemove.map(e => this.extensionLifecycle.postUninstall(e).then(() => this.removeUninstalledExtension(e)))); }) - ).then(() => void 0); + ).then(() => undefined); } private removeOutdatedExtensions(): Promise { @@ -817,13 +817,13 @@ export class ExtensionManagementService extends Disposable implements IExtension toRemove.push(...flatten(byExtension.map(p => p.sort((a, b) => semver.rcompare(a.manifest.version, b.manifest.version)).slice(1)))); return Promise.all(toRemove.map(extension => this.removeExtension(extension, 'outdated'))); - }).then(() => void 0); + }).then(() => undefined); } private removeUninstalledExtension(extension: ILocalExtension): Promise { return this.removeExtension(extension, 'uninstalled') .then(() => this.withUninstalledExtensions(uninstalled => delete uninstalled[extension.identifier.id])) - .then(() => void 0); + .then(() => undefined); } private removeExtension(extension: ILocalExtension, type: string): Promise { @@ -864,7 +864,7 @@ export class ExtensionManagementService extends Disposable implements IExtension return await this.uninstalledFileLimiter.queue(() => { let result: T | null = null; return pfs.readFile(this.uninstalledPath, 'utf8') - .then(void 0, err => err.code === 'ENOENT' ? Promise.resolve('{}') : Promise.reject(err)) + .then(undefined, err => err.code === 'ENOENT' ? Promise.resolve('{}') : Promise.reject(err)) .then<{ [id: string]: boolean }>(raw => { try { return JSON.parse(raw); } catch (e) { return {}; } }) .then(uninstalled => { result = fn(uninstalled); return uninstalled; }) .then(uninstalled => { @@ -932,7 +932,7 @@ export class ExtensionManagementService extends Disposable implements IExtension } private reportTelemetry(eventName: string, extensionData: any, duration?: number, error?: Error): void { - const errorcode = error ? error instanceof ExtensionManagementError ? error.code : ERROR_UNKNOWN : void 0; + const errorcode = error ? error instanceof ExtensionManagementError ? error.code : ERROR_UNKNOWN : undefined; /* __GDPR__ "extensionGallery:install" : { "success": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, diff --git a/src/vs/platform/extensionManagement/node/multiExtensionManagement.ts b/src/vs/platform/extensionManagement/node/multiExtensionManagement.ts index ad9545bfd4c8c..4a9fae47f40d1 100644 --- a/src/vs/platform/extensionManagement/node/multiExtensionManagement.ts +++ b/src/vs/platform/extensionManagement/node/multiExtensionManagement.ts @@ -101,7 +101,7 @@ export class MultiExtensionManagementService extends Disposable implements IExte if (manifest) { const servers = manifest && isUIExtension(manifest, this.configurationService) ? [this.extensionManagementServerService.localExtensionManagementServer] : syncExtensions ? this.servers : [this.extensionManagementServerService.remoteExtensionManagementServer!]; return Promise.all(servers.map(server => server.extensionManagementService.installFromGallery(gallery))) - .then(() => void 0); + .then(() => undefined); } else { this.logService.info('Manifest was not found. Hence installing only in local server'); return this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.installFromGallery(gallery); diff --git a/src/vs/platform/extensionManagement/test/electron-browser/extensionEnablementService.test.ts b/src/vs/platform/extensionManagement/test/electron-browser/extensionEnablementService.test.ts index e4b15d11db7d1..70051896e6172 100644 --- a/src/vs/platform/extensionManagement/test/electron-browser/extensionEnablementService.test.ts +++ b/src/vs/platform/extensionManagement/test/electron-browser/extensionEnablementService.test.ts @@ -85,7 +85,7 @@ suite('ExtensionEnablementService Test', () => { const target = sinon.spy(); testObject.onEnablementChanged(target); return testObject.setEnablement(aLocalExtension('pub.a'), EnablementState.Disabled) - .then(() => assert.ok(target.calledWithExactly({ id: 'pub.a', uuid: void 0 }))); + .then(() => assert.ok(target.calledWithExactly({ id: 'pub.a', uuid: undefined }))); }); test('test disable an extension globally again should return a falsy promise', () => { @@ -197,7 +197,7 @@ suite('ExtensionEnablementService Test', () => { return testObject.setEnablement(aLocalExtension('pub.a'), EnablementState.WorkspaceDisabled) .then(() => testObject.onEnablementChanged(target)) .then(() => testObject.setEnablement(aLocalExtension('pub.a'), EnablementState.Disabled)) - .then(() => assert.ok(target.calledWithExactly({ id: 'pub.a', uuid: void 0 }))); + .then(() => assert.ok(target.calledWithExactly({ id: 'pub.a', uuid: undefined }))); }); test('test disable an extension globally and then for workspace', () => { @@ -218,7 +218,7 @@ suite('ExtensionEnablementService Test', () => { return testObject.setEnablement(aLocalExtension('pub.a'), EnablementState.Disabled) .then(() => testObject.onEnablementChanged(target)) .then(() => testObject.setEnablement(aLocalExtension('pub.a'), EnablementState.WorkspaceDisabled)) - .then(() => assert.ok(target.calledWithExactly({ id: 'pub.a', uuid: void 0 }))); + .then(() => assert.ok(target.calledWithExactly({ id: 'pub.a', uuid: undefined }))); }); test('test disable an extension for workspace when there is no workspace throws error', () => { @@ -245,7 +245,7 @@ suite('ExtensionEnablementService Test', () => { return testObject.setEnablement(aLocalExtension('pub.a'), EnablementState.Disabled) .then(() => testObject.onEnablementChanged(target)) .then(() => testObject.setEnablement(aLocalExtension('pub.a'), EnablementState.Enabled)) - .then(() => assert.ok(target.calledWithExactly({ id: 'pub.a', uuid: void 0 }))); + .then(() => assert.ok(target.calledWithExactly({ id: 'pub.a', uuid: undefined }))); }); test('test enable an extension globally when already enabled return falsy promise', () => { @@ -271,7 +271,7 @@ suite('ExtensionEnablementService Test', () => { return testObject.setEnablement(aLocalExtension('pub.b'), EnablementState.WorkspaceDisabled) .then(() => testObject.onEnablementChanged(target)) .then(() => testObject.setEnablement(aLocalExtension('pub.b'), EnablementState.WorkspaceEnabled)) - .then(() => assert.ok(target.calledWithExactly({ id: 'pub.b', uuid: void 0 }))); + .then(() => assert.ok(target.calledWithExactly({ id: 'pub.b', uuid: undefined }))); }); test('test enable an extension for workspace when already enabled return truthy promise', () => { @@ -452,7 +452,7 @@ function aLocalExtension(id: string, contributes?: IExtensionContributions): ILo const [publisher, name] = id.split('.'); return Object.create({ identifier: { id }, - galleryIdentifier: { id, uuid: void 0 }, + galleryIdentifier: { id, uuid: undefined }, manifest: { name, publisher, diff --git a/src/vs/platform/instantiation/test/common/instantiationService.test.ts b/src/vs/platform/instantiation/test/common/instantiationService.test.ts index 9cddf4e9f6725..2f38e138c5184 100644 --- a/src/vs/platform/instantiation/test/common/instantiationService.test.ts +++ b/src/vs/platform/instantiation/test/common/instantiationService.test.ts @@ -94,7 +94,7 @@ class TargetOptional { constructor(@IService1 service1: IService1, @optional(IService2) service2: IService2) { assert.ok(service1); assert.equal(service1.c, 1); - assert.ok(service2 === void 0); + assert.ok(service2 === undefined); } } diff --git a/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts b/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts index 4d3c9ae0a4c6a..18b3ea9ea1ee0 100644 --- a/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts +++ b/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts @@ -41,7 +41,7 @@ export class TestInstantiationService extends InstantiationService { public stub(service: ServiceIdentifier, obj?: any, property?: string, value?: any): sinon.SinonStub; public stub(service: ServiceIdentifier, property?: string, value?: any): sinon.SinonStub; public stub(serviceIdentifier: ServiceIdentifier, arg2?: any, arg3?: string, arg4?: any): sinon.SinonStub { - let service = typeof arg2 !== 'string' ? arg2 : void 0; + let service = typeof arg2 !== 'string' ? arg2 : undefined; let serviceMock: IServiceMock = { id: serviceIdentifier, service: service }; let property = typeof arg2 === 'string' ? arg2 : arg3; let value = typeof arg2 === 'string' ? arg3 : arg4; diff --git a/src/vs/platform/issue/electron-main/issueService.ts b/src/vs/platform/issue/electron-main/issueService.ts index 8ebbcce651ca5..e9170826f87e6 100644 --- a/src/vs/platform/issue/electron-main/issueService.ts +++ b/src/vs/platform/issue/electron-main/issueService.ts @@ -189,7 +189,7 @@ export class IssueService implements IIssueService { 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] === '') { + if (config[key] === undefined || config[key] === null || config[key] === '') { delete config[key]; // only send over properties that have a true value } } @@ -323,7 +323,7 @@ export class IssueService implements IIssueService { 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] === '') { + if (config[key] === undefined || config[key] === null || config[key] === '') { delete config[key]; // only send over properties that have a true value } } diff --git a/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts b/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts index 1a3107370cb49..accb7f54d4cf0 100644 --- a/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts +++ b/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts @@ -118,7 +118,7 @@ suite('AbstractKeybindingService', () => { commandId: commandId, args: args }); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } }; diff --git a/src/vs/platform/label/common/label.ts b/src/vs/platform/label/common/label.ts index 0e8cdb2fcaa59..2471a2a8b4c77 100644 --- a/src/vs/platform/label/common/label.ts +++ b/src/vs/platform/label/common/label.ts @@ -102,7 +102,7 @@ export class LabelService implements ILabelService { if (bestPrefix.length) { return this.formatters[bestPrefix]; } - return void 0; + return undefined; } getUriLabel(resource: URI, options: { relative?: boolean, noPrefix?: boolean } = {}): string { diff --git a/src/vs/platform/launch/electron-main/launchService.ts b/src/vs/platform/launch/electron-main/launchService.ts index 20a6d4b95ce8b..70e12944bff71 100644 --- a/src/vs/platform/launch/electron-main/launchService.ts +++ b/src/vs/platform/launch/electron-main/launchService.ts @@ -152,7 +152,7 @@ export class LaunchService implements ILaunchService { } }); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } // Otherwise handle in windows service @@ -226,10 +226,10 @@ export class LaunchService implements ILaunchService { return Promise.race([ this.windowsMainService.waitForWindowCloseOrLoad(usedWindows[0].id), whenDeleted(args.waitMarkerFilePath) - ]).then(() => void 0, () => void 0); + ]).then(() => undefined, () => undefined); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } getMainProcessId(): Promise { diff --git a/src/vs/platform/lifecycle/electron-browser/lifecycleService.ts b/src/vs/platform/lifecycle/electron-browser/lifecycleService.ts index cbb965509fe84..a23ee9f891f7b 100644 --- a/src/vs/platform/lifecycle/electron-browser/lifecycleService.ts +++ b/src/vs/platform/lifecycle/electron-browser/lifecycleService.ts @@ -143,7 +143,7 @@ export class LifecycleService extends Disposable implements ILifecycleService { reason }); - return Promise.all(joiners).then(() => void 0, err => { + return Promise.all(joiners).then(() => undefined, err => { this.notificationService.error(toErrorMessage(err)); onUnexpectedError(err); }); diff --git a/src/vs/platform/lifecycle/electron-main/lifecycleMain.ts b/src/vs/platform/lifecycle/electron-main/lifecycleMain.ts index 786ee14504bd9..ff53fa0cf5468 100644 --- a/src/vs/platform/lifecycle/electron-main/lifecycleMain.ts +++ b/src/vs/platform/lifecycle/electron-main/lifecycleMain.ts @@ -234,7 +234,7 @@ export class LifecycleService extends Disposable implements ILifecycleService { } }); - this.pendingWillShutdownPromise = Promise.all(joiners).then(void 0, err => this.logService.error(err)); + this.pendingWillShutdownPromise = Promise.all(joiners).then(undefined, err => this.logService.error(err)); return this.pendingWillShutdownPromise; } diff --git a/src/vs/platform/localizations/node/localizations.ts b/src/vs/platform/localizations/node/localizations.ts index 15c1419bc4e0b..4f37910cbd831 100644 --- a/src/vs/platform/localizations/node/localizations.ts +++ b/src/vs/platform/localizations/node/localizations.ts @@ -172,7 +172,7 @@ class LanguagePacksCache extends Disposable { return this.languagePacksFileLimiter.queue(() => { let result: T | null = null; return pfs.readFile(this.languagePacksFilePath, 'utf8') - .then(void 0, err => err.code === 'ENOENT' ? Promise.resolve('{}') : Promise.reject(err)) + .then(undefined, err => err.code === 'ENOENT' ? Promise.resolve('{}') : Promise.reject(err)) .then<{ [language: string]: ILanguagePack }>(raw => { try { return JSON.parse(raw); } catch (e) { return {}; } }) .then(languagePacks => { result = fn(languagePacks); return languagePacks; }) .then(languagePacks => { diff --git a/src/vs/platform/markers/common/markerService.ts b/src/vs/platform/markers/common/markerService.ts index 515b23932c067..cb6a011a0c265 100644 --- a/src/vs/platform/markers/common/markerService.ts +++ b/src/vs/platform/markers/common/markerService.ts @@ -336,7 +336,7 @@ export class MarkerService implements IMarkerService { } private static _accept(marker: IMarker, severities?: number): boolean { - return severities === void 0 || (severities & marker.severity) === marker.severity; + return severities === undefined || (severities & marker.severity) === marker.severity; } // --- event debounce logic @@ -349,7 +349,7 @@ export class MarkerService implements IMarkerService { last = []; } for (const uri of event) { - if (MarkerService._dedupeMap[uri.toString()] === void 0) { + if (MarkerService._dedupeMap[uri.toString()] === undefined) { MarkerService._dedupeMap[uri.toString()] = true; last.push(uri); } diff --git a/src/vs/platform/markers/common/markers.ts b/src/vs/platform/markers/common/markers.ts index dd3cc805444fb..cffd29622597d 100644 --- a/src/vs/platform/markers/common/markers.ts +++ b/src/vs/platform/markers/common/markers.ts @@ -130,7 +130,7 @@ export namespace IMarkerData { } else { result.push(emptyString); } - if (markerData.severity !== void 0 && markerData.severity !== null) { + if (markerData.severity !== undefined && markerData.severity !== null) { result.push(MarkerSeverity.toString(markerData.severity)); } else { result.push(emptyString); @@ -140,22 +140,22 @@ export namespace IMarkerData { } else { result.push(emptyString); } - if (markerData.startLineNumber !== void 0 && markerData.startLineNumber !== null) { + if (markerData.startLineNumber !== undefined && markerData.startLineNumber !== null) { result.push(markerData.startLineNumber.toString()); } else { result.push(emptyString); } - if (markerData.startColumn !== void 0 && markerData.startColumn !== null) { + if (markerData.startColumn !== undefined && markerData.startColumn !== null) { result.push(markerData.startColumn.toString()); } else { result.push(emptyString); } - if (markerData.endLineNumber !== void 0 && markerData.endLineNumber !== null) { + if (markerData.endLineNumber !== undefined && markerData.endLineNumber !== null) { result.push(markerData.endLineNumber.toString()); } else { result.push(emptyString); } - if (markerData.endColumn !== void 0 && markerData.endColumn !== null) { + if (markerData.endColumn !== undefined && markerData.endColumn !== null) { result.push(markerData.endColumn.toString()); } else { result.push(emptyString); diff --git a/src/vs/platform/menubar/electron-main/menubar.ts b/src/vs/platform/menubar/electron-main/menubar.ts index 43c65fcdb059c..b511821c0a4f0 100644 --- a/src/vs/platform/menubar/electron-main/menubar.ts +++ b/src/vs/platform/menubar/electron-main/menubar.ts @@ -748,7 +748,7 @@ export class Menubar { // Unset bindings if there is none else { - options.accelerator = void 0; + options.accelerator = undefined; } return options; diff --git a/src/vs/platform/menubar/electron-main/menubarService.ts b/src/vs/platform/menubar/electron-main/menubarService.ts index 8a38ca35de937..c0ab08d56e3db 100644 --- a/src/vs/platform/menubar/electron-main/menubarService.ts +++ b/src/vs/platform/menubar/electron-main/menubarService.ts @@ -28,6 +28,6 @@ export class MenubarService implements IMenubarService { this._menubar.updateMenu(menus, windowId); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } \ No newline at end of file diff --git a/src/vs/platform/node/zip.ts b/src/vs/platform/node/zip.ts index ac5786eab76a3..be8629a236a24 100644 --- a/src/vs/platform/node/zip.ts +++ b/src/vs/platform/node/zip.ts @@ -62,7 +62,7 @@ function toExtractError(err: Error): ExtractError { return err; } - let type: ExtractErrorType | undefined = void 0; + let type: ExtractErrorType | undefined = undefined; if (/end of central directory record signature not found/.test(err.message)) { type = 'CorruptZip'; @@ -87,7 +87,7 @@ function extractEntry(stream: Readable, fileName: string, mode: number, targetPa } }); - return Promise.resolve(mkdirp(targetDirName, void 0, token)).then(() => new Promise((c, e) => { + return Promise.resolve(mkdirp(targetDirName, undefined, token)).then(() => new Promise((c, e) => { if (token.isCancellationRequested) { return; } @@ -151,7 +151,7 @@ function extractZip(zipfile: ZipFile, targetPath: string, options: IOptions, log // directory file names end with '/' if (/\/$/.test(fileName)) { const targetFileName = path.join(targetPath, fileName); - last = createCancelablePromise(token => mkdirp(targetFileName, void 0, token).then(() => readNextEntry(token)).then(void 0, e)); + last = createCancelablePromise(token => mkdirp(targetFileName, undefined, token).then(() => readNextEntry(token)).then(undefined, e)); return; } @@ -164,8 +164,8 @@ function extractZip(zipfile: ZipFile, targetPath: string, options: IOptions, log } function openZip(zipFile: string, lazy: boolean = false): Promise { - return nfcall(_openZip, zipFile, lazy ? { lazyEntries: true } : void 0) - .then(void 0, err => Promise.reject(toExtractError(err))); + return nfcall(_openZip, zipFile, lazy ? { lazyEntries: true } : undefined) + .then(undefined, err => Promise.reject(toExtractError(err))); } export interface IFile { diff --git a/src/vs/platform/progress/common/progress.ts b/src/vs/platform/progress/common/progress.ts index 27195ab0d548b..9a34739d34c99 100644 --- a/src/vs/platform/progress/common/progress.ts +++ b/src/vs/platform/progress/common/progress.ts @@ -130,7 +130,7 @@ export class LongRunningOperation { this.currentOperationDisposables.push( toDisposable(() => clearTimeout(this.currentProgressTimeout)), toDisposable(() => newOperationToken.cancel()), - toDisposable(() => this.currentProgressRunner ? this.currentProgressRunner.done() : void 0) + toDisposable(() => this.currentProgressRunner ? this.currentProgressRunner.done() : undefined) ); return { diff --git a/src/vs/platform/remote/common/remoteHosts.ts b/src/vs/platform/remote/common/remoteHosts.ts index 29e16a54967f8..0114939f09bda 100644 --- a/src/vs/platform/remote/common/remoteHosts.ts +++ b/src/vs/platform/remote/common/remoteHosts.ts @@ -8,5 +8,5 @@ import { URI } from 'vs/base/common/uri'; export const REMOTE_HOST_SCHEME = 'vscode-remote'; export function getRemoteAuthority(uri: URI) { - return uri.scheme === REMOTE_HOST_SCHEME ? uri.authority : void 0; + return uri.scheme === REMOTE_HOST_SCHEME ? uri.authority : undefined; } \ No newline at end of file diff --git a/src/vs/platform/remote/node/remoteAgentFileSystemChannel.ts b/src/vs/platform/remote/node/remoteAgentFileSystemChannel.ts index d083a69af1128..68726eabc2ca8 100644 --- a/src/vs/platform/remote/node/remoteAgentFileSystemChannel.ts +++ b/src/vs/platform/remote/node/remoteAgentFileSystemChannel.ts @@ -54,7 +54,7 @@ export class RemoteExtensionsFileSystemProvider extends Disposable implements IF capabilities |= FileSystemProviderCapabilities.PathCaseSensitive; } this.capabilities = capabilities; - this._onDidChangeCapabilities.fire(void 0); + this._onDidChangeCapabilities.fire(undefined); } watch(resource: URI, opts: IWatchOptions): IDisposable { diff --git a/src/vs/platform/state/node/stateService.ts b/src/vs/platform/state/node/stateService.ts index c4b5bc9bad89d..26f7760e74c0d 100644 --- a/src/vs/platform/state/node/stateService.ts +++ b/src/vs/platform/state/node/stateService.ts @@ -91,7 +91,7 @@ export class FileStorage { // Only update if the key is actually present (not undefined) if (!isUndefined(this.database[key])) { - this.database[key] = void 0; + this.database[key] = undefined; this.saveSync(); } } diff --git a/src/vs/platform/state/test/node/state.test.ts b/src/vs/platform/state/test/node/state.test.ts index df9956f580afc..a3b5db21684d3 100644 --- a/src/vs/platform/state/test/node/state.test.ts +++ b/src/vs/platform/state/test/node/state.test.ts @@ -41,7 +41,7 @@ suite('StateService', () => { service.setItem('some.other.key', 'some.other.value'); assert.equal(service.getItem('some.other.key'), 'some.other.value'); - service.setItem('some.undefined.key', void 0); + service.setItem('some.undefined.key', undefined); assert.equal(service.getItem('some.undefined.key', 'some.default'), 'some.default'); service.setItem('some.null.key', null); diff --git a/src/vs/platform/storage/node/storageMainService.ts b/src/vs/platform/storage/node/storageMainService.ts index 9d4e8bad79c2e..3d8c285332ce0 100644 --- a/src/vs/platform/storage/node/storageMainService.ts +++ b/src/vs/platform/storage/node/storageMainService.ts @@ -109,7 +109,7 @@ export class StorageMainService extends Disposable implements IStorageMainServic const loggedStorageErrors = new Set(); return { - logTrace: (this.logService.getLevel() === LogLevel.Trace) ? msg => this.logService.trace(msg) : void 0, + logTrace: (this.logService.getLevel() === LogLevel.Trace) ? msg => this.logService.trace(msg) : undefined, logError: error => { this.logService.error(error); diff --git a/src/vs/platform/storage/node/storageService.ts b/src/vs/platform/storage/node/storageService.ts index e9fc3f9586f3c..c3cccc7ee8e63 100644 --- a/src/vs/platform/storage/node/storageService.ts +++ b/src/vs/platform/storage/node/storageService.ts @@ -45,7 +45,7 @@ export class StorageService extends Disposable implements IStorageService { }, 0); } - this.bufferedWorkspaceStorageErrors = void 0; + this.bufferedWorkspaceStorageErrors = undefined; } return this._onWorkspaceStorageError.event; @@ -77,7 +77,7 @@ export class StorageService extends Disposable implements IStorageService { return Promise.all([ this.initializeGlobalStorage(), this.initializeWorkspaceStorage(payload) - ]).then(() => void 0); + ]).then(() => undefined); } private initializeGlobalStorage(): Promise { @@ -100,14 +100,14 @@ export class StorageService extends Disposable implements IStorageService { // Create workspace storage and initalize mark('willInitWorkspaceStorage'); - return this.createWorkspaceStorage(useInMemoryStorage ? SQLiteStorageDatabase.IN_MEMORY_PATH : join(result.path, StorageService.WORKSPACE_STORAGE_NAME), result.wasCreated ? StorageHint.STORAGE_DOES_NOT_EXIST : void 0).init().then(() => { + return this.createWorkspaceStorage(useInMemoryStorage ? SQLiteStorageDatabase.IN_MEMORY_PATH : join(result.path, StorageService.WORKSPACE_STORAGE_NAME), result.wasCreated ? StorageHint.STORAGE_DOES_NOT_EXIST : undefined).init().then(() => { mark('didInitWorkspaceStorage'); }, error => { mark('didInitWorkspaceStorage'); return Promise.reject(error); }); - }).then(void 0, error => { + }).then(undefined, error => { onUnexpectedError(error); // Upon error, fallback to in-memory storage @@ -119,7 +119,7 @@ export class StorageService extends Disposable implements IStorageService { // Logger for workspace storage const workspaceLoggingOptions: ISQLiteStorageDatabaseLoggingOptions = { - logTrace: (this.logService.getLevel() === LogLevel.Trace) ? msg => this.logService.trace(msg) : void 0, + logTrace: (this.logService.getLevel() === LogLevel.Trace) ? msg => this.logService.trace(msg) : undefined, logError: error => { this.logService.error(error); @@ -168,7 +168,7 @@ export class StorageService extends Disposable implements IStorageService { } private ensureWorkspaceStorageFolderMeta(payload: IWorkspaceInitializationPayload): void { - let meta: object | undefined = void 0; + let meta: object | undefined = undefined; if (isSingleFolderWorkspaceInitializationPayload(payload)) { meta = { folder: payload.folder.toString() }; } else if (isWorkspaceIdentifier(payload)) { @@ -179,11 +179,11 @@ export class StorageService extends Disposable implements IStorageService { const workspaceStorageMetaPath = join(this.getWorkspaceStorageFolderPath(payload), StorageService.WORKSPACE_META_NAME); exists(workspaceStorageMetaPath).then(exists => { if (exists) { - return void 0; // already existing + return undefined; // already existing } - return writeFile(workspaceStorageMetaPath, JSON.stringify(meta, void 0, 2)); - }).then(void 0, error => onUnexpectedError(error)); + return writeFile(workspaceStorageMetaPath, JSON.stringify(meta, undefined, 2)); + }).then(undefined, error => onUnexpectedError(error)); } } diff --git a/src/vs/platform/storage/test/node/storageService.test.ts b/src/vs/platform/storage/test/node/storageService.test.ts index 3e4da70f09631..109678bddb85b 100644 --- a/src/vs/platform/storage/test/node/storageService.test.ts +++ b/src/vs/platform/storage/test/node/storageService.test.ts @@ -30,10 +30,10 @@ suite('StorageService', () => { const storage = new TestStorageService(); storage.store('Monaco.IDE.Core.Storage.Test.remove', 'foobar', scope); - strictEqual('foobar', storage.get('Monaco.IDE.Core.Storage.Test.remove', scope, (void 0)!)); + strictEqual('foobar', storage.get('Monaco.IDE.Core.Storage.Test.remove', scope, (undefined)!)); storage.remove('Monaco.IDE.Core.Storage.Test.remove', scope); - ok(!storage.get('Monaco.IDE.Core.Storage.Test.remove', scope, (void 0)!)); + ok(!storage.get('Monaco.IDE.Core.Storage.Test.remove', scope, (undefined)!)); } test('Get Data, Integer, Boolean (global, in-memory)', () => { @@ -55,22 +55,22 @@ suite('StorageService', () => { strictEqual(storage.getBoolean('Monaco.IDE.Core.Storage.Test.getBoolean', scope, false), false); storage.store('Monaco.IDE.Core.Storage.Test.get', 'foobar', scope); - strictEqual(storage.get('Monaco.IDE.Core.Storage.Test.get', scope, (void 0)!), 'foobar'); + strictEqual(storage.get('Monaco.IDE.Core.Storage.Test.get', scope, (undefined)!), 'foobar'); storage.store('Monaco.IDE.Core.Storage.Test.get', '', scope); - strictEqual(storage.get('Monaco.IDE.Core.Storage.Test.get', scope, (void 0)!), ''); + strictEqual(storage.get('Monaco.IDE.Core.Storage.Test.get', scope, (undefined)!), ''); storage.store('Monaco.IDE.Core.Storage.Test.getInteger', 5, scope); - strictEqual(storage.getInteger('Monaco.IDE.Core.Storage.Test.getInteger', scope, (void 0)!), 5); + strictEqual(storage.getInteger('Monaco.IDE.Core.Storage.Test.getInteger', scope, (undefined)!), 5); storage.store('Monaco.IDE.Core.Storage.Test.getInteger', 0, scope); - strictEqual(storage.getInteger('Monaco.IDE.Core.Storage.Test.getInteger', scope, (void 0)!), 0); + strictEqual(storage.getInteger('Monaco.IDE.Core.Storage.Test.getInteger', scope, (undefined)!), 0); storage.store('Monaco.IDE.Core.Storage.Test.getBoolean', true, scope); - strictEqual(storage.getBoolean('Monaco.IDE.Core.Storage.Test.getBoolean', scope, (void 0)!), true); + strictEqual(storage.getBoolean('Monaco.IDE.Core.Storage.Test.getBoolean', scope, (undefined)!), true); storage.store('Monaco.IDE.Core.Storage.Test.getBoolean', false, scope); - strictEqual(storage.getBoolean('Monaco.IDE.Core.Storage.Test.getBoolean', scope, (void 0)!), false); + strictEqual(storage.getBoolean('Monaco.IDE.Core.Storage.Test.getBoolean', scope, (undefined)!), false); strictEqual(storage.get('Monaco.IDE.Core.Storage.Test.getDefault', scope, 'getDefault'), 'getDefault'); strictEqual(storage.getInteger('Monaco.IDE.Core.Storage.Test.getIntegerDefault', scope, 5), 5); diff --git a/src/vs/platform/telemetry/common/telemetryUtils.ts b/src/vs/platform/telemetry/common/telemetryUtils.ts index a89ec346ff43b..b0dcafe656860 100644 --- a/src/vs/platform/telemetry/common/telemetryUtils.ts +++ b/src/vs/platform/telemetry/common/telemetryUtils.ts @@ -15,7 +15,7 @@ import { ILogService } from 'vs/platform/log/common/log'; export const NullTelemetryService = new class implements ITelemetryService { _serviceBrand: undefined; publicLog(eventName: string, data?: ITelemetryData) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } isOptedIn: true; getTelemetryInfo(): Promise { diff --git a/src/vs/platform/telemetry/node/appInsightsAppender.ts b/src/vs/platform/telemetry/node/appInsightsAppender.ts index c5954777edc5d..5f6f7e3dbe84c 100644 --- a/src/vs/platform/telemetry/node/appInsightsAppender.ts +++ b/src/vs/platform/telemetry/node/appInsightsAppender.ts @@ -150,7 +150,7 @@ export class AppInsightsAppender implements ITelemetryAppender { callback: () => { // all data flushed this._aiClient = undefined; - resolve(void 0); + resolve(undefined); } }); }); diff --git a/src/vs/platform/telemetry/test/electron-browser/commonProperties.test.ts b/src/vs/platform/telemetry/test/electron-browser/commonProperties.test.ts index d21422f49e27c..ecc735dc7dddf 100644 --- a/src/vs/platform/telemetry/test/electron-browser/commonProperties.test.ts +++ b/src/vs/platform/telemetry/test/electron-browser/commonProperties.test.ts @@ -17,8 +17,8 @@ suite('Telemetry - common properties', function () { const parentDir = getRandomTestPath(os.tmpdir(), 'vsctests', 'telemetryservice'); const installSource = path.join(parentDir, 'installSource'); - const commit: string = (void 0)!; - const version: string = (void 0)!; + const commit: string = (undefined)!; + const version: string = (undefined)!; let testStorageService: IStorageService; setup(() => { diff --git a/src/vs/platform/update/electron-main/abstractUpdateService.ts b/src/vs/platform/update/electron-main/abstractUpdateService.ts index 2283a9a9c7778..055fd282d56a0 100644 --- a/src/vs/platform/update/electron-main/abstractUpdateService.ts +++ b/src/vs/platform/update/electron-main/abstractUpdateService.ts @@ -131,7 +131,7 @@ export abstract class AbstractUpdateService implements IUpdateService { this.logService.trace('update#quitAndInstall, state = ', this.state.type); if (this.state.type !== StateType.Ready) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } this.logService.trace('update#quitAndInstall(): before lifecycle quit()'); @@ -146,7 +146,7 @@ export abstract class AbstractUpdateService implements IUpdateService { this.doQuitAndInstall(); }); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } isLatestVersion(): Promise { diff --git a/src/vs/platform/update/electron-main/updateService.linux.ts b/src/vs/platform/update/electron-main/updateService.linux.ts index 7f4261df7ea8f..e26266d0a2c64 100644 --- a/src/vs/platform/update/electron-main/updateService.linux.ts +++ b/src/vs/platform/update/electron-main/updateService.linux.ts @@ -64,7 +64,7 @@ export class LinuxUpdateService extends AbstractUpdateService { this.setState(State.AvailableForDownload(update)); } }) - .then(void 0, err => { + .then(undefined, err => { this.logService.error(err); /* __GDPR__ diff --git a/src/vs/platform/update/electron-main/updateService.snap.ts b/src/vs/platform/update/electron-main/updateService.snap.ts index c11676fed4bd6..9640989e33716 100644 --- a/src/vs/platform/update/electron-main/updateService.snap.ts +++ b/src/vs/platform/update/electron-main/updateService.snap.ts @@ -81,7 +81,7 @@ abstract class AbstractUpdateService2 implements IUpdateService { } protected doDownloadUpdate(state: AvailableForDownload): Promise { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } async applyUpdate(): Promise { @@ -95,14 +95,14 @@ abstract class AbstractUpdateService2 implements IUpdateService { } protected doApplyUpdate(): Promise { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } quitAndInstall(): Promise { this.logService.trace('update#quitAndInstall, state = ', this.state.type); if (this.state.type !== StateType.Ready) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } this.logService.trace('update#quitAndInstall(): before lifecycle quit()'); @@ -117,7 +117,7 @@ abstract class AbstractUpdateService2 implements IUpdateService { this.doQuitAndInstall(); }); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } diff --git a/src/vs/platform/update/electron-main/updateService.win32.ts b/src/vs/platform/update/electron-main/updateService.win32.ts index 84a38e9b2a238..4144cc09c9c4a 100644 --- a/src/vs/platform/update/electron-main/updateService.win32.ts +++ b/src/vs/platform/update/electron-main/updateService.win32.ts @@ -55,7 +55,7 @@ export class Win32UpdateService extends AbstractUpdateService { @memoize get cachePath(): Promise { const result = path.join(tmpdir(), `vscode-update-${product.target}-${process.arch}`); - return pfs.mkdirp(result, void 0).then(() => result); + return pfs.mkdirp(result, undefined).then(() => result); } constructor( @@ -143,7 +143,7 @@ export class Win32UpdateService extends AbstractUpdateService { return this.requestService.request({ url }, CancellationToken.None) .then(context => download(downloadPath, context)) - .then(hash ? () => checksum(downloadPath, update.hash) : () => void 0) + .then(hash ? () => checksum(downloadPath, update.hash) : () => undefined) .then(() => pfs.rename(downloadPath, updatePackagePath)) .then(() => updatePackagePath); }); @@ -164,7 +164,7 @@ export class Win32UpdateService extends AbstractUpdateService { }); }); }) - .then(void 0, err => { + .then(undefined, err => { this.logService.error(err); /* __GDPR__ "update:notAvailable" : { @@ -210,11 +210,11 @@ export class Win32UpdateService extends AbstractUpdateService { protected async doApplyUpdate(): Promise { if (this.state.type !== StateType.Downloaded && this.state.type !== StateType.Downloading) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } if (!this.availableUpdate) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } const update = this.state.update; diff --git a/src/vs/platform/windows/electron-main/windowsService.ts b/src/vs/platform/windows/electron-main/windowsService.ts index 5539c9cea83a6..6cbf2e989a696 100644 --- a/src/vs/platform/windows/electron-main/windowsService.ts +++ b/src/vs/platform/windows/electron-main/windowsService.ts @@ -171,7 +171,7 @@ export class WindowsService implements IWindowsService, IURLHandler, IDisposable async addRecentlyOpened(files: URI[]): Promise { this.logService.trace('windowsService#addRecentlyOpened'); - this.historyService.addRecentlyOpened(void 0, files); + this.historyService.addRecentlyOpened(undefined, files); } async removeFromRecentlyOpened(paths: Array): Promise { @@ -289,7 +289,7 @@ export class WindowsService implements IWindowsService, IURLHandler, IDisposable async openWindow(windowId: number, paths: URI[], options?: { forceNewWindow?: boolean, forceReuseWindow?: boolean, forceOpenWorkspaceAsFile?: boolean, args?: ParsedArgs }): Promise { this.logService.trace('windowsService#openWindow'); if (!paths || !paths.length) { - return void 0; + return undefined; } this.windowsMainService.open({ @@ -466,7 +466,7 @@ export class WindowsService implements IWindowsService, IURLHandler, IDisposable return fallback(); } - return void 0; + return undefined; } dispose(): void { diff --git a/src/vs/platform/workspace/common/workspace.ts b/src/vs/platform/workspace/common/workspace.ts index 47169368c6598..8abb0ca735d7a 100644 --- a/src/vs/platform/workspace/common/workspace.ts +++ b/src/vs/platform/workspace/common/workspace.ts @@ -243,7 +243,7 @@ function parseWorkspaceFolders(configuredFolders: IStoredWorkspaceFolder[], rela } } if (!uri) { - return void 0; + return undefined; } return new WorkspaceFolder({ uri, name: configuredFolder.name! /*is ensured in caller*/, index }, configuredFolder); }); diff --git a/src/vs/platform/workspaces/test/electron-main/workspacesMainService.test.ts b/src/vs/platform/workspaces/test/electron-main/workspacesMainService.test.ts index cc09cbec88606..bd72f12615e37 100644 --- a/src/vs/platform/workspaces/test/electron-main/workspacesMainService.test.ts +++ b/src/vs/platform/workspaces/test/electron-main/workspacesMainService.test.ts @@ -40,11 +40,11 @@ suite('WorkspacesMainService', () => { } function createWorkspace(folders: string[], names?: string[]) { - return service.createWorkspace(folders.map((folder, index) => ({ uri: URI.file(folder), name: names ? names[index] : void 0 } as IWorkspaceFolderCreationData))); + return service.createWorkspace(folders.map((folder, index) => ({ uri: URI.file(folder), name: names ? names[index] : undefined } as IWorkspaceFolderCreationData))); } function createWorkspaceSync(folders: string[], names?: string[]) { - return service.createWorkspaceSync(folders.map((folder, index) => ({ uri: URI.file(folder), name: names ? names[index] : void 0 } as IWorkspaceFolderCreationData))); + return service.createWorkspaceSync(folders.map((folder, index) => ({ uri: URI.file(folder), name: names ? names[index] : undefined } as IWorkspaceFolderCreationData))); } const environmentService = new TestEnvironmentService(parseArgs(process.argv), process.execPath); diff --git a/src/vs/workbench/api/browser/viewsContainersExtensionPoint.ts b/src/vs/workbench/api/browser/viewsContainersExtensionPoint.ts index 7de2b9f8ff9ba..8d94068fdcbce 100644 --- a/src/vs/workbench/api/browser/viewsContainersExtensionPoint.ts +++ b/src/vs/workbench/api/browser/viewsContainersExtensionPoint.ts @@ -94,7 +94,7 @@ class ViewsContainersExtensionHandler implements IWorkbenchContribution { const cssClass = `extensionViewlet-test`; const icon = URI.parse(require.toUrl('./media/test.svg')); - this.registerCustomViewlet({ id: TEST_VIEW_CONTAINER_ID, title, icon }, TEST_VIEW_CONTAINER_ORDER, cssClass, void 0); + this.registerCustomViewlet({ id: TEST_VIEW_CONTAINER_ID, title, icon }, TEST_VIEW_CONTAINER_ORDER, cssClass, undefined); } private handleAndRegisterCustomViewContainers() { diff --git a/src/vs/workbench/api/browser/viewsExtensionPoint.ts b/src/vs/workbench/api/browser/viewsExtensionPoint.ts index a45ff4401bf61..f85e56dc42169 100644 --- a/src/vs/workbench/api/browser/viewsExtensionPoint.ts +++ b/src/vs/workbench/api/browser/viewsExtensionPoint.ts @@ -137,7 +137,7 @@ class ViewsContainersExtensionHandler implements IWorkbenchContribution { canToggleVisibility: true, collapsed: this.showCollapsed(container), treeView: this.instantiationService.createInstance(CustomTreeView, item.id, container), - order: CanonicalExtensionIdentifier.equals(extension.description.identifier, container.extensionId) ? index + 1 : void 0 + order: CanonicalExtensionIdentifier.equals(extension.description.identifier, container.extensionId) ? index + 1 : undefined }; viewIds.push(viewDescriptor.id); diff --git a/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts b/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts index 84947a031ca39..539e9b071e929 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts @@ -141,13 +141,13 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb this.debugService.addFunctionBreakpoint(dto.functionName, dto.id); } } - return void 0; + return undefined; } public $unregisterBreakpoints(breakpointIds: string[], functionBreakpointIds: string[]): Promise { breakpointIds.forEach(id => this.debugService.removeBreakpoints(id)); functionBreakpointIds.forEach(id => this.debugService.removeFunctionBreakpoints(id)); - return void 0; + return undefined; } diff --git a/src/vs/workbench/api/electron-browser/mainThreadDecorations.ts b/src/vs/workbench/api/electron-browser/mainThreadDecorations.ts index 1468bc1a512a3..37cd9749381cd 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadDecorations.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadDecorations.ts @@ -58,7 +58,7 @@ class DecorationRequestsQueue { // reset this._requests = []; this._resolver = []; - this._timer = void 0; + this._timer = undefined; }, 0); } } diff --git a/src/vs/workbench/api/electron-browser/mainThreadDocuments.ts b/src/vs/workbench/api/electron-browser/mainThreadDocuments.ts index 3080eafc6a141..325d34af0880e 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadDocuments.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadDocuments.ts @@ -202,7 +202,7 @@ export class MainThreadDocuments implements MainThreadDocumentsShape { } $tryCreateDocument(options?: { language?: string, content?: string }): Promise { - return this._doCreateUntitled(void 0, options ? options.language : void 0, options ? options.content : void 0); + return this._doCreateUntitled(undefined, options ? options.language : undefined, options ? options.content : undefined); } private _handleAsResourceInput(uri: URI): Promise { diff --git a/src/vs/workbench/api/electron-browser/mainThreadEditors.ts b/src/vs/workbench/api/electron-browser/mainThreadEditors.ts index 21d557df45d98..5455438d38a3c 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadEditors.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadEditors.ts @@ -166,7 +166,7 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape { return Promise.reject(disposed(`TextEditor(${id})`)); } this._documentsAndEditors.getEditor(id).setSelections(selections); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } $trySetDecorations(id: string, key: string, ranges: IDecorationOptions[]): Promise { @@ -175,7 +175,7 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape { return Promise.reject(disposed(`TextEditor(${id})`)); } this._documentsAndEditors.getEditor(id).setDecorations(key, ranges); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } $trySetDecorationsFast(id: string, key: string, ranges: number[]): Promise { @@ -184,7 +184,7 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape { return Promise.reject(disposed(`TextEditor(${id})`)); } this._documentsAndEditors.getEditor(id).setDecorationsFast(key, ranges); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } $tryRevealRange(id: string, range: IRange, revealType: TextEditorRevealType): Promise { @@ -200,7 +200,7 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape { return Promise.reject(disposed(`TextEditor(${id})`)); } this._documentsAndEditors.getEditor(id).setConfiguration(options); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } $tryApplyEdits(id: string, modelVersionId: number, edits: ISingleEditOperation[], opts: IApplyEditsOptions): Promise { @@ -272,20 +272,20 @@ CommandsRegistry.registerCommand('_workbench.open', function (accessor: Services if (options || typeof position === 'number') { // use editor options or editor view column as a hint to use the editor service for opening - return editorService.openEditor({ resource, options, label }, viewColumnToEditorGroup(editorGroupService, position)).then(_ => void 0); + return editorService.openEditor({ resource, options, label }, viewColumnToEditorGroup(editorGroupService, position)).then(_ => undefined); } if (resource && resource.scheme === 'command') { // do not allow to execute commands from here - return Promise.resolve(void 0); + return Promise.resolve(undefined); } if (resource && (resource.scheme === product.urlProtocol || /^vscode/.test(resource.scheme))) { - return urlService.open(resource).then(_ => void 0); + return urlService.open(resource).then(_ => undefined); } // finally, delegate to opener service - return openerService.open(resource).then(_ => void 0); + return openerService.open(resource).then(_ => undefined); }); @@ -305,5 +305,5 @@ CommandsRegistry.registerCommand('_workbench.diff', function (accessor: Services label = localize('diffLeftRightLabel', "{0} ⟷ {1}", leftResource.toString(true), rightResource.toString(true)); } - return editorService.openEditor({ leftResource, rightResource, label, description, options }, viewColumnToEditorGroup(editorGroupService, position)).then(() => void 0); + return editorService.openEditor({ leftResource, rightResource, label, description, options }, viewColumnToEditorGroup(editorGroupService, position)).then(() => undefined); }); diff --git a/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts b/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts index 33d17085fc9b5..6c52cbc93789e 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts @@ -61,7 +61,7 @@ export class HeapService implements IHeapService { return import('gc-signals').then(({ GCSignal, consumeSignals }) => { - if (this._consumeHandle === void 0) { + if (this._consumeHandle === undefined) { // ensure that there is one consumer of signals this._consumeHandle = setInterval(() => { const ids = consumeSignals(); diff --git a/src/vs/workbench/api/electron-browser/mainThreadMessageService.ts b/src/vs/workbench/api/electron-browser/mainThreadMessageService.ts index 90540a4f020b7..4e2d67922fc62 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadMessageService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadMessageService.ts @@ -98,7 +98,7 @@ export class MainThreadMessageService implements MainThreadMessageServiceShape { } private _showModalMessage(severity: Severity, message: string, commands: { title: string; isCloseAffordance: boolean; handle: number; }[]): Promise { - let cancelId: number | undefined = void 0; + let cancelId: number | undefined = undefined; const buttons = commands.map((command, index) => { if (command.isCloseAffordance === true) { @@ -108,7 +108,7 @@ export class MainThreadMessageService implements MainThreadMessageServiceShape { return command.title; }); - if (cancelId === void 0) { + if (cancelId === undefined) { if (buttons.length > 0) { buttons.push(nls.localize('cancel', "Cancel")); } else { diff --git a/src/vs/workbench/api/electron-browser/mainThreadTask.ts b/src/vs/workbench/api/electron-browser/mainThreadTask.ts index c583a9a4c23e2..e4d3db05dfe45 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadTask.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadTask.ts @@ -76,7 +76,7 @@ namespace TaskDefinitionDTO { } export function to(value: TaskDefinitionDTO, executeOnly: boolean): KeyedTaskIdentifier { let result = TaskDefinition.createTaskIdentifier(value, console); - if (result === void 0 && executeOnly) { + if (result === undefined && executeOnly) { result = { _key: generateUuid(), type: '$executeOnly' @@ -88,13 +88,13 @@ namespace TaskDefinitionDTO { namespace TaskPresentationOptionsDTO { export function from(value: PresentationOptions): TaskPresentationOptionsDTO { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return undefined; } return Objects.assign(Object.create(null), value); } export function to(value: TaskPresentationOptionsDTO): PresentationOptions { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return PresentationOptions.defaults; } return Objects.assign(Object.create(null), PresentationOptions.defaults, value); @@ -103,13 +103,13 @@ namespace TaskPresentationOptionsDTO { namespace RunOptionsDTO { export function from(value: RunOptions): RunOptionsDTO { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return undefined; } return Objects.assign(Object.create(null), value); } export function to(value: RunOptionsDTO): RunOptions { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return RunOptions.defaults; } return Objects.assign(Object.create(null), RunOptions.defaults, value); @@ -118,7 +118,7 @@ namespace RunOptionsDTO { namespace ProcessExecutionOptionsDTO { export function from(value: CommandOptions): ProcessExecutionOptionsDTO { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return undefined; } return { @@ -127,7 +127,7 @@ namespace ProcessExecutionOptionsDTO { }; } export function to(value: ProcessExecutionOptionsDTO): CommandOptions { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return CommandOptions.defaults; } return { @@ -168,7 +168,7 @@ namespace ProcessExecutionDTO { namespace ShellExecutionOptionsDTO { export function from(value: CommandOptions): ShellExecutionOptionsDTO { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return undefined; } let result: ShellExecutionOptionsDTO = { @@ -183,7 +183,7 @@ namespace ShellExecutionOptionsDTO { return result; } export function to(value: ShellExecutionOptionsDTO): CommandOptions { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return undefined; } let result: CommandOptions = { @@ -212,7 +212,7 @@ namespace ShellExecutionDTO { } export function from(value: CommandConfiguration): ShellExecutionDTO { let result: ShellExecutionDTO = {}; - if (value.name && Types.isString(value.name) && (value.args === void 0 || value.args === null || value.args.length === 0)) { + if (value.name && Types.isString(value.name) && (value.args === undefined || value.args === null || value.args.length === 0)) { result.commandLine = value.name; } else { result.command = value.name; @@ -258,7 +258,7 @@ namespace TaskSourceDTO { export function to(value: TaskSourceDTO, workspace: IWorkspaceContextService): ExtensionTaskSource { let scope: TaskScope; let workspaceFolder: IWorkspaceFolder; - if ((value.scope === void 0) || ((typeof value.scope === 'number') && (value.scope !== TaskScope.Global))) { + if ((value.scope === undefined) || ((typeof value.scope === 'number') && (value.scope !== TaskScope.Global))) { if (workspace.getWorkspace().folders.length === 0) { scope = TaskScope.Global; workspaceFolder = undefined; @@ -292,7 +292,7 @@ namespace TaskHandleDTO { namespace TaskDTO { export function from(task: Task): TaskDTO { - if (task === void 0 || task === null || (!CustomTask.is(task) && !ContributedTask.is(task))) { + if (task === undefined || task === null || (!CustomTask.is(task) && !ContributedTask.is(task))) { return undefined; } let result: TaskDTO = { diff --git a/src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts b/src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts index 127dd97c18f93..3cd0866137a67 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts @@ -54,7 +54,7 @@ export class MainThreadTreeViews extends Disposable implements MainThreadTreeVie const dataProvider = this._dataProviders.get(treeViewId); if (viewer && dataProvider) { const itemsToRefresh = dataProvider.getItemsToRefresh(itemsToRefreshByHandle); - return viewer.refresh(itemsToRefresh.length ? itemsToRefresh : void 0); + return viewer.refresh(itemsToRefresh.length ? itemsToRefresh : undefined); } return null; } @@ -139,7 +139,7 @@ class TreeViewDataProvider implements ITreeViewDataProvider { } getChildren(treeItem?: ITreeItem): Promise { - return Promise.resolve(this._proxy.$getChildren(this.treeViewId, treeItem ? treeItem.handle : void 0) + return Promise.resolve(this._proxy.$getChildren(this.treeViewId, treeItem ? treeItem.handle : undefined) .then( children => this.postGetChildren(children), err => { diff --git a/src/vs/workbench/api/electron-browser/mainThreadUrls.ts b/src/vs/workbench/api/electron-browser/mainThreadUrls.ts index 268228eeed8d6..728a64f88b78a 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadUrls.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadUrls.ts @@ -49,14 +49,14 @@ export class MainThreadUrls implements MainThreadUrlsShape { this.handlers.set(handle, { extensionId, disposable }); this.inactiveExtensionUrlHandler.registerExtensionHandler(extensionId, handler); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } $unregisterUriHandler(handle: number): Promise { const tuple = this.handlers.get(handle); if (!tuple) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } const { extensionId, disposable } = tuple; @@ -65,7 +65,7 @@ export class MainThreadUrls implements MainThreadUrlsShape { this.handlers.delete(handle); disposable.dispose(); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } dispose(): void { diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index 7ada96d59af3d..00a968499681a 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -601,7 +601,7 @@ export function createApiFactory( return extHostConfiguration.onDidChangeConfiguration(listener, thisArgs, disposables); }, getConfiguration(section?: string, resource?: vscode.Uri): vscode.WorkspaceConfiguration { - resource = arguments.length === 1 ? void 0 : resource; + resource = arguments.length === 1 ? undefined : resource; return extHostConfiguration.getConfiguration(section, resource, extension.identifier); }, registerTextDocumentContentProvider(scheme: string, provider: vscode.TextDocumentContentProvider) { diff --git a/src/vs/workbench/api/node/extHostApiCommands.ts b/src/vs/workbench/api/node/extHostApiCommands.ts index 4dad2523f3941..9b5931a4bac26 100644 --- a/src/vs/workbench/api/node/extHostApiCommands.ts +++ b/src/vs/workbench/api/node/extHostApiCommands.ts @@ -109,7 +109,7 @@ export class ExtHostApiCommands { args: [ { name: 'uri', description: 'Uri of a text document', constraint: URI }, { name: 'position', description: 'Position in a text document', constraint: types.Position }, - { name: 'triggerCharacter', description: '(optional) Trigger signature help when the user types the character, like `,` or `(`', constraint: (value: any) => value === void 0 || typeof value === 'string' } + { name: 'triggerCharacter', description: '(optional) Trigger signature help when the user types the character, like `,` or `(`', constraint: (value: any) => value === undefined || typeof value === 'string' } ], returns: 'A promise that resolves to SignatureHelp.' }); @@ -125,8 +125,8 @@ export class ExtHostApiCommands { args: [ { name: 'uri', description: 'Uri of a text document', constraint: URI }, { name: 'position', description: 'Position in a text document', constraint: types.Position }, - { name: 'triggerCharacter', description: '(optional) Trigger completion when the user types the character, like `,` or `(`', constraint: (value: any) => value === void 0 || typeof value === 'string' }, - { name: 'itemResolveCount', description: '(optional) Number of completions to resolve (too large numbers slow down completions)', constraint: (value: any) => value === void 0 || typeof value === 'number' } + { name: 'triggerCharacter', description: '(optional) Trigger completion when the user types the character, like `,` or `(`', constraint: (value: any) => value === undefined || typeof value === 'string' }, + { name: 'itemResolveCount', description: '(optional) Number of completions to resolve (too large numbers slow down completions)', constraint: (value: any) => value === undefined || typeof value === 'number' } ], returns: 'A promise that resolves to a CompletionList-instance.' }); @@ -142,7 +142,7 @@ export class ExtHostApiCommands { description: 'Execute CodeLens provider.', args: [ { name: 'uri', description: 'Uri of a text document', constraint: URI }, - { name: 'itemResolveCount', description: '(optional) Number of lenses that should be resolved and returned. Will only retrun resolved lenses, will impact performance)', constraint: (value: any) => value === void 0 || typeof value === 'number' } + { name: 'itemResolveCount', description: '(optional) Number of lenses that should be resolved and returned. Will only retrun resolved lenses, will impact performance)', constraint: (value: any) => value === undefined || typeof value === 'number' } ], returns: 'A promise that resolves to an array of CodeLens-instances.' }); @@ -235,8 +235,8 @@ export class ExtHostApiCommands { this._register(OpenFolderAPICommand.ID, adjustHandler(OpenFolderAPICommand.execute), { description: 'Open a folder or workspace in the current window or new window depending on the newWindow argument. Note that opening in the same window will shutdown the current extension host process and start a new one on the given folder/workspace unless the newWindow parameter is set to true.', args: [ - { name: 'uri', description: '(optional) Uri of the folder or workspace file to open. If not provided, a native dialog will ask the user for the folder', constraint: (value: any) => value === void 0 || value instanceof URI }, - { name: 'newWindow', description: '(optional) Whether to open the folder/workspace in a new window or the same. Defaults to opening in the same window.', constraint: (value: any) => value === void 0 || typeof value === 'boolean' } + { name: 'uri', description: '(optional) Uri of the folder or workspace file to open. If not provided, a native dialog will ask the user for the folder', constraint: (value: any) => value === undefined || value instanceof URI }, + { name: 'newWindow', description: '(optional) Whether to open the folder/workspace in a new window or the same. Defaults to opening in the same window.', constraint: (value: any) => value === undefined || typeof value === 'boolean' } ] }); @@ -245,7 +245,7 @@ export class ExtHostApiCommands { args: [ { name: 'left', description: 'Left-hand side resource of the diff editor', constraint: URI }, { name: 'right', description: 'Right-hand side resource of the diff editor', constraint: URI }, - { name: 'title', description: '(optional) Human readable title for the diff editor', constraint: (v: any) => v === void 0 || typeof v === 'string' }, + { name: 'title', description: '(optional) Human readable title for the diff editor', constraint: (v: any) => v === undefined || typeof v === 'string' }, { name: 'options', description: '(optional) Editor options, see vscode.TextDocumentShowOptions' } ] }); @@ -254,7 +254,7 @@ export class ExtHostApiCommands { description: 'Opens the provided resource in the editor. Can be a text or binary file, or a http(s) url. If you need more control over the options for opening a text file, use vscode.window.showTextDocument instead.', args: [ { name: 'resource', description: 'Resource to open', constraint: URI }, - { name: 'columnOrOptions', description: '(optional) Either the column in which to open or editor options, see vscode.TextDocumentShowOptions', constraint: (v: any) => v === void 0 || typeof v === 'number' || typeof v === 'object' } + { name: 'columnOrOptions', description: '(optional) Either the column in which to open or editor options, see vscode.TextDocumentShowOptions', constraint: (v: any) => v === undefined || typeof v === 'number' || typeof v === 'object' } ] }); diff --git a/src/vs/workbench/api/node/extHostConfiguration.ts b/src/vs/workbench/api/node/extHostConfiguration.ts index d6c7253da81b2..cf24f3da8185f 100644 --- a/src/vs/workbench/api/node/extHostConfiguration.ts +++ b/src/vs/workbench/api/node/extHostConfiguration.ts @@ -71,7 +71,7 @@ export class ExtHostConfiguration implements ExtHostConfigurationShape { } function parseConfigurationTarget(arg: boolean | ExtHostConfigurationTarget): ConfigurationTarget { - if (arg === void 0 || arg === null) { + if (arg === undefined || arg === null) { return null; } if (typeof arg === 'boolean') { @@ -95,9 +95,9 @@ export class ExtHostConfiguration implements ExtHostConfigurationShape { if (typeof result === 'undefined') { result = defaultValue; } else { - let clonedConfig = void 0; + let clonedConfig = undefined; const cloneOnWriteProxy = (target: any, accessor: string): any => { - let clonedTarget = void 0; + let clonedTarget = undefined; const cloneTarget = () => { clonedConfig = clonedConfig ? clonedConfig : deepClone(config); clonedTarget = clonedTarget ? clonedTarget : lookUp(clonedConfig, accessor); @@ -143,7 +143,7 @@ export class ExtHostConfiguration implements ExtHostConfigurationShape { update: (key: string, value: any, arg: ExtHostConfigurationTarget | boolean) => { key = section ? `${section}.${key}` : key; const target = parseConfigurationTarget(arg); - if (value !== void 0) { + if (value !== undefined) { return this._proxy.$updateConfigurationOption(target, key, value, resource); } else { return this._proxy.$removeConfigurationOption(target, key, resource); @@ -192,7 +192,7 @@ export class ExtHostConfiguration implements ExtHostConfigurationShape { const scope = OVERRIDE_PROPERTY_PATTERN.test(key) ? ConfigurationScope.RESOURCE : this._configurationScopes[key]; const extensionIdText = extensionId ? `[${extensionId.value}] ` : ''; if (ConfigurationScope.RESOURCE === scope) { - if (resource === void 0) { + if (resource === undefined) { console.warn(`${extensionIdText}Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '${key}', provide the URI of a resource or 'null' for any resource.`); } return; diff --git a/src/vs/workbench/api/node/extHostDebugService.ts b/src/vs/workbench/api/node/extHostDebugService.ts index 35b2bb2c1c48d..e012d389d328f 100644 --- a/src/vs/workbench/api/node/extHostDebugService.ts +++ b/src/vs/workbench/api/node/extHostDebugService.ts @@ -361,7 +361,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape { return terminalLauncher.runInTerminal(args, config); } } - return void 0; + return undefined; } public $substituteVariables(folderUri: UriComponents | undefined, config: IConfig): Promise { @@ -469,7 +469,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape { if (da) { da.sendMessage(message); } - return void 0; + return undefined; } public $stopDASession(debugAdapterHandle: number): Promise { @@ -485,7 +485,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape { if (da) { return da.stopSession(); } else { - return void 0; + return undefined; } } @@ -934,27 +934,27 @@ class MultiTracker implements vscode.DebugAdapterTracker { } onWillStartSession(): void { - this.trackers.forEach(t => t.onWillStartSession ? t.onWillStartSession() : (t.startDebugAdapter ? t.startDebugAdapter() : void 0)); + this.trackers.forEach(t => t.onWillStartSession ? t.onWillStartSession() : (t.startDebugAdapter ? t.startDebugAdapter() : undefined)); } onWillReceiveMessage(message: any): void { - this.trackers.forEach(t => t.onWillReceiveMessage ? t.onWillReceiveMessage(message) : (t.toDebugAdapter ? t.toDebugAdapter(message) : void 0)); + this.trackers.forEach(t => t.onWillReceiveMessage ? t.onWillReceiveMessage(message) : (t.toDebugAdapter ? t.toDebugAdapter(message) : undefined)); } onDidSendMessage(message: any): void { - this.trackers.forEach(t => t.onDidSendMessage ? t.onDidSendMessage(message) : (t.fromDebugAdapter ? t.fromDebugAdapter(message) : void 0)); + this.trackers.forEach(t => t.onDidSendMessage ? t.onDidSendMessage(message) : (t.fromDebugAdapter ? t.fromDebugAdapter(message) : undefined)); } onWillStopSession(): void { - this.trackers.forEach(t => t.onWillStopSession ? t.onWillStopSession() : (t.stopDebugAdapter ? t.stopDebugAdapter() : void 0)); + this.trackers.forEach(t => t.onWillStopSession ? t.onWillStopSession() : (t.stopDebugAdapter ? t.stopDebugAdapter() : undefined)); } onError(error: Error): void { - this.trackers.forEach(t => t.onError ? t.onError(error) : (t.debugAdapterError ? t.debugAdapterError(error) : void 0)); + this.trackers.forEach(t => t.onError ? t.onError(error) : (t.debugAdapterError ? t.debugAdapterError(error) : undefined)); } onExit(code: number, signal: string): void { - this.trackers.forEach(t => t.onExit ? t.onExit(code, signal) : (t.debugAdapterExit ? t.debugAdapterExit(code, signal) : void 0)); + this.trackers.forEach(t => t.onExit ? t.onExit(code, signal) : (t.debugAdapterExit ? t.debugAdapterExit(code, signal) : undefined)); } } @@ -985,7 +985,7 @@ class DirectDebugAdapter extends AbstractDebugAdapter implements IDapTransport { // AbstractDebugAdapter startSession(): Promise { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } // AbstractDebugAdapter @@ -997,7 +997,7 @@ class DirectDebugAdapter extends AbstractDebugAdapter implements IDapTransport { // AbstractDebugAdapter stopSession(): Promise { this.stop(); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } // IDapTransport diff --git a/src/vs/workbench/api/node/extHostDecorations.ts b/src/vs/workbench/api/node/extHostDecorations.ts index fea3abefb1efc..344b39ecedc39 100644 --- a/src/vs/workbench/api/node/extHostDecorations.ts +++ b/src/vs/workbench/api/node/extHostDecorations.ts @@ -48,7 +48,7 @@ export class ExtHostDecorations implements ExtHostDecorationsShape { const { handle, uri, id } = request; if (!this._provider.has(handle)) { // might have been unregistered in the meantime - return void 0; + return undefined; } const { provider, extensionId } = this._provider.get(handle); return Promise.resolve(provider.provideDecoration(URI.revive(uri), token)).then(data => { diff --git a/src/vs/workbench/api/node/extHostExtensionActivator.ts b/src/vs/workbench/api/node/extHostExtensionActivator.ts index c4621889421e5..4cd456c47563c 100644 --- a/src/vs/workbench/api/node/extHostExtensionActivator.ts +++ b/src/vs/workbench/api/node/extHostExtensionActivator.ts @@ -10,7 +10,7 @@ import { IExtensionDescription } from 'vs/workbench/services/extensions/common/e import { ExtensionDescriptionRegistry } from 'vs/workbench/services/extensions/node/extensionDescriptionRegistry'; import { CanonicalExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -const NO_OP_VOID_PROMISE = Promise.resolve(void 0); +const NO_OP_VOID_PROMISE = Promise.resolve(undefined); export interface IExtensionMemento { get(key: string, defaultValue: T): T; @@ -288,12 +288,12 @@ export class ExtensionsActivator { private _activateExtensions(extensionDescriptions: IExtensionDescription[], reason: ExtensionActivationReason, recursionLevel: number): Promise { // console.log(recursionLevel, '_activateExtensions: ', extensionDescriptions.map(p => p.id)); if (extensionDescriptions.length === 0) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } extensionDescriptions = extensionDescriptions.filter((p) => !this._activatedExtensions.has(CanonicalExtensionIdentifier.toKey(p.identifier))); if (extensionDescriptions.length === 0) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } if (recursionLevel > 10) { @@ -304,7 +304,7 @@ export class ExtensionsActivator { const error = new Error('More than 10 levels of dependencies (most likely a dependency loop)'); this._activatedExtensions.set(CanonicalExtensionIdentifier.toKey(extensionDescriptions[i].identifier), new FailedExtension(error)); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } let greenMap: { [id: string]: IExtensionDescription; } = Object.create(null), @@ -329,7 +329,7 @@ export class ExtensionsActivator { if (red.length === 0) { // Finally reached only leafs! - return Promise.all(green.map((p) => this._activateExtension(p, reason))).then(_ => void 0); + return Promise.all(green.map((p) => this._activateExtension(p, reason))).then(_ => undefined); } return this._activateExtensions(green, reason, recursionLevel + 1).then(_ => { @@ -341,14 +341,14 @@ export class ExtensionsActivator { const extensionKey = CanonicalExtensionIdentifier.toKey(extensionDescription.identifier); if (this._activatedExtensions.has(extensionKey)) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } if (this._activatingExtensions.has(extensionKey)) { return this._activatingExtensions.get(extensionKey); } - this._activatingExtensions.set(extensionKey, this._host.actualActivateExtension(extensionDescription, reason).then(void 0, (err) => { + this._activatingExtensions.set(extensionKey, this._host.actualActivateExtension(extensionDescription, reason).then(undefined, (err) => { this._host.showMessage(Severity.Error, nls.localize('activationError', "Activating extension '{0}' failed: {1}.", extensionDescription.identifier.value, err.message)); console.error('Activating extension `' + extensionDescription.identifier.value + '` failed: ', err.message); console.log('Here is the error stack: ', err.stack); diff --git a/src/vs/workbench/api/node/extHostExtensionService.ts b/src/vs/workbench/api/node/extHostExtensionService.ts index 8fb2668fae7fd..d9799af6a70e5 100644 --- a/src/vs/workbench/api/node/extHostExtensionService.ts +++ b/src/vs/workbench/api/node/extHostExtensionService.ts @@ -270,7 +270,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape { // activation failed => bubble up the error as the promise result return Promise.reject(extension.activationFailedError); } - return void 0; + return undefined; }); } @@ -302,7 +302,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape { } private _deactivate(extensionId: CanonicalExtensionIdentifier): Promise { - let result = Promise.resolve(void 0); + let result = Promise.resolve(undefined); if (!this._barrier.isOpen()) { return result; @@ -320,9 +320,9 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape { // call deactivate if available try { if (typeof extension.module.deactivate === 'function') { - result = Promise.resolve(extension.module.deactivate()).then(void 0, (err) => { + result = Promise.resolve(extension.module.deactivate()).then(undefined, (err) => { // TODO: Do something with err if this is not the shutdown case - return Promise.resolve(void 0); + return Promise.resolve(undefined); }); } } catch (err) { @@ -467,7 +467,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape { // Handle "eager" activation extensions private _handleEagerExtensions(): Promise { - this._activateByEvent('*', true).then(void 0, (err) => { + this._activateByEvent('*', true).then(undefined, (err) => { console.error(err); }); @@ -476,7 +476,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape { private _handleWorkspaceContainsEagerExtensions(workspace: IWorkspaceData): Promise { if (!workspace || workspace.folders.length === 0) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } return Promise.all( @@ -489,7 +489,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape { private _handleWorkspaceContainsEagerExtension(workspace: IWorkspaceData, desc: IExtensionDescription): Promise { const activationEvents = desc.activationEvents; if (!activationEvents) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } const fileNames: string[] = []; @@ -507,7 +507,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape { } if (fileNames.length === 0 && globPatterns.length === 0) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } const fileNamePromise = Promise.all(fileNames.map((fileName) => this._activateIfFileName(workspace, desc.identifier, fileName))).then(() => { }); @@ -524,7 +524,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape { // the file was found return ( this._activateById(extensionId, new ExtensionActivatedByEvent(true, `workspaceContains:${fileName}`)) - .then(void 0, err => console.error(err)) + .then(undefined, err => console.error(err)) ); } } @@ -536,7 +536,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape { this._extHostLogService.trace(`extensionHostMain#activateIfGlobPatterns: fileSearch, extension: ${extensionId.value}, entryPoint: workspaceContains`); if (globPatterns.length === 0) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } const tokenSource = new CancellationTokenSource(); @@ -545,7 +545,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape { const timer = setTimeout(async () => { tokenSource.cancel(); this._activateById(extensionId, new ExtensionActivatedByEvent(true, `workspaceContainsTimeout:${globPatterns.join(',')}`)) - .then(void 0, err => console.error(err)); + .then(undefined, err => console.error(err)); }, ExtHostExtensionService.WORKSPACE_CONTAINS_TIMEOUT); let exists: boolean; @@ -564,16 +564,16 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape { // a file was found matching one of the glob patterns return ( this._activateById(extensionId, new ExtensionActivatedByEvent(true, `workspaceContains:${globPatterns.join(',')}`)) - .then(void 0, err => console.error(err)) + .then(undefined, err => console.error(err)) ); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } private _handleExtensionTests(): Promise { if (!this._initData.environment.extensionTestsPath || !this._initData.environment.extensionDevelopmentLocationURI) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } // Require the test runner via node require from the provided path @@ -592,7 +592,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape { if (error) { e(error.toString()); } else { - c(void 0); + c(undefined); } // after tests have run, we shutdown the host diff --git a/src/vs/workbench/api/node/extHostLanguageFeatures.ts b/src/vs/workbench/api/node/extHostLanguageFeatures.ts index 9c0aa3f310b32..1069e29fe061e 100644 --- a/src/vs/workbench/api/node/extHostLanguageFeatures.ts +++ b/src/vs/workbench/api/node/extHostLanguageFeatures.ts @@ -840,7 +840,7 @@ class FoldingProviderAdapter { const doc = this._documents.getDocumentData(resource).document; return asPromise(() => this._provider.provideFoldingRanges(doc, context, token)).then(ranges => { if (!Array.isArray(ranges)) { - return void 0; + return undefined; } return ranges.map(typeConvert.FoldingRange.from); }); diff --git a/src/vs/workbench/api/node/extHostQuickOpen.ts b/src/vs/workbench/api/node/extHostQuickOpen.ts index bc64c05120d78..558b592a50fbf 100644 --- a/src/vs/workbench/api/node/extHostQuickOpen.ts +++ b/src/vs/workbench/api/node/extHostQuickOpen.ts @@ -115,7 +115,7 @@ export class ExtHostQuickOpen implements ExtHostQuickOpenShape { return undefined; }); }); - }).then(void 0, err => { + }).then(undefined, err => { if (isPromiseCanceledError(err)) { return undefined; } @@ -140,7 +140,7 @@ export class ExtHostQuickOpen implements ExtHostQuickOpenShape { this._validateInput = options && options.validateInput; return this._proxy.$input(options, typeof this._validateInput === 'function', token) - .then(void 0, err => { + .then(undefined, err => { if (isPromiseCanceledError(err)) { return undefined; } diff --git a/src/vs/workbench/api/node/extHostSCM.ts b/src/vs/workbench/api/node/extHostSCM.ts index e6bb1e7fe3338..2de04903b571b 100644 --- a/src/vs/workbench/api/node/extHostSCM.ts +++ b/src/vs/workbench/api/node/extHostSCM.ts @@ -284,7 +284,7 @@ class ExtHostSourceControlResourceGroup implements vscode.SourceControlResourceG const command = this._resourceStatesCommandsMap.get(handle); if (!command) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } return asPromise(() => this._commands.executeCommand(command.command, ...command.arguments)); @@ -628,11 +628,11 @@ export class ExtHostSCM implements ExtHostSCMShape { const sourceControl = this._sourceControls.get(sourceControlHandle); if (!sourceControl) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } sourceControl.inputBox.$onInputBoxValueChange(value); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } $executeResourceCommand(sourceControlHandle: number, groupHandle: number, handle: number): Promise { @@ -641,13 +641,13 @@ export class ExtHostSCM implements ExtHostSCMShape { const sourceControl = this._sourceControls.get(sourceControlHandle); if (!sourceControl) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } const group = sourceControl.getResourceGroup(groupHandle); if (!group) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } return group.$executeResourceCommand(handle); @@ -709,6 +709,6 @@ export class ExtHostSCM implements ExtHostSCMShape { }); this._selectedSourceControlHandles = set; - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } diff --git a/src/vs/workbench/api/node/extHostStatusBar.ts b/src/vs/workbench/api/node/extHostStatusBar.ts index 5e3522c145198..35d3330e29ece 100644 --- a/src/vs/workbench/api/node/extHostStatusBar.ts +++ b/src/vs/workbench/api/node/extHostStatusBar.ts @@ -125,7 +125,7 @@ class StatusBarMessage { private _messages: { message: string }[] = []; constructor(statusBar: ExtHostStatusBar) { - this._item = statusBar.createStatusBarEntry(void 0, ExtHostStatusBarAlignment.Left, Number.MIN_VALUE); + this._item = statusBar.createStatusBarEntry(undefined, ExtHostStatusBarAlignment.Left, Number.MIN_VALUE); } dispose() { diff --git a/src/vs/workbench/api/node/extHostTask.ts b/src/vs/workbench/api/node/extHostTask.ts index e5400b7e70c24..0f44a5a2a038d 100644 --- a/src/vs/workbench/api/node/extHostTask.ts +++ b/src/vs/workbench/api/node/extHostTask.ts @@ -30,13 +30,13 @@ import { CancellationToken } from 'vs/base/common/cancellation'; namespace TaskDefinitionDTO { export function from(value: vscode.TaskDefinition): TaskDefinitionDTO { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return undefined; } return value; } export function to(value: TaskDefinitionDTO): vscode.TaskDefinition { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return undefined; } return value; @@ -45,13 +45,13 @@ namespace TaskDefinitionDTO { namespace TaskPresentationOptionsDTO { export function from(value: vscode.TaskPresentationOptions): TaskPresentationOptionsDTO { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return undefined; } return value; } export function to(value: TaskPresentationOptionsDTO): vscode.TaskPresentationOptions { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return undefined; } return value; @@ -60,13 +60,13 @@ namespace TaskPresentationOptionsDTO { namespace ProcessExecutionOptionsDTO { export function from(value: vscode.ProcessExecutionOptions): ProcessExecutionOptionsDTO { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return undefined; } return value; } export function to(value: ProcessExecutionOptionsDTO): vscode.ProcessExecutionOptions { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return undefined; } return value; @@ -79,7 +79,7 @@ namespace ProcessExecutionDTO { return candidate && !!candidate.process; } export function from(value: vscode.ProcessExecution): ProcessExecutionDTO { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return undefined; } let result: ProcessExecutionDTO = { @@ -92,7 +92,7 @@ namespace ProcessExecutionDTO { return result; } export function to(value: ProcessExecutionDTO): types.ProcessExecution { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return undefined; } return new types.ProcessExecution(value.process, value.args, value.options); @@ -101,13 +101,13 @@ namespace ProcessExecutionDTO { namespace ShellExecutionOptionsDTO { export function from(value: vscode.ShellExecutionOptions): ShellExecutionOptionsDTO { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return undefined; } return value; } export function to(value: ShellExecutionOptionsDTO): vscode.ShellExecutionOptions { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return undefined; } return value; @@ -120,12 +120,12 @@ namespace ShellExecutionDTO { return candidate && (!!candidate.commandLine || !!candidate.command); } export function from(value: vscode.ShellExecution): ShellExecutionDTO { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return undefined; } let result: ShellExecutionDTO = { }; - if (value.commandLine !== void 0) { + if (value.commandLine !== undefined) { result.commandLine = value.commandLine; } else { result.command = value.command; @@ -137,7 +137,7 @@ namespace ShellExecutionDTO { return result; } export function to(value: ShellExecutionDTO): types.ShellExecution { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return undefined; } if (value.commandLine) { @@ -151,7 +151,7 @@ namespace ShellExecutionDTO { namespace TaskHandleDTO { export function from(value: types.Task): TaskHandleDTO { let folder: UriComponents; - if (value.scope !== void 0 && typeof value.scope !== 'number') { + if (value.scope !== undefined && typeof value.scope !== 'number') { folder = value.scope.uri; } return { @@ -164,7 +164,7 @@ namespace TaskHandleDTO { namespace TaskDTO { export function fromMany(tasks: vscode.Task[], extension: IExtensionDescription): TaskDTO[] { - if (tasks === void 0 || tasks === null) { + if (tasks === undefined || tasks === null) { return []; } let result: TaskDTO[] = []; @@ -178,7 +178,7 @@ namespace TaskDTO { } export function from(value: vscode.Task, extension: IExtensionDescription): TaskDTO { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return undefined; } let execution: ShellExecutionDTO | ProcessExecutionDTO; @@ -220,7 +220,7 @@ namespace TaskDTO { return result; } export function to(value: TaskDTO, workspace: ExtHostWorkspace): types.Task { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return undefined; } let execution: types.ShellExecution | types.ProcessExecution; @@ -232,7 +232,7 @@ namespace TaskDTO { let definition: vscode.TaskDefinition = TaskDefinitionDTO.to(value.definition); let scope: vscode.TaskScope.Global | vscode.TaskScope.Workspace | vscode.WorkspaceFolder; if (value.source) { - if (value.source.scope !== void 0) { + if (value.source.scope !== undefined) { if (typeof value.source.scope === 'number') { scope = value.source.scope; } else { @@ -246,10 +246,10 @@ namespace TaskDTO { return undefined; } let result = new types.Task(definition, scope, value.name, value.source.label, execution, value.problemMatchers); - if (value.isBackground !== void 0) { + if (value.isBackground !== undefined) { result.isBackground = value.isBackground; } - if (value.group !== void 0) { + if (value.group !== undefined) { result.group = types.TaskGroup.from(value.group); } if (value.presentationOptions) { @@ -375,11 +375,11 @@ export class ExtHostTask implements ExtHostTaskShape { public executeTask(extension: IExtensionDescription, task: vscode.Task): Promise { let tTask = (task as types.Task); // We have a preserved ID. So the task didn't change. - if (tTask._id !== void 0) { + if (tTask._id !== undefined) { return this._proxy.$executeTask(TaskHandleDTO.from(tTask)).then(value => this.getTaskExecution(value, task)); } else { let dto = TaskDTO.from(task, extension); - if (dto === void 0) { + if (dto === undefined) { return Promise.reject(new Error('Task is not valid')); } return this._proxy.$executeTask(dto).then(value => this.getTaskExecution(value, task)); @@ -490,9 +490,9 @@ export class ExtHostTask implements ExtHostTaskShape { for (let variable of toResolve.variables) { result.variables[variable] = resolver.resolve(ws, variable); } - if (toResolve.process !== void 0) { + if (toResolve.process !== undefined) { let paths: string[] | undefined = undefined; - if (toResolve.process.path !== void 0) { + if (toResolve.process.path !== undefined) { paths = toResolve.process.path.split(path.delimiter); for (let i = 0; i < paths.length; i++) { paths[i] = resolver.resolve(ws, paths[i]); @@ -500,7 +500,7 @@ export class ExtHostTask implements ExtHostTaskShape { } result.process = win32.findExecutable( resolver.resolve(ws, toResolve.process.name), - toResolve.process.cwd !== void 0 ? resolver.resolve(ws, toResolve.process.cwd) : undefined, + toResolve.process.cwd !== undefined ? resolver.resolve(ws, toResolve.process.cwd) : undefined, paths ); } diff --git a/src/vs/workbench/api/node/extHostTextEditor.ts b/src/vs/workbench/api/node/extHostTextEditor.ts index 61e9417501f6c..4c26b53919330 100644 --- a/src/vs/workbench/api/node/extHostTextEditor.ts +++ b/src/vs/workbench/api/node/extHostTextEditor.ts @@ -604,7 +604,7 @@ export class ExtHostTextEditor implements vscode.TextEditor { } function warnOnError(promise: Promise): void { - promise.then(void 0, (err) => { + promise.then(undefined, (err) => { console.warn(err); }); } diff --git a/src/vs/workbench/api/node/extHostTreeViews.ts b/src/vs/workbench/api/node/extHostTreeViews.ts index c8342cda6669a..9d75a07dd0233 100644 --- a/src/vs/workbench/api/node/extHostTreeViews.ts +++ b/src/vs/workbench/api/node/extHostTreeViews.ts @@ -31,15 +31,15 @@ function toTreeItemLabel(label: any, extension: IExtensionDescription): ITreeIte && typeof label === 'object' && typeof label.label === 'string') { checkProposedApiEnabled(extension); - let highlights: [number, number][] = void 0; + let highlights: [number, number][] = undefined; if (Array.isArray(label.highlights)) { highlights = (<[number, number][]>label.highlights).filter((highlight => highlight.length === 2 && typeof highlight[0] === 'number' && typeof highlight[1] === 'number')); - highlights = highlights.length ? highlights : void 0; + highlights = highlights.length ? highlights : undefined; } return { label: label.label, highlights }; } - return void 0; + return undefined; } @@ -195,7 +195,7 @@ class ExtHostTreeView extends Disposable { } getChildren(parentHandle?: TreeItemHandle): Promise { - const parentElement = parentHandle ? this.getExtensionElement(parentHandle) : void 0; + const parentElement = parentHandle ? this.getExtensionElement(parentHandle) : undefined; if (parentHandle && !parentElement) { console.error(`No tree item with id \'${parentHandle}\' found.`); return Promise.resolve([]); @@ -321,7 +321,7 @@ class ExtHostTreeView extends Disposable { // clear children cache this.clearChildren(parentElement); - const parentNode = parentElement ? this.nodes.get(parentElement) : void 0; + const parentNode = parentElement ? this.nodes.get(parentElement) : undefined; return asPromise(() => this.dataProvider.getChildren(parentElement)) .then(elements => Promise.all( coalesce(elements || []) @@ -341,7 +341,7 @@ class ExtHostTreeView extends Disposable { return this.refreshHandles(handlesToRefresh); } } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } private getHandlesToRefresh(elements: T[]): TreeItemHandle[] { @@ -415,7 +415,7 @@ class ExtHostTreeView extends Disposable { return { item: this.createTreeItem(element, extensionTreeItem, parent), parent, - children: void 0 + children: undefined }; } @@ -425,16 +425,16 @@ class ExtHostTreeView extends Disposable { const icon = this.getLightIconPath(extensionTreeItem); const item = { handle, - parentHandle: parent ? parent.item.handle : void 0, + parentHandle: parent ? parent.item.handle : undefined, label: toTreeItemLabel(extensionTreeItem.label, this.extension), description: extensionTreeItem.description, resourceUri: extensionTreeItem.resourceUri, - tooltip: typeof extensionTreeItem.tooltip === 'string' ? extensionTreeItem.tooltip : void 0, - command: extensionTreeItem.command ? this.commands.toInternal(extensionTreeItem.command) : void 0, + tooltip: typeof extensionTreeItem.tooltip === 'string' ? extensionTreeItem.tooltip : undefined, + command: extensionTreeItem.command ? this.commands.toInternal(extensionTreeItem.command) : undefined, contextValue: extensionTreeItem.contextValue, icon, iconDark: this.getDarkIconPath(extensionTreeItem) || icon, - themeIcon: extensionTreeItem.iconPath instanceof ThemeIcon ? { id: extensionTreeItem.iconPath.id } : void 0, + themeIcon: extensionTreeItem.iconPath instanceof ThemeIcon ? { id: extensionTreeItem.iconPath.id } : undefined, collapsibleState: isUndefinedOrNull(extensionTreeItem.collapsibleState) ? TreeItemCollapsibleState.None : extensionTreeItem.collapsibleState }; @@ -450,7 +450,7 @@ class ExtHostTreeView extends Disposable { const prefix: string = parent ? parent.item.handle : ExtHostTreeView.LABEL_HANDLE_PREFIX; let elementId = treeItemLabel ? treeItemLabel.label : resourceUri ? basename(resourceUri.path) : ''; elementId = elementId.indexOf('/') !== -1 ? elementId.replace('/', '//') : elementId; - const existingHandle = this.nodes.has(element) ? this.nodes.get(element).item.handle : void 0; + const existingHandle = this.nodes.has(element) ? this.nodes.get(element).item.handle : undefined; const childrenNodes = (this.getChildrenNodes(parent) || []); let handle: TreeItemHandle; @@ -477,14 +477,14 @@ class ExtHostTreeView extends Disposable { } return this.getIconPath(extensionTreeItem.iconPath['light']); } - return void 0; + return undefined; } private getDarkIconPath(extensionTreeItem: vscode.TreeItem): URI { if (extensionTreeItem.iconPath && !(extensionTreeItem.iconPath instanceof ThemeIcon) && extensionTreeItem.iconPath['dark']) { return this.getIconPath(extensionTreeItem.iconPath['dark']); } - return void 0; + return undefined; } private getIconPath(iconPath: string | URI): URI { @@ -543,7 +543,7 @@ class ExtHostTreeView extends Disposable { } } } - node.children = void 0; + node.children = undefined; } else { this.clearAll(); } diff --git a/src/vs/workbench/api/node/extHostTypeConverters.ts b/src/vs/workbench/api/node/extHostTypeConverters.ts index 49059e8454377..c6bead707d74a 100644 --- a/src/vs/workbench/api/node/extHostTypeConverters.ts +++ b/src/vs/workbench/api/node/extHostTypeConverters.ts @@ -111,7 +111,7 @@ export namespace Diagnostic { ...Range.from(value.range), message: value.message, source: value.source, - code: isString(value.code) || isNumber(value.code) ? String(value.code) : void 0, + code: isString(value.code) || isNumber(value.code) ? String(value.code) : undefined, severity: DiagnosticSeverity.from(value.severity), relatedInformation: value.relatedInformation && value.relatedInformation.map(DiagnosticRelatedInformation.from), tags: Array.isArray(value.tags) ? value.tags.map(DiagnosticTag.from) : undefined, @@ -929,7 +929,7 @@ export namespace FoldingRangeKind { return modes.FoldingRangeKind.Region; } } - return void 0; + return undefined; } } diff --git a/src/vs/workbench/api/node/extHostTypes.ts b/src/vs/workbench/api/node/extHostTypes.ts index 4d8eb68180df3..7c17d8d7ce14c 100644 --- a/src/vs/workbench/api/node/extHostTypes.ts +++ b/src/vs/workbench/api/node/extHostTypes.ts @@ -1466,7 +1466,7 @@ export class ProcessExecution implements vscode.ProcessExecution { throw illegalArgument('process'); } this._process = process; - if (varg1 !== void 0) { + if (varg1 !== undefined) { if (Array.isArray(varg1)) { this._args = varg1; this._options = varg2; @@ -1474,7 +1474,7 @@ export class ProcessExecution implements vscode.ProcessExecution { this._options = varg1; } } - if (this._args === void 0) { + if (this._args === undefined) { this._args = []; } } @@ -1513,7 +1513,7 @@ export class ProcessExecution implements vscode.ProcessExecution { public computeId(): string { const hash = crypto.createHash('md5'); hash.update('process'); - if (this._process !== void 0) { + if (this._process !== undefined) { hash.update(this._process); } if (this._args && this._args.length > 0) { @@ -1595,10 +1595,10 @@ export class ShellExecution implements vscode.ShellExecution { public computeId(): string { const hash = crypto.createHash('md5'); hash.update('shell'); - if (this._commandLine !== void 0) { + if (this._commandLine !== undefined) { hash.update(this._commandLine); } - if (this._command !== void 0) { + if (this._command !== undefined) { hash.update(typeof this._command === 'string' ? this._command : this._command.value); } if (this._args && this._args.length > 0) { @@ -1688,7 +1688,7 @@ export class Task implements vscode.Task { } private clear(): void { - if (this.__id === void 0) { + if (this.__id === undefined) { return; } this.__id = undefined; @@ -1720,7 +1720,7 @@ export class Task implements vscode.Task { } set definition(value: vscode.TaskDefinition) { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { throw illegalArgument('Kind can\'t be undefined or null'); } this.clear(); diff --git a/src/vs/workbench/api/node/extHostUrls.ts b/src/vs/workbench/api/node/extHostUrls.ts index 59d417f0e1c94..021ed2c384400 100644 --- a/src/vs/workbench/api/node/extHostUrls.ts +++ b/src/vs/workbench/api/node/extHostUrls.ts @@ -45,7 +45,7 @@ export class ExtHostUrls implements ExtHostUrlsShape { const handler = this.handlers.get(handle); if (!handler) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } try { handler.handleUri(URI.revive(uri)); @@ -53,6 +53,6 @@ export class ExtHostUrls implements ExtHostUrlsShape { onUnexpectedError(err); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } diff --git a/src/vs/workbench/api/node/extHostWebview.ts b/src/vs/workbench/api/node/extHostWebview.ts index 06544f1884639..808d6adffeff9 100644 --- a/src/vs/workbench/api/node/extHostWebview.ts +++ b/src/vs/workbench/api/node/extHostWebview.ts @@ -311,7 +311,7 @@ export class ExtHostWebviews implements ExtHostWebviewsShape { panel.dispose(); this._webviewPanels.delete(handle); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } $deserializeWebviewPanel( diff --git a/src/vs/workbench/api/node/extHostWorkspace.ts b/src/vs/workbench/api/node/extHostWorkspace.ts index dbd480222281d..aaf8c1ed1ac74 100644 --- a/src/vs/workbench/api/node/extHostWorkspace.ts +++ b/src/vs/workbench/api/node/extHostWorkspace.ts @@ -233,7 +233,7 @@ export class ExtHostWorkspace implements ExtHostWorkspaceShape { // Trigger on main side if (this._proxy) { const extName = extension.displayName || extension.name; - this._proxy.$updateWorkspaceFolders(extName, index, deleteCount, validatedDistinctWorkspaceFoldersToAdd).then(void 0, error => { + this._proxy.$updateWorkspaceFolders(extName, index, deleteCount, validatedDistinctWorkspaceFoldersToAdd).then(undefined, error => { // in case of an error, make sure to clear out the unconfirmed workspace // because we cannot expect the acknowledgement from the main side for this diff --git a/src/vs/workbench/browser/actions/workspaceCommands.ts b/src/vs/workbench/browser/actions/workspaceCommands.ts index 499ac54a7b597..11e873dbb2be6 100644 --- a/src/vs/workbench/browser/actions/workspaceCommands.ts +++ b/src/vs/workbench/browser/actions/workspaceCommands.ts @@ -73,7 +73,7 @@ CommandsRegistry.registerCommand({ // Add and show Files Explorer viewlet return workspaceEditingService.addFolders(folders.map(folder => ({ uri: folder }))) .then(() => viewletService.openViewlet(viewletService.getDefaultViewletId(), true)) - .then(() => void 0); + .then(() => undefined); }); } }); @@ -87,7 +87,7 @@ CommandsRegistry.registerCommand(PICK_WORKSPACE_FOLDER_COMMAND_ID, function (acc const folders = contextService.getWorkspace().folders; if (!folders.length) { - return void 0; + return undefined; } const folderPicks = folders.map(folder => { @@ -131,7 +131,7 @@ CommandsRegistry.registerCommand(PICK_WORKSPACE_FOLDER_COMMAND_ID, function (acc return quickInputService.pick(folderPicks, options, token).then(pick => { if (!pick) { - return void 0; + return undefined; } return folders[folderPicks.indexOf(pick)]; diff --git a/src/vs/workbench/browser/dnd.ts b/src/vs/workbench/browser/dnd.ts index adcedf61e8fc1..f7c445ca75142 100644 --- a/src/vs/workbench/browser/dnd.ts +++ b/src/vs/workbench/browser/dnd.ts @@ -82,7 +82,7 @@ export function extractResources(e: DragEvent, externalOnly?: boolean): Array { - resources.push({ resource: URI.parse(draggedEditor.resource), backupResource: draggedEditor.backupResource ? URI.parse(draggedEditor.backupResource) : void 0, viewState: draggedEditor.viewState, isExternal: false }); + resources.push({ resource: URI.parse(draggedEditor.resource), backupResource: draggedEditor.backupResource ? URI.parse(draggedEditor.backupResource) : undefined, viewState: draggedEditor.viewState, isExternal: false }); }); } catch (error) { // Invalid transfer @@ -177,7 +177,7 @@ export class ResourcesDropHandler { // Check for special things being dropped return this.doHandleDrop(untitledOrFileResources).then(isWorkspaceOpening => { if (isWorkspaceOpening) { - return void 0; // return early if the drop operation resulted in this window changing to a workspace + return undefined; // return early if the drop operation resulted in this window changing to a workspace } // Add external ones to recently open list unless dropped resource is a workspace @@ -266,7 +266,7 @@ export class ResourcesDropHandler { if (extname(fileOnDiskResource.fsPath) === `.${WORKSPACE_EXTENSION}`) { workspaceResources.workspaces.push(fileOnDiskResource); - return void 0; + return undefined; } // Check for Folder @@ -274,7 +274,7 @@ export class ResourcesDropHandler { if (stat.isDirectory) { workspaceResources.folders.push(stat.resource); } - }, error => void 0); + }, error => undefined); })).then(_ => { const { workspaces, folders } = workspaceResources; @@ -323,7 +323,7 @@ export class SimpleFileResourceDragAndDrop extends DefaultDragAndDrop { return resource.toString(); } - return void 0; + return undefined; } getDragLabel(tree: ITree, elements: any[]): string { @@ -336,7 +336,7 @@ export class SimpleFileResourceDragAndDrop extends DefaultDragAndDrop { return basenameOrAuthority(resource); } - return void 0; + return undefined; } onDragStart(tree: ITree, data: IDragAndDropData, originalEvent: DragMouseEvent): void { @@ -404,7 +404,7 @@ export function fillResourceDataTransfers(accessor: ServicesAccessor, resources: // Add as dragged editor draggedEditors.push({ resource: file.resource.toString(), - backupResource: textFileService.isDirty(file.resource) ? backupFileService.toBackupResource(file.resource).toString() : void 0, + backupResource: textFileService.isDirty(file.resource) ? backupFileService.toBackupResource(file.resource).toString() : undefined, viewState }); }); @@ -438,8 +438,8 @@ export class LocalSelectionTransfer { clearData(proto: T): void { if (this.hasData(proto)) { - this.proto = void 0; - this.data = void 0; + this.proto = undefined; + this.data = undefined; } } @@ -448,7 +448,7 @@ export class LocalSelectionTransfer { return this.data; } - return void 0; + return undefined; } setData(data: T[], proto: T): void { diff --git a/src/vs/workbench/browser/labels.ts b/src/vs/workbench/browser/labels.ts index 7a113d8126ae0..bc3cbc2b0ee95 100644 --- a/src/vs/workbench/browser/labels.ts +++ b/src/vs/workbench/browser/labels.ts @@ -251,7 +251,7 @@ class ResourceLabelWidget extends IconLabel { if (visible && this.needsRedraw) { this.render(this.needsRedraw === Redraw.Basic ? false : true); - this.needsRedraw = void 0; + this.needsRedraw = undefined; } } } @@ -297,18 +297,18 @@ class ResourceLabelWidget extends IconLabel { this.options = options; if (hasResourceChanged) { - this.computedPathLabel = void 0; // reset path label due to resource change + this.computedPathLabel = undefined; // reset path label due to resource change } this.render(hasResourceChanged); } private hasResourceChanged(label: IResourceLabelProps, options: IResourceLabelOptions): boolean { - const newResource = label ? label.resource : void 0; - const oldResource = this.label ? this.label.resource : void 0; + const newResource = label ? label.resource : undefined; + const oldResource = this.label ? this.label.resource : undefined; - const newFileKind = options ? options.fileKind : void 0; - const oldFileKind = this.options ? this.options.fileKind : void 0; + const newFileKind = options ? options.fileKind : undefined; + const oldFileKind = this.options ? this.options.fileKind : undefined; if (newFileKind !== oldFileKind) { return true; // same resource but different kind (file, folder) @@ -363,11 +363,11 @@ class ResourceLabelWidget extends IconLabel { } clear(): void { - this.label = void 0; - this.options = void 0; - this.lastKnownConfiguredLangId = void 0; - this.computedIconClasses = void 0; - this.computedPathLabel = void 0; + this.label = undefined; + this.options = undefined; + this.lastKnownConfiguredLangId = undefined; + this.computedIconClasses = undefined; + this.computedPathLabel = undefined; this.setLabel(); } @@ -394,7 +394,7 @@ class ResourceLabelWidget extends IconLabel { } if (clearIconCache) { - this.computedIconClasses = void 0; + this.computedIconClasses = undefined; } if (!this.label) { @@ -461,10 +461,10 @@ class ResourceLabelWidget extends IconLabel { dispose(): void { super.dispose(); - this.label = void 0; - this.options = void 0; - this.lastKnownConfiguredLangId = void 0; - this.computedIconClasses = void 0; - this.computedPathLabel = void 0; + this.label = undefined; + this.options = undefined; + this.lastKnownConfiguredLangId = undefined; + this.computedIconClasses = undefined; + this.computedPathLabel = undefined; } } diff --git a/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts b/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts index d045a40e5fc74..29276c3018a75 100644 --- a/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts +++ b/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts @@ -187,7 +187,7 @@ export class PlaceHolderViewletActivityAction extends ViewletActivityAction { export class PlaceHolderToggleCompositePinnedAction extends ToggleCompositePinnedAction { constructor(id: string, compositeBar: ICompositeBar) { - super({ id, name: id, cssClass: void 0 }, compositeBar); + super({ id, name: id, cssClass: undefined }, compositeBar); } setActivity(activity: IActivity): void { diff --git a/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts b/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts index 76dd1ef23b945..784f7eca309f2 100644 --- a/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts +++ b/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts @@ -77,7 +77,7 @@ export class ActivitybarPart extends Part { } } - this.compositeBar = this._register(this.instantiationService.createInstance(CompositeBar, this.cachedViewlets.map(v => ({ id: v.id, name: void 0, visible: v.visible, order: v.order, pinned: v.pinned })), { + this.compositeBar = this._register(this.instantiationService.createInstance(CompositeBar, this.cachedViewlets.map(v => ({ id: v.id, name: undefined, visible: v.visible, order: v.order, pinned: v.pinned })), { icon: true, orientation: ActionsOrientation.VERTICAL, openComposite: (compositeId: string) => this.viewletService.openViewlet(compositeId, true), @@ -260,7 +260,7 @@ export class ActivitybarPart extends Part { } else { const cachedComposite = this.cachedViewlets.filter(c => c.id === compositeId)[0]; compositeActions = { - activityAction: this.instantiationService.createInstance(PlaceHolderViewletActivityAction, compositeId, cachedComposite ? URI.revive(cachedComposite.iconUrl) : void 0), + activityAction: this.instantiationService.createInstance(PlaceHolderViewletActivityAction, compositeId, cachedComposite ? URI.revive(cachedComposite.iconUrl) : undefined), pinnedAction: new PlaceHolderToggleCompositePinnedAction(compositeId, this.compositeBar) }; } @@ -403,10 +403,10 @@ export class ActivitybarPart extends Part { const views: { when: string }[] = []; if (viewContainer) { for (const { when } of this.viewsService.getViewDescriptors(viewContainer).allViewDescriptors) { - views.push({ when: when ? when.serialize() : void 0 }); + views.push({ when: when ? when.serialize() : undefined }); } } - state.push({ id: compositeItem.id, iconUrl: viewlet.iconUrl, views, pinned: compositeItem && compositeItem.pinned, order: compositeItem ? compositeItem.order : void 0, visible: compositeItem && compositeItem.visible }); + state.push({ id: compositeItem.id, iconUrl: viewlet.iconUrl, views, pinned: compositeItem && compositeItem.pinned, order: compositeItem ? compositeItem.order : undefined, visible: compositeItem && compositeItem.visible }); } } this.cachedViewletsValue = JSON.stringify(state); @@ -415,7 +415,7 @@ export class ActivitybarPart extends Part { private getCachedViewlets(): ICachedViewlet[] { const storedStates = >JSON.parse(this.cachedViewletsValue); const cachedViewlets = storedStates.map(c => { - const serialized: ICachedViewlet = typeof c === 'string' /* migration from pinned states to composites states */ ? { id: c, pinned: true, order: void 0, visible: true, iconUrl: void 0, views: void 0 } : c; + const serialized: ICachedViewlet = typeof c === 'string' /* migration from pinned states to composites states */ ? { id: c, pinned: true, order: undefined, visible: true, iconUrl: undefined, views: undefined } : c; serialized.visible = isUndefinedOrNull(serialized.visible) ? true : serialized.visible; return serialized; }); diff --git a/src/vs/workbench/browser/parts/compositeBar.ts b/src/vs/workbench/browser/parts/compositeBar.ts index b235c20b06a0f..60469017c6962 100644 --- a/src/vs/workbench/browser/parts/compositeBar.ts +++ b/src/vs/workbench/browser/parts/compositeBar.ts @@ -383,7 +383,7 @@ export class CompositeBar extends Widget implements ICompositeBar { CompositeOverflowActivityActionItem, this.compositeOverflowAction, () => this.getOverflowingComposites(), - () => this.model.activeItem ? this.model.activeItem.id : void 0, + () => this.model.activeItem ? this.model.activeItem.id : undefined, (compositeId: string) => { const item = this.model.findItem(compositeId); return item && item.activity[0] && item.activity[0].badge; @@ -671,7 +671,7 @@ class CompositeBarModel { deactivate(): boolean { if (this.activeItem) { this.activeItem.activityAction.deactivate(); - this.activeItem = void 0; + this.activeItem = undefined; return true; } return false; diff --git a/src/vs/workbench/browser/parts/compositePart.ts b/src/vs/workbench/browser/parts/compositePart.ts index 48c8657ba130f..cc6750f0f8204 100644 --- a/src/vs/workbench/browser/parts/compositePart.ts +++ b/src/vs/workbench/browser/parts/compositePart.ts @@ -227,7 +227,7 @@ export abstract class CompositePart extends Part { // Fill Content and Actions // Make sure that the user meanwhile did not open another composite or closed the part containing the composite if (!this.activeComposite || composite.getId() !== this.activeComposite.getId()) { - return void 0; + return undefined; } // Take Composite on-DOM and show diff --git a/src/vs/workbench/browser/parts/editor/baseEditor.ts b/src/vs/workbench/browser/parts/editor/baseEditor.ts index f8e3014ad63a4..23bf5f97ee5fb 100644 --- a/src/vs/workbench/browser/parts/editor/baseEditor.ts +++ b/src/vs/workbench/browser/parts/editor/baseEditor.ts @@ -216,7 +216,7 @@ export class EditorMemento implements IEditorMemento { loadEditorState(group: IEditorGroup, resourceOrEditor: URI | EditorInput): T { const resource = this.doGetResource(resourceOrEditor); if (!resource || !group) { - return void 0; // we are not in a good state to load any state for a resource + return undefined; // we are not in a good state to load any state for a resource } const cache = this.doLoad(); @@ -226,7 +226,7 @@ export class EditorMemento implements IEditorMemento { return mementoForResource[group.id]; } - return void 0; + return undefined; } clearEditorState(resource: URI, group?: IEditorGroup): void; diff --git a/src/vs/workbench/browser/parts/editor/binaryEditor.ts b/src/vs/workbench/browser/parts/editor/binaryEditor.ts index 733a359cb2206..a9fac60ae988d 100644 --- a/src/vs/workbench/browser/parts/editor/binaryEditor.ts +++ b/src/vs/workbench/browser/parts/editor/binaryEditor.ts @@ -78,7 +78,7 @@ export abstract class BaseBinaryResourceEditor extends BaseEditor { // Check for cancellation if (token.isCancellationRequested) { - return void 0; + return undefined; } // Assert Model instance @@ -97,7 +97,7 @@ export abstract class BaseBinaryResourceEditor extends BaseEditor { meta => this.handleMetadataChanged(meta) ); - return void 0; + return undefined; }); }); } diff --git a/src/vs/workbench/browser/parts/editor/editor.contribution.ts b/src/vs/workbench/browser/parts/editor/editor.contribution.ts index 3ab4eb91b1591..f54b198ae6907 100644 --- a/src/vs/workbench/browser/parts/editor/editor.contribution.ts +++ b/src/vs/workbench/browser/parts/editor/editor.contribution.ts @@ -139,7 +139,7 @@ class UntitledEditorInputFactory implements IEditorInputFactory { return instantiationService.invokeFunction(accessor => { const deserialized: ISerializedUntitledEditorInput = JSON.parse(serializedEditorInput); const resource = !!deserialized.resourceJSON ? URI.revive(deserialized.resourceJSON) : URI.parse(deserialized.resource); - const filePath = resource.scheme === Schemas.file ? resource.fsPath : void 0; + const filePath = resource.scheme === Schemas.file ? resource.fsPath : undefined; const language = deserialized.modeId; const encoding = deserialized.encoding; diff --git a/src/vs/workbench/browser/parts/editor/editor.ts b/src/vs/workbench/browser/parts/editor/editor.ts index 7fb2b96ca9017..2c460e95757f0 100644 --- a/src/vs/workbench/browser/parts/editor/editor.ts +++ b/src/vs/workbench/browser/parts/editor/editor.ts @@ -119,7 +119,7 @@ export interface IEditorGroupView extends IDisposable, ISerializableView, IEdito } export function getActiveTextEditorOptions(group: IEditorGroup, expectedActiveEditor?: IEditorInput, presetOptions?: EditorOptions): EditorOptions { - const activeGroupCodeEditor = group.activeControl ? getCodeEditor(group.activeControl.getControl()) : void 0; + const activeGroupCodeEditor = group.activeControl ? getCodeEditor(group.activeControl.getControl()) : undefined; if (activeGroupCodeEditor) { if (!expectedActiveEditor || expectedActiveEditor.matches(group.activeEditor)) { return TextEditorOptions.fromEditor(activeGroupCodeEditor, presetOptions); diff --git a/src/vs/workbench/browser/parts/editor/editorActions.ts b/src/vs/workbench/browser/parts/editor/editorActions.ts index 5a7979e0df70f..6277d9b2e1116 100644 --- a/src/vs/workbench/browser/parts/editor/editorActions.ts +++ b/src/vs/workbench/browser/parts/editor/editorActions.ts @@ -473,7 +473,7 @@ export class CloseEditorAction extends Action { } run(context?: IEditorCommandsContext): Promise { - return this.commandService.executeCommand(CLOSE_EDITOR_COMMAND_ID, void 0, context); + return this.commandService.executeCommand(CLOSE_EDITOR_COMMAND_ID, undefined, context); } } @@ -624,7 +624,7 @@ export abstract class BaseCloseAllAction extends Action { // Otherwise ask for combined confirmation return this.textFileService.confirmSave().then(confirm => { if (confirm === ConfirmResult.CANCEL) { - return void 0; + return undefined; } let saveOrRevertPromise: Promise; @@ -639,7 +639,7 @@ export abstract class BaseCloseAllAction extends Action { return this.doCloseAll(); } - return void 0; + return undefined; }); }); } @@ -677,7 +677,7 @@ export class CloseAllEditorGroupsAction extends BaseCloseAllAction { @ITextFileService textFileService: ITextFileService, @IEditorGroupsService editorGroupService: IEditorGroupsService ) { - super(id, label, void 0, textFileService, editorGroupService); + super(id, label, undefined, textFileService, editorGroupService); } protected doCloseAll(): Promise { @@ -787,7 +787,7 @@ export class BaseMoveGroupAction extends Action { } } - return void 0; + return undefined; } } @@ -964,7 +964,7 @@ export class OpenNextEditor extends BaseNavigateEditorAction { return { editor: previousGroupEditors[0], groupId: nextGroup.id }; } - return void 0; + return undefined; } } @@ -999,7 +999,7 @@ export class OpenPreviousEditor extends BaseNavigateEditorAction { return { editor: previousGroupEditors[previousGroupEditors.length - 1], groupId: previousGroup.id }; } - return void 0; + return undefined; } } diff --git a/src/vs/workbench/browser/parts/editor/editorCommands.ts b/src/vs/workbench/browser/parts/editor/editorCommands.ts index 6dd8dae8ad9b9..15a9d7671eea6 100644 --- a/src/vs/workbench/browser/parts/editor/editorCommands.ts +++ b/src/vs/workbench/browser/parts/editor/editorCommands.ts @@ -267,8 +267,8 @@ function registerDiffEditorCommands(): void { KeybindingsRegistry.registerCommandAndKeybindingRule({ id: TOGGLE_DIFF_SIDE_BY_SIDE, weight: KeybindingWeight.WorkbenchContrib, - when: void 0, - primary: void 0, + when: undefined, + primary: undefined, handler: accessor => toggleDiffSideBySide(accessor) }); @@ -287,8 +287,8 @@ function registerDiffEditorCommands(): void { KeybindingsRegistry.registerCommandAndKeybindingRule({ id: TOGGLE_DIFF_IGNORE_TRIM_WHITESPACE, weight: KeybindingWeight.WorkbenchContrib, - when: void 0, - primary: void 0, + when: undefined, + primary: undefined, handler: accessor => toggleDiffIgnoreTrimWhitespace(accessor) }); } @@ -319,7 +319,7 @@ function registerOpenEditorAtIndexCommands(): void { KeybindingsRegistry.registerCommandAndKeybindingRule({ id: OPEN_EDITOR_AT_INDEX_COMMAND_ID + visibleIndex, weight: KeybindingWeight.WorkbenchContrib, - when: void 0, + when: undefined, primary: KeyMod.Alt | toKeyCode(visibleIndex), mac: { primary: KeyMod.WinCtrl | toKeyCode(visibleIndex) }, handler: accessor => openEditorAtIndex(accessor, editorIndex) @@ -340,7 +340,7 @@ function registerOpenEditorAtIndexCommands(): void { case 9: return KeyCode.KEY_9; } - return void 0; + return undefined; } } @@ -351,7 +351,7 @@ function registerFocusEditorGroupAtIndexCommands(): void { KeybindingsRegistry.registerCommandAndKeybindingRule({ id: toCommandId(groupIndex), weight: KeybindingWeight.WorkbenchContrib, - when: void 0, + when: undefined, primary: KeyMod.CtrlCmd | toKeyCode(groupIndex), handler: accessor => { const editorGroupService = accessor.get(IEditorGroupsService); @@ -392,7 +392,7 @@ function registerFocusEditorGroupAtIndexCommands(): void { case 7: return 'workbench.action.focusEighthEditorGroup'; } - return void 0; + return undefined; } function toKeyCode(index: number): KeyCode { @@ -406,7 +406,7 @@ function registerFocusEditorGroupAtIndexCommands(): void { case 7: return KeyCode.KEY_8; } - return void 0; + return undefined; } } @@ -455,7 +455,7 @@ function registerCloseEditorCommands() { KeybindingsRegistry.registerCommandAndKeybindingRule({ id: CLOSE_SAVED_EDITORS_COMMAND_ID, weight: KeybindingWeight.WorkbenchContrib, - when: void 0, + when: undefined, primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.KEY_U), handler: (accessor, resourceOrContext: URI | IEditorCommandsContext, context?: IEditorCommandsContext) => { const editorGroupService = accessor.get(IEditorGroupsService); @@ -475,7 +475,7 @@ function registerCloseEditorCommands() { KeybindingsRegistry.registerCommandAndKeybindingRule({ id: CLOSE_EDITORS_IN_GROUP_COMMAND_ID, weight: KeybindingWeight.WorkbenchContrib, - when: void 0, + when: undefined, primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.KEY_W), handler: (accessor, resourceOrContext: URI | IEditorCommandsContext, context?: IEditorCommandsContext) => { const editorGroupService = accessor.get(IEditorGroupsService); @@ -495,7 +495,7 @@ function registerCloseEditorCommands() { KeybindingsRegistry.registerCommandAndKeybindingRule({ id: CLOSE_EDITOR_COMMAND_ID, weight: KeybindingWeight.WorkbenchContrib, - when: void 0, + when: undefined, primary: KeyMod.CtrlCmd | KeyCode.KEY_W, win: { primary: KeyMod.CtrlCmd | KeyCode.F4, secondary: [KeyMod.CtrlCmd | KeyCode.KEY_W] }, handler: (accessor, resourceOrContext: URI | IEditorCommandsContext, context?: IEditorCommandsContext) => { @@ -544,8 +544,8 @@ function registerCloseEditorCommands() { KeybindingsRegistry.registerCommandAndKeybindingRule({ id: CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID, weight: KeybindingWeight.WorkbenchContrib, - when: void 0, - primary: void 0, + when: undefined, + primary: undefined, mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_T }, handler: (accessor, resourceOrContext: URI | IEditorCommandsContext, context?: IEditorCommandsContext) => { const editorGroupService = accessor.get(IEditorGroupsService); @@ -573,8 +573,8 @@ function registerCloseEditorCommands() { KeybindingsRegistry.registerCommandAndKeybindingRule({ id: CLOSE_EDITORS_TO_THE_RIGHT_COMMAND_ID, weight: KeybindingWeight.WorkbenchContrib, - when: void 0, - primary: void 0, + when: undefined, + primary: undefined, handler: (accessor, resourceOrContext: URI | IEditorCommandsContext, context?: IEditorCommandsContext) => { const editorGroupService = accessor.get(IEditorGroupsService); @@ -590,7 +590,7 @@ function registerCloseEditorCommands() { KeybindingsRegistry.registerCommandAndKeybindingRule({ id: KEEP_EDITOR_COMMAND_ID, weight: KeybindingWeight.WorkbenchContrib, - when: void 0, + when: undefined, primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.Enter), handler: (accessor, resourceOrContext: URI | IEditorCommandsContext, context?: IEditorCommandsContext) => { const editorGroupService = accessor.get(IEditorGroupsService); @@ -607,8 +607,8 @@ function registerCloseEditorCommands() { KeybindingsRegistry.registerCommandAndKeybindingRule({ id: SHOW_EDITORS_IN_GROUP, weight: KeybindingWeight.WorkbenchContrib, - when: void 0, - primary: void 0, + when: undefined, + primary: undefined, handler: (accessor, resourceOrContext: URI | IEditorCommandsContext, context?: IEditorCommandsContext) => { const editorGroupService = accessor.get(IEditorGroupsService); const quickOpenService = accessor.get(IQuickOpenService); @@ -638,7 +638,7 @@ function registerCloseEditorCommands() { }); } - return void 0; + return undefined; }); } @@ -655,7 +655,7 @@ function getCommandsContext(resourceOrContext: URI | IEditorCommandsContext, con return context; } - return void 0; + return undefined; } function resolveCommandsContext(editorGroupService: IEditorGroupsService, context?: IEditorCommandsContext): { group: IEditorGroup, editor: IEditorInput, control: IEditor } { @@ -682,7 +682,7 @@ export function getMultiSelectedEditorContexts(editorContext: IEditorCommandsCon if (list instanceof List && list.getHTMLElement() === document.activeElement) { const elementToContext = (element: IEditorIdentifier | IEditorGroup) => { if (isEditorGroup(element)) { - return { groupId: element.id, editorIndex: void 0 }; + return { groupId: element.id, editorIndex: undefined }; } return { groupId: element.groupId, editorIndex: editorGroupService.getGroup(element.groupId).getIndexOfEditor(element.editor) }; @@ -691,7 +691,7 @@ export function getMultiSelectedEditorContexts(editorContext: IEditorCommandsCon const onlyEditorGroupAndEditor = (e: IEditorIdentifier | IEditorGroup) => isEditorGroup(e) || isEditorIdentifier(e); const focusedElements: Array = list.getFocusedElements().filter(onlyEditorGroupAndEditor); - const focus = editorContext ? editorContext : focusedElements.length ? focusedElements.map(elementToContext)[0] : void 0; // need to take into account when editor context is { group: group } + const focus = editorContext ? editorContext : focusedElements.length ? focusedElements.map(elementToContext)[0] : undefined; // need to take into account when editor context is { group: group } if (focus) { const selection: Array = list.getSelectedElements().filter(onlyEditorGroupAndEditor); diff --git a/src/vs/workbench/browser/parts/editor/editorDropTarget.ts b/src/vs/workbench/browser/parts/editor/editorDropTarget.ts index 69c8c27b04d93..3fdd2db9ec627 100644 --- a/src/vs/workbench/browser/parts/editor/editorDropTarget.ts +++ b/src/vs/workbench/browser/parts/editor/editorDropTarget.ts @@ -96,7 +96,7 @@ class DropOverlay extends Themable { private registerListeners(): void { this._register(new DragAndDropObserver(this.container, { - onDragEnter: e => void 0, + onDragEnter: e => undefined, onDragOver: e => { const isDraggingGroup = this.groupTransfer.hasData(DraggedEditorGroupIdentifier.prototype); const isDraggingEditor = this.editorTransfer.hasData(DraggedEditorIdentifier.prototype); @@ -170,7 +170,7 @@ class DropOverlay extends Themable { return this.accessor.getGroup(this.editorTransfer.getData(DraggedEditorIdentifier.prototype)[0].identifier.groupId); } - return void 0; + return undefined; } private handleDrop(event: DragEvent, splitDirection?: GroupDirection): void { @@ -303,7 +303,7 @@ class DropOverlay extends Themable { mousePosX > edgeWidthThreshold && mousePosX < editorControlWidth - edgeWidthThreshold && mousePosY > edgeHeightThreshold && mousePosY < editorControlHeight - edgeHeightThreshold ) { - splitDirection = void 0; + splitDirection = undefined; } // Offer to split otherwise @@ -413,7 +413,7 @@ class DropOverlay extends Themable { removeClass(this.overlay, 'overlay-move-transition'); // Reset current operation - this.currentDropOperation = void 0; + this.currentDropOperation = undefined; } contains(element: HTMLElement): boolean { @@ -452,7 +452,7 @@ export class EditorDropTarget extends Themable { return this._overlay; } - return void 0; + return undefined; } private registerListeners(): void { @@ -520,7 +520,7 @@ export class EditorDropTarget extends Themable { } } - return void 0; + return undefined; } private updateContainer(isDraggedOver: boolean): void { @@ -536,7 +536,7 @@ export class EditorDropTarget extends Themable { private disposeOverlay(): void { if (this.overlay) { this.overlay.dispose(); - this._overlay = void 0; + this._overlay = undefined; } } } diff --git a/src/vs/workbench/browser/parts/editor/editorGroupView.ts b/src/vs/workbench/browser/parts/editor/editorGroupView.ts index 2de433f9dba05..d5dcfb4a0a4c5 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupView.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupView.ts @@ -134,7 +134,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView { } else if (isSerializedEditorGroup(from)) { this._group = this._register(instantiationService.createInstance(EditorGroup, from)); } else { - this._group = this._register(instantiationService.createInstance(EditorGroup, void 0)); + this._group = this._register(instantiationService.createInstance(EditorGroup, undefined)); } this.disposedEditorsWorker = this._register(new RunOnceWorker(editors => this.handleDisposedEditors(editors), 0)); @@ -278,7 +278,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView { // Toolbar actions const removeGroupAction = this._register(new Action(CLOSE_EDITOR_GROUP_COMMAND_ID, localize('closeGroupAction', "Close"), 'close-editor-group', true, () => { this.accessor.removeGroup(this); return Promise.resolve(true); })); const keybinding = this.keybindingService.lookupKeybinding(removeGroupAction.id); - containerToolbar.push(removeGroupAction, { icon: true, label: false, keybinding: keybinding ? keybinding.getLabel() : void 0 }); + containerToolbar.push(removeGroupAction, { icon: true, label: false, keybinding: keybinding ? keybinding.getLabel() : undefined }); } private createContainerContextMenu(): void { @@ -302,7 +302,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView { // Fill in contributed actions const actions: IAction[] = []; - fillInContextMenuActions(menu, void 0, actions, this.contextMenuService); + fillInContextMenuActions(menu, undefined, actions, this.contextMenuService); // Show it this.contextMenuService.showContextMenu({ @@ -327,7 +327,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView { let target: HTMLElement; if (e instanceof MouseEvent) { if (e.button !== 0) { - return void 0; // only for left mouse click + return undefined; // only for left mouse click } target = e.target as HTMLElement; @@ -484,7 +484,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView { // Close the editor when it is no longer open in any group including diff editors editorsToClose.forEach(editorToClose => { - const resource = editorToClose ? editorToClose.getResource() : void 0; // prefer resource to not close right-hand side editors of a diff editor + const resource = editorToClose ? editorToClose.getResource() : undefined; // prefer resource to not close right-hand side editors of a diff editor if (!this.accessor.groups.some(groupView => groupView.group.contains(resource || editorToClose))) { editorToClose.close(); } @@ -653,7 +653,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView { } get activeControl(): BaseEditor { - return this.editorControl ? this.editorControl.activeControl : void 0; + return this.editorControl ? this.editorControl.activeControl : undefined; } get activeEditor(): EditorInput { @@ -747,7 +747,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView { // Determine options const openEditorOptions: IEditorOpenOptions = { - index: options ? options.index : void 0, + index: options ? options.index : undefined, pinned: !this.accessor.partOptions.enablePreview || editor.isDirty() || (options && options.pinned) || (options && typeof options.index === 'number'), active: this._group.count === 0 || !options || !options.inactive }; @@ -898,7 +898,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView { } private doMoveEditorInsideGroup(editor: EditorInput, moveOptions?: IMoveEditorOptions): void { - const moveToIndex = moveOptions ? moveOptions.index : void 0; + const moveToIndex = moveOptions ? moveOptions.index : undefined; if (typeof moveToIndex !== 'number') { return; // do nothing if we move into same group without index } @@ -1030,7 +1030,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView { this.ignoreOpenEditorErrors = true; } - const options = !focusNext ? EditorOptions.create({ preserveFocus: true }) : void 0; + const options = !focusNext ? EditorOptions.create({ preserveFocus: true }) : undefined; this.openEditor(nextActiveEditor, options).then(() => { this.ignoreOpenEditorErrors = false; }); @@ -1327,7 +1327,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView { // Forward to title control this.titleAreaControl.closeEditor(activeReplacement.editor); - return openEditorResult.then(() => void 0); + return openEditorResult.then(() => undefined); } return Promise.resolve(); diff --git a/src/vs/workbench/browser/parts/editor/editorPart.ts b/src/vs/workbench/browser/parts/editor/editorPart.ts index fb78ef17cc766..3bf1629abf41e 100644 --- a/src/vs/workbench/browser/parts/editor/editorPart.ts +++ b/src/vs/workbench/browser/parts/editor/editorPart.ts @@ -216,7 +216,7 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor get orientation(): GroupOrientation { if (!this.gridWidget) { - return void 0; // we have not been created yet + return undefined; // we have not been created yet } return this.gridWidget.orientation === Orientation.VERTICAL ? GroupOrientation.VERTICAL : GroupOrientation.HORIZONTAL; @@ -758,7 +758,7 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor private resetPreferredSize(): void { // Reset (will be computed upon next access) - this._preferredSize = void 0; + this._preferredSize = undefined; // Event this._onDidPreferredSizeChange.fire(); @@ -857,7 +857,7 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor this.groupViews.forEach(group => group.dispose()); this.groupViews.clear(); - this._activeGroup = void 0; + this._activeGroup = undefined; this.mostRecentActiveGroups = []; } diff --git a/src/vs/workbench/browser/parts/editor/editorStatus.ts b/src/vs/workbench/browser/parts/editor/editorStatus.ts index 213e1c8dc8596..69eefa7d43eb1 100644 --- a/src/vs/workbench/browser/parts/editor/editorStatus.ts +++ b/src/vs/workbench/browser/parts/editor/editorStatus.ts @@ -544,7 +544,7 @@ export class EditorStatus implements IStatusbarItem { private updateStatusBar(): void { const activeControl = this.editorService.activeControl; - const activeCodeEditor = activeControl ? getCodeEditor(activeControl.getControl()) : void 0; + const activeCodeEditor = activeControl ? getCodeEditor(activeControl.getControl()) : undefined; // Update all states this.onScreenReaderModeChange(activeCodeEditor); @@ -825,7 +825,7 @@ export class ShowLanguageExtensionsAction extends Action { } run(): Promise { - return this.commandService.executeCommand('workbench.extensions.action.showExtensionsForLanguage', this.fileExtension).then(() => void 0); + return this.commandService.executeCommand('workbench.extensions.action.showExtensionsForLanguage', this.fileExtension).then(() => undefined); } } @@ -1001,7 +1001,7 @@ export class ChangeModeAction extends Action { return { id, label: lang, - description: (id === currentAssociation) ? nls.localize('currentAssociation', "Current Association") : void 0 + description: (id === currentAssociation) ? nls.localize('currentAssociation', "Current Association") : undefined }; }); @@ -1185,7 +1185,7 @@ export class ChangeEncodingAction extends Action { return pickActionPromise.then(action => { if (!action) { - return void 0; + return undefined; } const resource = toResource(activeControl.input, { supportSideBySide: true }); diff --git a/src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts index 0f3d668b463a1..67be1c251c109 100644 --- a/src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts @@ -40,7 +40,7 @@ export class NoTabsTitleControl extends TitleControl { this.titleContainer.appendChild(labelContainer); // Editor Label - this.editorLabel = this._register(this.instantiationService.createInstance(ResourceLabel, labelContainer, void 0)).element; + this.editorLabel = this._register(this.instantiationService.createInstance(ResourceLabel, labelContainer, undefined)).element; this._register(addDisposableListener(this.editorLabel.element, EventType.CLICK, e => this.onTitleLabelClick(e))); // Breadcrumbs diff --git a/src/vs/workbench/browser/parts/editor/resourceViewer.ts b/src/vs/workbench/browser/parts/editor/resourceViewer.ts index 70f623f975dd4..a0d0e554c8bff 100644 --- a/src/vs/workbench/browser/parts/editor/resourceViewer.ts +++ b/src/vs/workbench/browser/parts/editor/resourceViewer.ts @@ -257,7 +257,7 @@ class ZoomStatusbarItem extends Themable implements IStatusbarItem { private onActiveEditorChanged(): void { this.hide(); - this.onSelectScale = void 0; + this.onSelectScale = undefined; } show(scale: Scale, onSelectScale: (scale: number) => void) { @@ -298,12 +298,12 @@ class ZoomStatusbarItem extends Themable implements IStatusbarItem { private get zoomActions(): Action[] { const scales: Scale[] = [10, 5, 2, 1, 0.5, 0.2, 'fit']; return scales.map(scale => - new Action(`zoom.${scale}`, ZoomStatusbarItem.zoomLabel(scale), void 0, void 0, () => { + new Action(`zoom.${scale}`, ZoomStatusbarItem.zoomLabel(scale), undefined, undefined, () => { if (this.onSelectScale) { this.onSelectScale(scale); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); })); } diff --git a/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts b/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts index b94b5eb95a7c1..072458eec9b88 100644 --- a/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts +++ b/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts @@ -169,7 +169,7 @@ export class SideBySideEditor extends BaseEditor { return Promise.all([ this.detailsEditor.setInput(newInput.details, null, token), this.masterEditor.setInput(newInput.master, options, token)] - ).then(() => void 0); + ).then(() => undefined); } private setNewInput(newInput: SideBySideEditorInput, options: EditorOptions, token: CancellationToken): Promise { diff --git a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts index f819048ab29de..02470efd4ddf3 100644 --- a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts @@ -461,7 +461,7 @@ export class TabsTitleControl extends TitleControl { e.preventDefault(); // required to prevent auto-scrolling (https://github.com/Microsoft/vscode/issues/16690) } - return void 0; // only for left mouse click + return undefined; // only for left mouse click } if (this.originatesFromTabActionBar(e)) { @@ -471,7 +471,7 @@ export class TabsTitleControl extends TitleControl { // Open tabs editor this.group.openEditor(this.group.getEditor(index)); - return void 0; + return undefined; }; const showContextMenu = (e: Event) => { @@ -889,7 +889,7 @@ export class TabsTitleControl extends TitleControl { tabContainer.style.removeProperty('--tab-border-bottom-color'); } - const activeTabBorderColorTop = allowBorderTop ? this.getColor(isGroupActive ? TAB_ACTIVE_BORDER_TOP : TAB_UNFOCUSED_ACTIVE_BORDER_TOP) : void 0; + const activeTabBorderColorTop = allowBorderTop ? this.getColor(isGroupActive ? TAB_ACTIVE_BORDER_TOP : TAB_UNFOCUSED_ACTIVE_BORDER_TOP) : undefined; if (activeTabBorderColorTop) { addClass(tabContainer, 'tab-border-top'); tabContainer.style.setProperty('--tab-border-top-color', activeTabBorderColorTop.toString()); @@ -973,7 +973,7 @@ export class TabsTitleControl extends TitleControl { if (!this.layoutScheduled) { this.layoutScheduled = scheduleAtNextAnimationFrame(() => { this.doLayout(this.dimension); - this.layoutScheduled = void 0; + this.layoutScheduled = undefined; }); } } @@ -1038,7 +1038,7 @@ export class TabsTitleControl extends TitleControl { return this.tabsContainer.children[editorIndex] as HTMLElement; } - return void 0; + return undefined; } private blockRevealActiveTabOnce(): void { diff --git a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts index 07acd4f01a9c5..a987a541f95eb 100644 --- a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts @@ -87,12 +87,12 @@ export class TextDiffEditor extends BaseTextEditor implements ITextDiffEditor { // Check for cancellation if (token.isCancellationRequested) { - return void 0; + return undefined; } // Assert Model Instance if (!(resolvedModel instanceof TextDiffEditorModel) && this.openAsBinary(input, options)) { - return void 0; + return undefined; } // Set Editor Model diff --git a/src/vs/workbench/browser/parts/editor/textEditor.ts b/src/vs/workbench/browser/parts/editor/textEditor.ts index 4dd0e46cb822c..4c39077cefb46 100644 --- a/src/vs/workbench/browser/parts/editor/textEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textEditor.ts @@ -170,7 +170,7 @@ export abstract class BaseTextEditor extends BaseEditor implements ITextEditor { (reason === SaveReason.FOCUS_CHANGE && mode === AutoSaveMode.ON_FOCUS_CHANGE) ) { if (this.textFileService.isDirty()) { - this.textFileService.saveAll(void 0, { reason }); + this.textFileService.saveAll(undefined, { reason }); } } } @@ -311,7 +311,7 @@ export abstract class BaseTextEditor extends BaseEditor implements ITextEditor { protected abstract getAriaLabel(): string; dispose(): void { - this.lastAppliedEditorOptions = void 0; + this.lastAppliedEditorOptions = undefined; super.dispose(); } diff --git a/src/vs/workbench/browser/parts/editor/textResourceEditor.ts b/src/vs/workbench/browser/parts/editor/textResourceEditor.ts index 3340372692685..32c2ff53afaa6 100644 --- a/src/vs/workbench/browser/parts/editor/textResourceEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textResourceEditor.ts @@ -65,7 +65,7 @@ export class AbstractTextResourceEditor extends BaseTextEditor { // Check for cancellation if (token.isCancellationRequested) { - return void 0; + return undefined; } // Assert Model instance @@ -90,7 +90,7 @@ export class AbstractTextResourceEditor extends BaseTextEditor { this.restoreTextResourceEditorViewState(input); } - return void 0; + return undefined; }); }); } diff --git a/src/vs/workbench/browser/parts/editor/titleControl.ts b/src/vs/workbench/browser/parts/editor/titleControl.ts index 494ab9beee1d5..7033afe42b572 100644 --- a/src/vs/workbench/browser/parts/editor/titleControl.ts +++ b/src/vs/workbench/browser/parts/editor/titleControl.ts @@ -319,7 +319,7 @@ export abstract class TitleControl extends Themable { protected getKeybindingLabel(action: IAction): string { const keybinding = this.getKeybinding(action); - return keybinding ? keybinding.getLabel() : void 0; + return keybinding ? keybinding.getLabel() : undefined; } abstract openEditor(editor: IEditorInput): void; diff --git a/src/vs/workbench/browser/parts/notifications/notificationsActions.ts b/src/vs/workbench/browser/parts/notifications/notificationsActions.ts index 027d5a0f109e7..60fa354d73bba 100644 --- a/src/vs/workbench/browser/parts/notifications/notificationsActions.ts +++ b/src/vs/workbench/browser/parts/notifications/notificationsActions.ts @@ -171,7 +171,7 @@ export class NotificationActionRunner extends ActionRunner { this.telemetryService.publicLog('workbenchActionExecuted', { id: action.id, from: 'message' }); // Run and make sure to notify on any error again - super.runAction(action, context).then(void 0, error => this.notificationService.error(error)); + super.runAction(action, context).then(undefined, error => this.notificationService.error(error)); return Promise.resolve(); } diff --git a/src/vs/workbench/browser/parts/notifications/notificationsCenter.ts b/src/vs/workbench/browser/parts/notifications/notificationsCenter.ts index c8becaffe3f7c..ffd4d74dfeea3 100644 --- a/src/vs/workbench/browser/parts/notifications/notificationsCenter.ts +++ b/src/vs/workbench/browser/parts/notifications/notificationsCenter.ts @@ -155,7 +155,7 @@ export class NotificationsCenter extends Themable { private getKeybindingLabel(action: IAction): string { const keybinding = this.keybindingService.lookupKeybinding(action.id); - return keybinding ? keybinding.getLabel() : void 0; + return keybinding ? keybinding.getLabel() : undefined; } private onDidNotificationChange(e: INotificationChangeEvent): void { diff --git a/src/vs/workbench/browser/parts/notifications/notificationsCommands.ts b/src/vs/workbench/browser/parts/notifications/notificationsCommands.ts index 74a944584dc51..1f5f7050de448 100644 --- a/src/vs/workbench/browser/parts/notifications/notificationsCommands.ts +++ b/src/vs/workbench/browser/parts/notifications/notificationsCommands.ts @@ -75,7 +75,7 @@ export function registerNotificationCommands(center: INotificationsCenterControl } } - return void 0; + return undefined; } // Show Notifications Cneter diff --git a/src/vs/workbench/browser/parts/notifications/notificationsViewer.ts b/src/vs/workbench/browser/parts/notifications/notificationsViewer.ts index 541b840266021..54c87b7a8cf9a 100644 --- a/src/vs/workbench/browser/parts/notifications/notificationsViewer.ts +++ b/src/vs/workbench/browser/parts/notifications/notificationsViewer.ts @@ -104,7 +104,7 @@ export class NotificationsListDelegate implements IListVirtualDelegate implements IPanelService { for (const compositeItem of compositeItems) { const panel = allPanels.filter(({ id }) => id === compositeItem.id)[0]; if (panel) { - state.push({ id: panel.id, pinned: compositeItem && compositeItem.pinned, order: compositeItem ? compositeItem.order : void 0, visible: compositeItem && compositeItem.visible }); + state.push({ id: panel.id, pinned: compositeItem && compositeItem.pinned, order: compositeItem ? compositeItem.order : undefined, visible: compositeItem && compositeItem.visible }); } } this.cachedPanelsValue = JSON.stringify(state); @@ -391,7 +391,7 @@ export class PanelPart extends CompositePart implements IPanelService { private getCachedPanels(): ICachedPanel[] { const storedStates = >JSON.parse(this.cachedPanelsValue); const cachedPanels = storedStates.map(c => { - const serialized: ICachedPanel = typeof c === 'string' /* migration from pinned states to composites states */ ? { id: c, pinned: true, order: void 0, visible: true } : c; + const serialized: ICachedPanel = typeof c === 'string' /* migration from pinned states to composites states */ ? { id: c, pinned: true, order: undefined, visible: true } : c; serialized.visible = isUndefinedOrNull(serialized.visible) ? true : serialized.visible; return serialized; }); diff --git a/src/vs/workbench/browser/parts/quickinput/quickInput.ts b/src/vs/workbench/browser/parts/quickinput/quickInput.ts index 64470fdfce745..029666b0cef2c 100644 --- a/src/vs/workbench/browser/parts/quickinput/quickInput.ts +++ b/src/vs/workbench/browser/parts/quickinput/quickInput.ts @@ -1129,7 +1129,7 @@ export class QuickInputService extends Component implements IQuickInputService { } }); input.show(); - Promise.resolve(picks).then(void 0, err => { + Promise.resolve(picks).then(undefined, err => { reject(err); input.hide(); }); diff --git a/src/vs/workbench/browser/parts/quickinput/quickInputBox.ts b/src/vs/workbench/browser/parts/quickinput/quickInputBox.ts index bbba5345326ac..08ede924c14ea 100644 --- a/src/vs/workbench/browser/parts/quickinput/quickInputBox.ts +++ b/src/vs/workbench/browser/parts/quickinput/quickInputBox.ts @@ -24,7 +24,7 @@ export class QuickInputBox { private parent: HTMLElement ) { this.container = dom.append(this.parent, $('.quick-input-box')); - this.inputBox = new InputBox(this.container, void 0); + this.inputBox = new InputBox(this.container, undefined); this.disposables.push(this.inputBox); } diff --git a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts index d42ecfe5ccdac..bec624f8fd963 100644 --- a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts +++ b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts @@ -155,9 +155,9 @@ export class QuickOpenController extends Component implements IQuickOpenService } show(prefix?: string, options?: IShowOptions): Promise { - let quickNavigateConfiguration = options ? options.quickNavigateConfiguration : void 0; - let inputSelection = options ? options.inputSelection : void 0; - let autoFocus = options ? options.autoFocus : void 0; + let quickNavigateConfiguration = options ? options.quickNavigateConfiguration : undefined; + let inputSelection = options ? options.inputSelection : undefined; + let autoFocus = options ? options.autoFocus : undefined; const promiseCompletedOnHide = new Promise(c => { this.promisesToCompleteOnHide.push(c); @@ -529,7 +529,7 @@ export class QuickOpenController extends Component implements IQuickOpenService const model = new QuickOpenModel([new PlaceholderQuickOpenEntry(placeHolderLabel)], this.actionProvider); this.showModel(model, resolvedHandler.getAutoFocus(value, { model, quickNavigateConfiguration: this.quickOpenWidget.getQuickNavigateConfiguration() }), resolvedHandler.getAriaLabel()); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } // Support extra class from handler @@ -709,7 +709,7 @@ class EditorHistoryItemAccessorClass extends QuickOpenItemAccessorClass { } getItemDescription(entry: QuickOpenEntry): string { - return this.allowMatchOnDescription ? entry.getDescription() : void 0; + return this.allowMatchOnDescription ? entry.getDescription() : undefined; } } @@ -808,7 +808,7 @@ export class EditorHistoryEntry extends EditorQuickOpenEntry { } function resourceForEditorHistory(input: EditorInput, fileService: IFileService): URI { - const resource = input ? input.getResource() : void 0; + const resource = input ? input.getResource() : undefined; // For the editor history we only prefer resources that are either untitled or // can be handled by the file service which indicates they are editable resources. @@ -816,7 +816,7 @@ function resourceForEditorHistory(input: EditorInput, fileService: IFileService) return resource; } - return void 0; + return undefined; } export class RemoveFromEditorHistoryAction extends Action { diff --git a/src/vs/workbench/browser/parts/quickopen/quickopen.ts b/src/vs/workbench/browser/parts/quickopen/quickopen.ts index 2f4d95a864cce..e9d1f7a968d1a 100644 --- a/src/vs/workbench/browser/parts/quickopen/quickopen.ts +++ b/src/vs/workbench/browser/parts/quickopen/quickopen.ts @@ -23,7 +23,7 @@ CommandsRegistry.registerCommand(QUICKOPEN_ACTION_ID, function (accessor: Servic const quickOpenService = accessor.get(IQuickOpenService); return quickOpenService.show(typeof prefix === 'string' ? prefix : undefined).then(() => { - return void 0; + return undefined; }); }); @@ -32,7 +32,7 @@ CommandsRegistry.registerCommand(QUICKOPEN_FOCUS_SECONDARY_ACTION_ID, function ( const quickOpenService = accessor.get(IQuickOpenService); return quickOpenService.show(undefined, { autoFocus: { autoFocusSecondEntry: true } }).then(() => { - return void 0; + return undefined; }); }); @@ -52,7 +52,7 @@ export class BaseQuickOpenNavigateAction extends Action { run(event?: any): Promise { const keys = this.keybindingService.lookupKeybindings(this.id); - const quickNavigate = this.quickNavigate ? { keybindings: keys } : void 0; + const quickNavigate = this.quickNavigate ? { keybindings: keys } : undefined; this.quickOpenService.navigate(this.next, quickNavigate); this.quickInputService.navigate(this.next, quickNavigate); diff --git a/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts b/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts index bc312086ebb94..c988f64515921 100644 --- a/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts +++ b/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts @@ -59,7 +59,7 @@ export class StatusbarPart extends Part implements IStatusbarService { addEntry(entry: IStatusbarEntry, alignment: StatusbarAlignment, priority: number = 0): IDisposable { // Render entry in status bar - const el = this.doCreateStatusItem(alignment, priority, entry.showBeak ? 'has-beak' : void 0); + const el = this.doCreateStatusItem(alignment, priority, entry.showBeak ? 'has-beak' : undefined); const item = this.instantiationService.createInstance(StatusBarEntryItem, entry); const toDispose = item.render(el); diff --git a/src/vs/workbench/browser/parts/views/customView.ts b/src/vs/workbench/browser/parts/views/customView.ts index 52eb7f7031a04..961e43eb88cf0 100644 --- a/src/vs/workbench/browser/parts/views/customView.ts +++ b/src/vs/workbench/browser/parts/views/customView.ts @@ -166,7 +166,7 @@ class Root implements ITreeItem { handle = '0'; parentHandle = null; collapsibleState = TreeItemCollapsibleState.Expanded; - children = void 0; + children = undefined; } const noDataProviderMessage = localize('no-dataprovider', "There is no data provider registered that can provide view data."); @@ -461,7 +461,7 @@ export class CustomTreeView extends Disposable implements ITreeView { this.elementsToRefresh.push(...elements); } } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } expand(itemOrItems: ITreeItem | ITreeItem[]): Promise { @@ -469,7 +469,7 @@ export class CustomTreeView extends Disposable implements ITreeView { itemOrItems = Array.isArray(itemOrItems) ? itemOrItems : [itemOrItems]; return this.tree.expandAll(itemOrItems); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } setSelection(items: ITreeItem[]): void { @@ -517,7 +517,7 @@ export class CustomTreeView extends Disposable implements ITreeView { } }); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } private updateContentAreas(): void { @@ -657,13 +657,13 @@ class TreeRenderer implements IRenderer { renderElement(tree: ITree, node: ITreeItem, templateId: string, templateData: ITreeExplorerTemplateData): void { const resource = node.resourceUri ? URI.revive(node.resourceUri) : null; - const treeItemLabel: ITreeItemLabel = node.label ? node.label : resource ? { label: basename(resource.path) } : void 0; - const description = isString(node.description) ? node.description : resource && node.description === true ? this.labelService.getUriLabel(dirname(resource), { relative: true }) : void 0; - const label = treeItemLabel ? treeItemLabel.label : void 0; - const matches = treeItemLabel && treeItemLabel.highlights ? treeItemLabel.highlights.map(([start, end]) => ({ start, end })) : void 0; + const treeItemLabel: ITreeItemLabel = node.label ? node.label : resource ? { label: basename(resource.path) } : undefined; + const description = isString(node.description) ? node.description : resource && node.description === true ? this.labelService.getUriLabel(dirname(resource), { relative: true }) : undefined; + const label = treeItemLabel ? treeItemLabel.label : undefined; + const matches = treeItemLabel && treeItemLabel.highlights ? treeItemLabel.highlights.map(([start, end]) => ({ start, end })) : undefined; const icon = this.themeService.getTheme().type === LIGHT ? node.icon : node.iconDark; const iconUrl = icon ? URI.revive(icon) : null; - const title = node.tooltip ? node.tooltip : resource ? void 0 : label; + const title = node.tooltip ? node.tooltip : resource ? undefined : label; // reset templateData.actionBar.clear(); diff --git a/src/vs/workbench/browser/parts/views/views.ts b/src/vs/workbench/browser/parts/views/views.ts index 8ff19a74ba5b7..a2639643b1474 100644 --- a/src/vs/workbench/browser/parts/views/views.ts +++ b/src/vs/workbench/browser/parts/views/views.ts @@ -460,7 +460,7 @@ export class PersistentContributableViewsModel extends ContributableViewsModel { for (const viewDescriptor of viewDescriptors) { if (viewDescriptor.canToggleVisibility) { const viewState = this.viewStates.get(viewDescriptor.id); - storedViewsVisibilityStates.set(viewDescriptor.id, { id: viewDescriptor.id, isHidden: viewState ? !viewState.visible : void 0 }); + storedViewsVisibilityStates.set(viewDescriptor.id, { id: viewDescriptor.id, isHidden: viewState ? !viewState.visible : undefined }); } } this.storageService.store(this.hiddenViewsStorageId, JSON.stringify(values(storedViewsVisibilityStates)), StorageScope.GLOBAL); diff --git a/src/vs/workbench/browser/quickopen.ts b/src/vs/workbench/browser/quickopen.ts index ca4891c4f1b8a..030dcf0fa0eaa 100644 --- a/src/vs/workbench/browser/quickopen.ts +++ b/src/vs/workbench/browser/quickopen.ts @@ -330,6 +330,6 @@ export class QuickOpenAction extends Action { // Show with prefix this.quickOpenService.show(this.prefix); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } diff --git a/src/vs/workbench/common/actions.ts b/src/vs/workbench/common/actions.ts index 13ecdbceba2bb..b2530b09a9719 100644 --- a/src/vs/workbench/common/actions.ts +++ b/src/vs/workbench/common/actions.ts @@ -87,7 +87,7 @@ Registry.add(Extensions.WorkbenchActions, new class implements IWorkbenchActionR const instantiationService = accessor.get(IInstantiationService); const lifecycleService = accessor.get(ILifecycleService); - Promise.resolve(this.triggerAndDisposeAction(instantiationService, lifecycleService, descriptor, args)).then(void 0, err => { + Promise.resolve(this.triggerAndDisposeAction(instantiationService, lifecycleService, descriptor, args)).then(undefined, err => { notificationService.error(err); }); }; @@ -105,7 +105,7 @@ Registry.add(Extensions.WorkbenchActions, new class implements IWorkbenchActionR if (!actionInstance.enabled) { actionInstance.dispose(); - return void 0; + return undefined; } const from = args && args.from || 'keybinding'; diff --git a/src/vs/workbench/common/editor/editorGroup.ts b/src/vs/workbench/common/editor/editorGroup.ts index be4baa64aa36b..549356667a668 100644 --- a/src/vs/workbench/common/editor/editorGroup.ts +++ b/src/vs/workbench/common/editor/editorGroup.ts @@ -319,7 +319,7 @@ export class EditorGroup extends Disposable { return event.index; } - return void 0; + return undefined; } private doCloseEditor(editor: EditorInput, openNext: boolean, replaced: boolean): EditorCloseEvent | null { @@ -600,7 +600,7 @@ export class EditorGroup extends Disposable { } clone(): EditorGroup { - const group = this.instantiationService.createInstance(EditorGroup, void 0); + const group = this.instantiationService.createInstance(EditorGroup, undefined); group.editors = this.editors.slice(0); group.mru = this.mru.slice(0); group.mapResourceToEditorCount = this.mapResourceToEditorCount.clone(); diff --git a/src/vs/workbench/common/editor/untitledEditorInput.ts b/src/vs/workbench/common/editor/untitledEditorInput.ts index 769a39be5531a..438200b313a2b 100644 --- a/src/vs/workbench/common/editor/untitledEditorInput.ts +++ b/src/vs/workbench/common/editor/untitledEditorInput.ts @@ -262,7 +262,7 @@ export class UntitledEditorInput extends EditorInput implements IEncodingSupport } dispose(): void { - this.modelResolve = void 0; + this.modelResolve = undefined; super.dispose(); } diff --git a/src/vs/workbench/common/notifications.ts b/src/vs/workbench/common/notifications.ts index b6efa0f502e56..46f54206265ea 100644 --- a/src/vs/workbench/common/notifications.ts +++ b/src/vs/workbench/common/notifications.ts @@ -133,7 +133,7 @@ export class NotificationsModel extends Disposable implements INotificationsMode } } - return void 0; + return undefined; } private createViewItem(notification: INotification): INotificationViewItem | null { @@ -258,9 +258,9 @@ export class NotificationViewItemProgress extends Disposable implements INotific this._state.infinite = true; - this._state.total = void 0; - this._state.worked = void 0; - this._state.done = void 0; + this._state.total = undefined; + this._state.worked = undefined; + this._state.done = undefined; this._onDidChange.fire(); } @@ -272,9 +272,9 @@ export class NotificationViewItemProgress extends Disposable implements INotific this._state.done = true; - this._state.infinite = void 0; - this._state.total = void 0; - this._state.worked = void 0; + this._state.infinite = undefined; + this._state.total = undefined; + this._state.worked = undefined; this._onDidChange.fire(); } @@ -286,8 +286,8 @@ export class NotificationViewItemProgress extends Disposable implements INotific this._state.total = value; - this._state.infinite = void 0; - this._state.done = void 0; + this._state.infinite = undefined; + this._state.done = undefined; this._onDidChange.fire(); } @@ -299,8 +299,8 @@ export class NotificationViewItemProgress extends Disposable implements INotific this._state.worked = value; } - this._state.infinite = void 0; - this._state.done = void 0; + this._state.infinite = undefined; + this._state.done = undefined; this._onDidChange.fire(); } @@ -378,7 +378,7 @@ export class NotificationViewItem extends Disposable implements INotificationVie } if (!message) { - return void 0; // we need a message to show + return undefined; // we need a message to show } const raw = message; @@ -587,7 +587,7 @@ export class ChoiceAction extends Action { private _keepOpen: boolean; constructor(id: string, choice: IPromptChoice) { - super(id, choice.label, void 0, true, () => { + super(id, choice.label, undefined, true, () => { // Pass to runner choice.run(); diff --git a/src/vs/workbench/electron-browser/actions.ts b/src/vs/workbench/electron-browser/actions.ts index fc9436d97f846..3eb403d77a610 100644 --- a/src/vs/workbench/electron-browser/actions.ts +++ b/src/vs/workbench/electron-browser/actions.ts @@ -81,7 +81,7 @@ export class CloseWorkspaceAction extends Action { if (this.contextService.getWorkbenchState() === WorkbenchState.EMPTY) { this.notificationService.info(nls.localize('noWorkspaceOpened', "There is currently no workspace opened in this instance to close.")); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } return this.windowService.closeWorkspace(); @@ -320,14 +320,14 @@ export abstract class BaseSwitchWindow extends Action { return this.windowsService.getWindows().then(windows => { const placeHolder = nls.localize('switchWindowPlaceHolder', "Select a window to switch to"); const picks = windows.map(win => { - const resource = win.filename ? URI.file(win.filename) : win.folderUri ? win.folderUri : win.workspace ? URI.file(win.workspace.configPath) : void 0; + const resource = win.filename ? URI.file(win.filename) : win.folderUri ? win.folderUri : win.workspace ? URI.file(win.workspace.configPath) : undefined; const fileKind = win.filename ? FileKind.FILE : win.workspace ? FileKind.ROOT_FOLDER : win.folderUri ? FileKind.FOLDER : FileKind.FILE; return { payload: win.id, label: win.title, iconClasses: getIconClasses(this.modelService, this.modeService, resource, fileKind), - description: (currentWindowId === win.id) ? nls.localize('current', "Current Window") : void 0, - buttons: (!this.isQuickNavigate() && currentWindowId !== win.id) ? [this.closeWindowAction] : void 0 + description: (currentWindowId === win.id) ? nls.localize('current', "Current Window") : undefined, + buttons: (!this.isQuickNavigate() && currentWindowId !== win.id) ? [this.closeWindowAction] : undefined } as (IQuickPickItem & { payload: number }); }); @@ -337,7 +337,7 @@ export abstract class BaseSwitchWindow extends Action { contextKey: 'inWindowsPicker', activeItem: picks[autoFocusIndex], placeHolder, - quickNavigate: this.isQuickNavigate() ? { keybindings: this.keybindingService.lookupKeybindings(this.id) } : void 0, + quickNavigate: this.isQuickNavigate() ? { keybindings: this.keybindingService.lookupKeybindings(this.id) } : undefined, onDidTriggerItemButton: context => { this.windowsService.closeWindow(context.item.payload).then(() => { context.removeItem(); @@ -465,8 +465,8 @@ export abstract class BaseOpenRecentAction extends Action { return this.windowService.openWindow([resource], { forceNewWindow, forceOpenWorkspaceAsFile: isFile }); }; - const workspacePicks = recentWorkspaces.map(workspace => toPick(workspace, isSingleFolderWorkspaceIdentifier(workspace) ? FileKind.FOLDER : FileKind.ROOT_FOLDER, this.labelService, !this.isQuickNavigate() ? [this.removeFromRecentlyOpened] : void 0)); - const filePicks = recentFiles.map(p => toPick(p, FileKind.FILE, this.labelService, !this.isQuickNavigate() ? [this.removeFromRecentlyOpened] : void 0)); + const workspacePicks = recentWorkspaces.map(workspace => toPick(workspace, isSingleFolderWorkspaceIdentifier(workspace) ? FileKind.FOLDER : FileKind.ROOT_FOLDER, this.labelService, !this.isQuickNavigate() ? [this.removeFromRecentlyOpened] : undefined)); + const filePicks = recentFiles.map(p => toPick(p, FileKind.FILE, this.labelService, !this.isQuickNavigate() ? [this.removeFromRecentlyOpened] : undefined)); // focus second entry if the first recent workspace is the current workspace let autoFocusSecondEntry: boolean = recentWorkspaces[0] && this.contextService.isCurrentWorkspace(recentWorkspaces[0]); @@ -481,7 +481,7 @@ export abstract class BaseOpenRecentAction extends Action { placeHolder: isMacintosh ? nls.localize('openRecentPlaceHolderMac', "Select to open (hold Cmd-key to open in new window)") : nls.localize('openRecentPlaceHolder', "Select to open (hold Ctrl-key to open in new window)"), matchOnDescription: true, onKeyMods: mods => keyMods = mods, - quickNavigate: this.isQuickNavigate() ? { keybindings: this.keybindingService.lookupKeybindings(this.id) } : void 0, + quickNavigate: this.isQuickNavigate() ? { keybindings: this.keybindingService.lookupKeybindings(this.id) } : undefined, onDidTriggerItemButton: context => { this.windowsService.removeFromRecentlyOpened([context.item.workspace]).then(() => context.removeItem()); } diff --git a/src/vs/workbench/electron-browser/commands.ts b/src/vs/workbench/electron-browser/commands.ts index 906912b07900b..a9967f6ca44f9 100644 --- a/src/vs/workbench/electron-browser/commands.ts +++ b/src/vs/workbench/electron-browser/commands.ts @@ -99,7 +99,7 @@ export function registerCommands(): void { if (focused instanceof List || focused instanceof PagedList) { const list = focused; - const focus = list.getFocus() ? list.getFocus()[0] : void 0; + const focus = list.getFocus() ? list.getFocus()[0] : undefined; const selection = list.getSelection(); if (selection && selection.indexOf(focus) >= 0) { list.setSelection(selection.filter(s => s !== previousFocus)); @@ -112,7 +112,7 @@ export function registerCommands(): void { else if (focused instanceof ObjectTree || focused instanceof DataTree || focused instanceof AsyncDataTree) { const list = focused; - const focus = list.getFocus() ? list.getFocus()[0] : void 0; + const focus = list.getFocus() ? list.getFocus()[0] : undefined; const selection = list.getSelection(); const fakeKeyboardEvent = new KeyboardEvent('keydown'); @@ -150,7 +150,7 @@ export function registerCommands(): void { const list = focused; // Focus down first - const previousFocus = list.getFocus() ? list.getFocus()[0] : void 0; + const previousFocus = list.getFocus() ? list.getFocus()[0] : undefined; focusDown(accessor, arg2); // Then adjust selection @@ -236,7 +236,7 @@ export function registerCommands(): void { const list = focused; // Focus up first - const previousFocus = list.getFocus() ? list.getFocus()[0] : void 0; + const previousFocus = list.getFocus() ? list.getFocus()[0] : undefined; focusUp(accessor, arg2); // Then adjust selection @@ -301,7 +301,7 @@ export function registerCommands(): void { return tree.reveal(tree.getFocus()); } - return void 0; + return undefined; }); } } @@ -348,7 +348,7 @@ export function registerCommands(): void { return tree.reveal(tree.getFocus()); } - return void 0; + return undefined; }); } } @@ -479,7 +479,7 @@ export function registerCommands(): void { else if (focused) { const tree = focused; - tree.focusFirst({ origin: 'keyboard' }, options && options.fromFocused ? tree.getFocus() : void 0); + tree.focusFirst({ origin: 'keyboard' }, options && options.fromFocused ? tree.getFocus() : undefined); tree.reveal(tree.getFocus()); } } @@ -532,7 +532,7 @@ export function registerCommands(): void { else if (focused) { const tree = focused; - tree.focusLast({ origin: 'keyboard' }, options && options.fromFocused ? tree.getFocus() : void 0); + tree.focusLast({ origin: 'keyboard' }, options && options.fromFocused ? tree.getFocus() : undefined); tree.reveal(tree.getFocus()); } } @@ -698,15 +698,15 @@ export function registerCommands(): void { const windowsService = accessor.get(IWindowsService); windowsService.quit(); }, - when: void 0, + when: undefined, primary: KeyMod.CtrlCmd | KeyCode.KEY_Q, - win: { primary: void 0 } + win: { primary: undefined } }); CommandsRegistry.registerCommand('_workbench.removeFromRecentlyOpened', function (accessor: ServicesAccessor, path: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | URI | string) { const windowsService = accessor.get(IWindowsService); - return windowsService.removeFromRecentlyOpened([path]).then(() => void 0); + return windowsService.removeFromRecentlyOpened([path]).then(() => undefined); }); CommandsRegistry.registerCommand('_workbench.downloadResource', function (accessor: ServicesAccessor, resource: URI) { diff --git a/src/vs/workbench/electron-browser/shell.ts b/src/vs/workbench/electron-browser/shell.ts index ab78ca9362100..4db5b14227f03 100644 --- a/src/vs/workbench/electron-browser/shell.ts +++ b/src/vs/workbench/electron-browser/shell.ts @@ -223,7 +223,7 @@ export class WorkbenchShell extends Disposable { } catch (error) { handleStartupError(this.logService, error); - return void 0; + return undefined; } } diff --git a/src/vs/workbench/electron-browser/window.ts b/src/vs/workbench/electron-browser/window.ts index bf90bb2f25343..153286aa3a26d 100644 --- a/src/vs/workbench/electron-browser/window.ts +++ b/src/vs/workbench/electron-browser/window.ts @@ -307,7 +307,7 @@ export class ElectronWindow extends Themable { // Dispose old this.touchBarDisposables = dispose(this.touchBarDisposables); - this.touchBarMenu = void 0; + this.touchBarMenu = undefined; // Create new (delayed) this.touchBarUpdater = new RunOnceScheduler(() => this.doUpdateTouchbarMenu(), 300); @@ -325,7 +325,7 @@ export class ElectronWindow extends Themable { const actions: Array = []; // Fill actions into groups respecting order - fillInActionBarActions(this.touchBarMenu, void 0, actions); + fillInActionBarActions(this.touchBarMenu, undefined, actions); // Convert into command action multi array const items: ICommandAction[][] = []; diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index aed1610dce845..0803361ed6620 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -306,8 +306,8 @@ export class Workbench extends Disposable implements IPartService { // Actions registered here to adjust for developing vs built workbench const registry = Registry.as(Extensions.WorkbenchActions); - registry.registerWorkbenchAction(new SyncActionDescriptor(ReloadWindowAction, ReloadWindowAction.ID, ReloadWindowAction.LABEL, isDeveloping ? { primary: KeyMod.CtrlCmd | KeyCode.KEY_R } : void 0), 'Reload Window'); - registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleDevToolsAction, ToggleDevToolsAction.ID, ToggleDevToolsAction.LABEL, isDeveloping ? { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_I, mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_I } } : void 0), 'Developer: Toggle Developer Tools', localize('developer', "Developer")); + registry.registerWorkbenchAction(new SyncActionDescriptor(ReloadWindowAction, ReloadWindowAction.ID, ReloadWindowAction.LABEL, isDeveloping ? { primary: KeyMod.CtrlCmd | KeyCode.KEY_R } : undefined), 'Reload Window'); + registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleDevToolsAction, ToggleDevToolsAction.ID, ToggleDevToolsAction.LABEL, isDeveloping ? { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_I, mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_I } } : undefined), 'Developer: Toggle Developer Tools', localize('developer', "Developer")); registry.registerWorkbenchAction(new SyncActionDescriptor(OpenRecentAction, OpenRecentAction.ID, OpenRecentAction.LABEL, { primary: isDeveloping ? null : KeyMod.CtrlCmd | KeyCode.KEY_R, mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_R } }), 'File: Open Recent...', localize('file', "File")); registry.registerWorkbenchAction(new SyncActionDescriptor(ReloadWindowWithExtensionsDisabledAction, ReloadWindowWithExtensionsDisabledAction.ID, ReloadWindowWithExtensionsDisabledAction.LABEL), 'Reload Window Without Extensions'); registry.registerWorkbenchAction(new SyncActionDescriptor(LogStorageAction, LogStorageAction.ID, LogStorageAction.LABEL), 'Developer: Log Storage', localize('developer', "Developer")); @@ -776,7 +776,7 @@ export class Workbench extends Disposable implements IPartService { // Set lifecycle phase to `Runnning For A Bit` after a short delay let eventuallPhaseTimeoutHandle = runWhenIdle(() => { - eventuallPhaseTimeoutHandle = void 0; + eventuallPhaseTimeoutHandle = undefined; this.lifecycleService.phase = LifecyclePhase.Eventually; }, 5000); diff --git a/src/vs/workbench/parts/backup/common/backupRestorer.ts b/src/vs/workbench/parts/backup/common/backupRestorer.ts index ec5a953331a7d..89f173c7478a5 100644 --- a/src/vs/workbench/parts/backup/common/backupRestorer.ts +++ b/src/vs/workbench/parts/backup/common/backupRestorer.ts @@ -41,7 +41,7 @@ export class BackupRestorer implements IWorkbenchContribution { return this.doOpenEditors(unresolved).then(() => this.doResolveOpenedBackups(unresolved)); } - return void 0; + return undefined; }); }); } @@ -53,7 +53,7 @@ export class BackupRestorer implements IWorkbenchContribution { backups.forEach(backup => { const openedEditor = this.editorService.getOpened({ resource: backup }); if (openedEditor) { - restorePromises.push(openedEditor.resolve().then(void 0, () => unresolved.push(backup))); + restorePromises.push(openedEditor.resolve().then(undefined, () => unresolved.push(backup))); } else { unresolved.push(backup); } @@ -67,7 +67,7 @@ export class BackupRestorer implements IWorkbenchContribution { const inputs = resources.map((resource, index) => this.resolveInput(resource, index, hasOpenedEditors)); // Open all remaining backups as editors and resolve them to load their backups - return this.editorService.openEditors(inputs).then(() => void 0); + return this.editorService.openEditors(inputs).then(() => undefined); } private resolveInput(resource: URI, index: number, hasOpenedEditors: boolean): IResourceInput | IUntitledResourceInput { diff --git a/src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts b/src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts index 8b5cfaa81ff06..da1d75775510d 100644 --- a/src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts +++ b/src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts @@ -70,9 +70,9 @@ class InstallAction extends Action { return Promise.resolve(null); } else { return pfs.unlink(this.target) - .then(void 0, ignore('ENOENT', null)) + .then(undefined, ignore('ENOENT', null)) .then(() => pfs.symlink(getSource(), this.target)) - .then(void 0, err => { + .then(undefined, err => { if (err.code === 'EACCES' || err.code === 'ENOENT') { return this.createBinFolderAndSymlinkAsAdmin(); } @@ -93,7 +93,7 @@ class InstallAction extends Action { .then(stat => stat.isSymbolicLink()) .then(() => pfs.readlink(this.target)) .then(link => link === getSource()) - .then(void 0, ignore('ENOENT', false)); + .then(undefined, ignore('ENOENT', false)); } private createBinFolderAndSymlinkAsAdmin(): Promise { @@ -106,7 +106,7 @@ class InstallAction extends Action { const command = 'osascript -e "do shell script \\"mkdir -p /usr/local/bin && ln -sf \'' + getSource() + '\' \'' + this.target + '\'\\" with administrator privileges"'; nfcall(cp.exec, command, {}) - .then(void 0, _ => Promise.reject(new Error(nls.localize('cantCreateBinFolder', "Unable to create '/usr/local/bin'.")))) + .then(undefined, _ => Promise.reject(new Error(nls.localize('cantCreateBinFolder', "Unable to create '/usr/local/bin'.")))) .then(resolve, reject); break; case 1 /* Cancel */: @@ -147,10 +147,10 @@ class UninstallAction extends Action { const uninstall = () => { return pfs.unlink(this.target) - .then(void 0, ignore('ENOENT', null)); + .then(undefined, ignore('ENOENT', null)); }; - return uninstall().then(void 0, err => { + return uninstall().then(undefined, err => { if (err.code === 'EACCES') { return this.deleteSymlinkAsAdmin(); } @@ -173,7 +173,7 @@ class UninstallAction extends Action { const command = 'osascript -e "do shell script \\"rm \'' + this.target + '\'\\" with administrator privileges"'; nfcall(cp.exec, command, {}) - .then(void 0, _ => Promise.reject(new Error(nls.localize('cantUninstall', "Unable to uninstall the shell command '{0}'.", this.target)))) + .then(undefined, _ => Promise.reject(new Error(nls.localize('cantUninstall', "Unable to uninstall the shell command '{0}'.", this.target)))) .then(resolve, reject); break; case 1 /* Cancel */: diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint.ts b/src/vs/workbench/parts/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint.ts index eff7d411e58de..cd27393114cc6 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint.ts @@ -310,7 +310,7 @@ export class LanguageConfigurationFileHandler { richEditConfig.folding = { offSide: configuration.folding.offSide, - markers: markers ? { start: new RegExp(markers.start), end: new RegExp(markers.end) } : void 0 + markers: markers ? { start: new RegExp(markers.start), end: new RegExp(markers.end) } : undefined }; } diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts b/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts index 9a69685357742..1ef5416fc34ab 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts @@ -54,7 +54,7 @@ function readTransientState(model: ITextModel, codeEditorService: ICodeEditorSer function readWordWrapState(model: ITextModel, configurationService: ITextResourceConfigurationService, codeEditorService: ICodeEditorService): IWordWrapState { const editorConfig = configurationService.getValue(model.uri, 'editor') as { wordWrap: 'on' | 'off' | 'wordWrapColumn' | 'bounded'; wordWrapMinified: boolean }; - let _configuredWordWrap = editorConfig && (typeof editorConfig.wordWrap === 'string' || typeof editorConfig.wordWrap === 'boolean') ? editorConfig.wordWrap : void 0; + let _configuredWordWrap = editorConfig && (typeof editorConfig.wordWrap === 'string' || typeof editorConfig.wordWrap === 'boolean') ? editorConfig.wordWrap : undefined; // Compatibility with old true or false values if (_configuredWordWrap === true) { @@ -63,7 +63,7 @@ function readWordWrapState(model: ITextModel, configurationService: ITextResourc _configuredWordWrap = 'off'; } - const _configuredWordWrapMinified = editorConfig && typeof editorConfig.wordWrapMinified === 'boolean' ? editorConfig.wordWrapMinified : void 0; + const _configuredWordWrapMinified = editorConfig && typeof editorConfig.wordWrapMinified === 'boolean' ? editorConfig.wordWrapMinified : undefined; const _transientState = readTransientState(model, codeEditorService); return { configuredWordWrap: _configuredWordWrap, diff --git a/src/vs/workbench/parts/comments/electron-browser/commentService.ts b/src/vs/workbench/parts/comments/electron-browser/commentService.ts index a8d1e7b3d7770..0a806cc0332ec 100644 --- a/src/vs/workbench/parts/comments/electron-browser/commentService.ts +++ b/src/vs/workbench/parts/comments/electron-browser/commentService.ts @@ -135,7 +135,7 @@ export class CommentService extends Disposable implements ICommentService { return commentProvider.editComment(resource, comment, text, CancellationToken.None); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } deleteComment(owner: string, resource: URI, comment: Comment): Promise { diff --git a/src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts b/src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts index c1b0f53f8773d..7bfec8f848a9e 100644 --- a/src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts +++ b/src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts @@ -167,7 +167,7 @@ export class CommentsPanel extends Panel { const range = element instanceof ResourceWithCommentThreads ? element.commentThreads[0].range : element.range; const activeEditor = this.editorService.activeEditor; - let currentActiveResource = activeEditor ? activeEditor.getResource() : void 0; + let currentActiveResource = activeEditor ? activeEditor.getResource() : undefined; if (currentActiveResource && currentActiveResource.toString() === element.resource.toString()) { const threadToReveal = element instanceof ResourceWithCommentThreads ? element.commentThreads[0].threadId : element.threadId; const commentToReveal = element instanceof ResourceWithCommentThreads ? element.commentThreads[0].comment.commentId : element.comment.commentId; @@ -202,7 +202,7 @@ export class CommentsPanel extends Panel { } } else { let activeEditor = this.editorService.activeEditor; - let currentActiveResource = activeEditor ? activeEditor.getResource() : void 0; + let currentActiveResource = activeEditor ? activeEditor.getResource() : undefined; if (currentActiveResource && currentActiveResource.toString() === element.resource.toString()) { const control = this.editorService.activeTextEditorWidget; if (threadToReveal && isCodeEditor(control)) { diff --git a/src/vs/workbench/parts/comments/electron-browser/commentsTreeViewer.ts b/src/vs/workbench/parts/comments/electron-browser/commentsTreeViewer.ts index 473341920a2e3..dc92d3b0217b6 100644 --- a/src/vs/workbench/parts/comments/electron-browser/commentsTreeViewer.ts +++ b/src/vs/workbench/parts/comments/electron-browser/commentsTreeViewer.ts @@ -46,7 +46,7 @@ export class CommentsDataSource implements IDataSource { } public getParent(tree: ITree, element: any): Promise { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } public shouldAutoexpand(tree: ITree, element: any): boolean { diff --git a/src/vs/workbench/parts/debug/browser/debugEditorActions.ts b/src/vs/workbench/parts/debug/browser/debugEditorActions.ts index aef4d76df713c..0ee09ead1c79f 100644 --- a/src/vs/workbench/parts/debug/browser/debugEditorActions.ts +++ b/src/vs/workbench/parts/debug/browser/debugEditorActions.ts @@ -119,7 +119,7 @@ class RunToCursorAction extends EditorAction { const debugService = accessor.get(IDebugService); const focusedSession = debugService.getViewModel().focusedSession; if (debugService.state !== State.Stopped || !focusedSession) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } let breakpointToRemove: IBreakpoint; @@ -169,7 +169,7 @@ class SelectionToReplAction extends EditorAction { const session = viewModel.focusedSession; return session.addReplExpression(viewModel.focusedStackFrame, text) .then(() => panelService.openPanel(REPL_ID, true)) - .then(_ => void 0); + .then(_ => undefined); } } diff --git a/src/vs/workbench/parts/debug/common/debugModel.ts b/src/vs/workbench/parts/debug/common/debugModel.ts index f0100fbc7db97..7dbea2981a9d4 100644 --- a/src/vs/workbench/parts/debug/common/debugModel.ts +++ b/src/vs/workbench/parts/debug/common/debugModel.ts @@ -219,7 +219,7 @@ export class Expression extends ExpressionContainer implements IExpression { this.available = false; this.reference = 0; - return Promise.resolve(void 0); + return Promise.resolve(undefined); } this.session = session; @@ -427,7 +427,7 @@ export class Thread implements IThread { */ fetchCallStack(levels = 20): Promise { if (!this.stopped) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } const start = this.callStack.length; diff --git a/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts b/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts index fce0264efc609..2525832b934e0 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts @@ -450,7 +450,7 @@ export class ConfigurationManager implements IConfigurationManager { thenables.push(this.extensionService.activateByEvent(`${activationEvent}:${debugType}`)); } return Promise.all(thenables).then(_ => { - return void 0; + return undefined; }); } diff --git a/src/vs/workbench/parts/debug/electron-browser/debugHover.ts b/src/vs/workbench/parts/debug/electron-browser/debugHover.ts index 43c08cc496550..012e1b1180952 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugHover.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugHover.ts @@ -232,7 +232,7 @@ export class DebugHoverWidget implements IContentWidget { this.valueContainer.focus(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } this.valueContainer.hidden = true; diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index e99893b11906c..6f40a1d320caf 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -606,7 +606,7 @@ export class DebugService implements IDebugService { this.launchOrAttachToSession(session, shouldFocus).then(() => { this._onDidNewSession.fire(session); - c(void 0); + c(undefined); }, err => e(err)); }); }); @@ -660,7 +660,7 @@ export class DebugService implements IDebugService { return actions[choice].run(); } - return void 0; + return undefined; }); } @@ -727,7 +727,7 @@ export class DebugService implements IDebugService { if (task.configurationProperties.isBackground) { return new Promise((c, e) => once(e => e.kind === TaskEventKind.Inactive && e.taskId === task._id, this.taskService.onDidStateChange)(() => { taskStarted = true; - c(void 0); + c(undefined); })); } @@ -912,7 +912,7 @@ export class DebugService implements IDebugService { if (session) { return send(session); } - return Promise.all(this.model.getSessions().map(s => send(s))).then(() => void 0); + return Promise.all(this.model.getSessions().map(s => send(s))).then(() => undefined); } private onFileChanges(fileChangesEvent: FileChangesEvent): void { diff --git a/src/vs/workbench/parts/debug/electron-browser/debugSession.ts b/src/vs/workbench/parts/debug/electron-browser/debugSession.ts index d2bbc24eccb02..6640b6ccb64f1 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugSession.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugSession.ts @@ -182,7 +182,7 @@ export class DebugSession implements IDebugSession { config.__sessionId = this.getId(); return this.raw.launchOrAttach(config).then(result => { - return void 0; + return undefined; }); } return Promise.reject(new Error('no debug adapter')); @@ -195,11 +195,11 @@ export class DebugSession implements IDebugSession { if (this.raw) { if (this.raw.capabilities.supportsTerminateRequest && this._configuration.resolved.request === 'launch') { return this.raw.terminate(restart).then(response => { - return void 0; + return undefined; }); } return this.raw.disconnect(restart).then(response => { - return void 0; + return undefined; }); } return Promise.reject(new Error('no debug adapter')); @@ -211,7 +211,7 @@ export class DebugSession implements IDebugSession { disconnect(restart = false): Promise { if (this.raw) { return this.raw.disconnect(restart).then(response => { - return void 0; + return undefined; }); } return Promise.reject(new Error('no debug adapter')); @@ -294,7 +294,7 @@ export class DebugSession implements IDebugSession { if (this.raw.readyForBreakpoints) { return this.raw.setExceptionBreakpoints({ filters: exbpts.map(exb => exb.filter) }).then(() => undefined); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } return Promise.reject(new Error('no debug adapter')); } @@ -583,7 +583,7 @@ export class DebugSession implements IDebugSession { aria.status(nls.localize('debuggingStarted', "Debugging started.")); const sendConfigurationDone = () => { if (this.raw && this.raw.capabilities.supportsConfigurationDoneRequest) { - return this.raw.configurationDone().then(void 0, e => { + return this.raw.configurationDone().then(undefined, e => { // Disconnect the debug session on configuration done error #10596 if (this.raw) { this.raw.disconnect(); @@ -653,7 +653,7 @@ export class DebugSession implements IDebugSession { this.rawListeners.push(this.raw.onDidTerminateDebugee(event => { aria.status(nls.localize('debuggingStopped', "Debugging stopped.")); if (event.body && event.body.restart) { - this.debugService.restartSession(this, event.body.restart).then(void 0, onUnexpectedError); + this.debugService.restartSession(this, event.body.restart).then(undefined, onUnexpectedError); } else { this.raw.disconnect(); } diff --git a/src/vs/workbench/parts/debug/node/debugAdapter.ts b/src/vs/workbench/parts/debug/node/debugAdapter.ts index d82da6c338695..81954344b9b24 100644 --- a/src/vs/workbench/parts/debug/node/debugAdapter.ts +++ b/src/vs/workbench/parts/debug/node/debugAdapter.ts @@ -409,7 +409,7 @@ export class ExecutableDebugAdapter extends StreamDebugAdapter { this.cancelPending(); if (!this.serverProcess) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } // when killing a process in windows its child @@ -427,7 +427,7 @@ export class ExecutableDebugAdapter extends StreamDebugAdapter { }); } else { this.serverProcess.kill('SIGTERM'); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } diff --git a/src/vs/workbench/parts/debug/node/terminals.ts b/src/vs/workbench/parts/debug/node/terminals.ts index af57e7bbb3115..177576e9161c1 100644 --- a/src/vs/workbench/parts/debug/node/terminals.ts +++ b/src/vs/workbench/parts/debug/node/terminals.ts @@ -71,7 +71,7 @@ abstract class TerminalLauncher implements ITerminalLauncher { return this.runInTerminal0(args.title, args.cwd, args.args, args.env || {}, config); } runInTerminal0(title: string, dir: string, args: string[], envVars: env.IProcessEnvironment, config): Promise { - return void 0; + return undefined; } } diff --git a/src/vs/workbench/parts/debug/test/common/mockDebug.ts b/src/vs/workbench/parts/debug/test/common/mockDebug.ts index 9b0838ee00e7a..fbb34d499e927 100644 --- a/src/vs/workbench/parts/debug/test/common/mockDebug.ts +++ b/src/vs/workbench/parts/debug/test/common/mockDebug.ts @@ -133,7 +133,7 @@ export class MockSession implements IDebugSession { } addReplExpression(stackFrame: IStackFrame, name: string): Promise { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } appendToRepl(data: string | IExpression, severity: Severity, source?: IReplElementSource): void { } diff --git a/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.ts b/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.ts index 8b9ea125dd81e..1845bcd423934 100644 --- a/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.ts +++ b/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.ts @@ -33,7 +33,7 @@ class ShowEmmetCommandsAction extends EditorAction { public run(accessor: ServicesAccessor, editor: ICodeEditor): Promise { const quickOpenService = accessor.get(IQuickOpenService); quickOpenService.show(EMMET_COMMANDS_PREFIX); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } diff --git a/src/vs/workbench/parts/execution/electron-browser/terminal.ts b/src/vs/workbench/parts/execution/electron-browser/terminal.ts index 525bd50030515..64ca19ecb769d 100644 --- a/src/vs/workbench/parts/execution/electron-browser/terminal.ts +++ b/src/vs/workbench/parts/execution/electron-browser/terminal.ts @@ -11,7 +11,7 @@ export function getDefaultTerminalLinuxReady(): Promise { if (!_DEFAULT_TERMINAL_LINUX_READY) { _DEFAULT_TERMINAL_LINUX_READY = new Promise(c => { if (env.isLinux) { - Promise.all([pfs.exists('/etc/debian_version'), process.lazyEnv || Promise.resolve(void 0)]).then(([isDebian]) => { + Promise.all([pfs.exists('/etc/debian_version'), process.lazyEnv || Promise.resolve(undefined)]).then(([isDebian]) => { if (isDebian) { c('x-terminal-emulator'); } else if (process.env.DESKTOP_SESSION === 'gnome' || process.env.DESKTOP_SESSION === 'gnome-classic') { diff --git a/src/vs/workbench/parts/execution/electron-browser/terminalService.ts b/src/vs/workbench/parts/execution/electron-browser/terminalService.ts index 7fde5a1f56d85..5b361d842fdfb 100644 --- a/src/vs/workbench/parts/execution/electron-browser/terminalService.ts +++ b/src/vs/workbench/parts/execution/electron-browser/terminalService.ts @@ -85,7 +85,7 @@ export class WinTerminalService implements ITerminalService { // unless otherwise specified if (spawnType === WinSpawnType.CMDER) { spawner.spawn(exec, [cwd]); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } const cmdArgs = ['/c', 'start', '/wait']; @@ -97,7 +97,7 @@ export class WinTerminalService implements ITerminalService { cmdArgs.push(exec); return new Promise((c, e) => { - const env = cwd ? { cwd: cwd } : void 0; + const env = cwd ? { cwd: cwd } : undefined; const child = spawner.spawn(command, cmdArgs, env); child.on('error', e); child.on('exit', () => c()); @@ -279,7 +279,7 @@ export class LinuxTerminalService implements ITerminalService { private spawnTerminal(spawner, configuration: ITerminalConfiguration, cwd?: string): Promise { const terminalConfig = configuration.terminal.external; const execPromise = terminalConfig.linuxExec ? Promise.resolve(terminalConfig.linuxExec) : getDefaultTerminalLinuxReady(); - const env = cwd ? { cwd: cwd } : void 0; + const env = cwd ? { cwd: cwd } : undefined; return new Promise((c, e) => { execPromise.then(exec => { diff --git a/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.ts b/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.ts index 3c65a60f62865..22f5b40819a4c 100644 --- a/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.ts +++ b/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.ts @@ -100,7 +100,7 @@ export class GalleryExtensionsHandler extends QuickOpenHandler { .then(viewlet => viewlet as IExtensionsViewlet) .then(viewlet => viewlet.search(`@id:${text}`)) .then(() => this.extensionsService.installFromGallery(galleryExtension)) - .then(void 0, err => this.notificationService.error(err)); + .then(undefined, err => this.notificationService.error(err)); }; entries.push(new SimpleEntry(label, action)); diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts index 7eea5f370fe37..e4d5ba4a87479 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts @@ -121,7 +121,7 @@ class NavBar { this.currentId = id; this._onChange.fire({ id, focus }); this.actions.forEach(a => a.enabled = a.id !== id); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } dispose(): void { @@ -538,7 +538,7 @@ export class ExtensionEditor extends BaseEditor { this.contentDisposables.push(wbeviewElement); return wbeviewElement; }) - .then(void 0, () => { + .then(undefined, () => { const p = append(this.content, $('p.nocontent')); p.textContent = noContentCopy; return p; diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionProfileService.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionProfileService.ts index f1c87433c215c..d9ca5f486ad3a 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionProfileService.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionProfileService.ts @@ -68,7 +68,7 @@ export class ExtensionHostProfileService extends Disposable implements IExtensio ProfileExtHostStatusbarItem.instance.hide(); } - this._onDidChangeState.fire(void 0); + this._onDidChangeState.fire(undefined); } public startProfiling(): Promise { @@ -119,7 +119,7 @@ export class ExtensionHostProfileService extends Disposable implements IExtensio private _setLastProfile(profile: IExtensionHostProfile) { this._profile = profile; - this._onDidChangeLastProfile.fire(void 0); + this._onDidChangeLastProfile.fire(undefined); } getUnresponsiveProfile(extensionId: CanonicalExtensionIdentifier): IExtensionHostProfile | undefined { diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts index d21d6ec790589..cf4e41a896045 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts @@ -259,7 +259,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe */ private fetchWorkspaceRecommendations(): Promise { - if (!this.isEnabled) { return Promise.resolve(void 0); } + if (!this.isEnabled) { return Promise.resolve(undefined); } return this.fetchExtensionRecommendationContents() .then(result => this.validateExtensions(result.map(({ contents }) => contents)) @@ -426,7 +426,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe const recommendations = filteredRecs.filter(({ extensionId }) => local.every(local => !areSameExtensions({ id: extensionId }, { id: getGalleryExtensionIdFromLocal(local) }))); if (!recommendations.length) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } return new Promise(c => { @@ -447,7 +447,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe installAllAction.run(); installAllAction.dispose(); - c(void 0); + c(undefined); } }, { label: localize('showRecommendations', "Show Recommendations"), @@ -463,7 +463,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe showAction.run(); showAction.dispose(); - c(void 0); + c(undefined); } }, { label: choiceNever, @@ -477,7 +477,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe this.telemetryService.publicLog('extensionWorkspaceRecommendations:popup', { userReaction: 'neverShowAgain' }); this.storageService.store(storageKey, true, StorageScope.WORKSPACE); - c(void 0); + c(undefined); } }], { @@ -490,7 +490,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe */ this.telemetryService.publicLog('extensionWorkspaceRecommendations:popup', { userReaction: 'cancelled' }); - c(void 0); + c(undefined); } } ); @@ -854,7 +854,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe fetchPromise = new Promise((c, e) => { setTimeout(() => { - Promise.all([this.fetchExecutableRecommendations(), this.fetchDynamicWorkspaceRecommendations()]).then(() => c(void 0)); + Promise.all([this.fetchExecutableRecommendations(), this.fetchDynamicWorkspaceRecommendations()]).then(() => c(undefined)); }, calledDuringStartup ? 10000 : 0); }); @@ -949,7 +949,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe || !this.fileService.canHandleResource(this.contextService.getWorkspace().folders[0].uri) || this._dynamicWorkspaceRecommendations.length || !this._extensionsRecommendationsUrl) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } const storageKey = 'extensionsAssistant/dynamicWorkspaceRecommendations'; diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts index 2adce4e694bdc..22d810d995c28 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts @@ -1173,7 +1173,7 @@ export class UpdateAllAction extends Action { } private install(extension: IExtension): Promise { - return this.extensionsWorkbenchService.install(extension).then(void 0, err => { + return this.extensionsWorkbenchService.install(extension).then(undefined, err => { if (!extension.gallery) { return this.notificationService.error(err); } @@ -1342,7 +1342,7 @@ export class ShowEnabledExtensionsAction extends Action { label: string, @IViewletService private viewletService: IViewletService ) { - super(id, label, void 0, true); + super(id, label, undefined, true); } run(): Promise { @@ -1365,7 +1365,7 @@ export class ShowInstalledExtensionsAction extends Action { label: string, @IViewletService private viewletService: IViewletService ) { - super(id, label, void 0, true); + super(id, label, undefined, true); } run(): Promise { @@ -1447,7 +1447,7 @@ export class ShowBuiltInExtensionsAction extends Action { label: string, @IViewletService private viewletService: IViewletService ) { - super(id, label, void 0, true); + super(id, label, undefined, true); } run(): Promise { @@ -1470,7 +1470,7 @@ export class ShowOutdatedExtensionsAction extends Action { label: string, @IViewletService private viewletService: IViewletService ) { - super(id, label, void 0, true); + super(id, label, undefined, true); } run(): Promise { @@ -1493,7 +1493,7 @@ export class ShowPopularExtensionsAction extends Action { label: string, @IViewletService private viewletService: IViewletService ) { - super(id, label, void 0, true); + super(id, label, undefined, true); } run(): Promise { @@ -1516,7 +1516,7 @@ export class ShowRecommendedExtensionsAction extends Action { label: string, @IViewletService private viewletService: IViewletService ) { - super(id, label, void 0, true); + super(id, label, undefined, true); } run(): Promise { @@ -1564,7 +1564,7 @@ export class InstallWorkspaceRecommendedExtensionsAction extends Action { let model = new PagedModel(pager); for (let i = 0; i < pager.total; i++) { installPromises.push(model.resolve(i, CancellationToken.None).then(e => { - return this.extensionWorkbenchService.install(e).then(void 0, err => { + return this.extensionWorkbenchService.install(e).then(undefined, err => { console.error(err); return promptDownloadManually(e.gallery, localize('failedToInstall', "Failed to install \'{0}\'.", e.identifier.id), err, this.instantiationService, this.notificationService, this.openerService); }); @@ -1591,7 +1591,7 @@ export class InstallRecommendedExtensionAction extends Action { @IOpenerService private openerService: IOpenerService, @IExtensionsWorkbenchService private extensionWorkbenchService: IExtensionsWorkbenchService ) { - super(InstallRecommendedExtensionAction.ID, InstallRecommendedExtensionAction.LABEL, void 0, false); + super(InstallRecommendedExtensionAction.ID, InstallRecommendedExtensionAction.LABEL, undefined, false); this.extensionId = extensionId; } @@ -1688,7 +1688,7 @@ export class ShowRecommendedKeymapExtensionsAction extends Action { label: string, @IViewletService private viewletService: IViewletService ) { - super(id, label, void 0, true); + super(id, label, undefined, true); } run(): Promise { @@ -1711,7 +1711,7 @@ export class ShowLanguageExtensionsAction extends Action { label: string, @IViewletService private viewletService: IViewletService ) { - super(id, label, void 0, true); + super(id, label, undefined, true); } run(): Promise { @@ -1734,7 +1734,7 @@ export class ShowAzureExtensionsAction extends Action { label: string, @IViewletService private viewletService: IViewletService ) { - super(id, label, void 0, true); + super(id, label, undefined, true); } run(): Promise { @@ -1759,7 +1759,7 @@ export class ChangeSortAction extends Action { private sortBy: string, @IViewletService private viewletService: IViewletService ) { - super(id, label, void 0, true); + super(id, label, undefined, true); if (sortBy === undefined) { throw new Error('bad arguments'); @@ -1798,7 +1798,7 @@ export class ChangeGroupAction extends Action { private groupBy: string, @IViewletService private viewletService: IViewletService ) { - super(id, label, void 0, true); + super(id, label, undefined, true); if (groupBy === undefined) { throw new Error('bad arguments'); @@ -2551,7 +2551,7 @@ export class OpenExtensionsFolderAction extends Action { @IFileService private fileService: IFileService, @IEnvironmentService private environmentService: IEnvironmentService ) { - super(id, label, void 0, true); + super(id, label, undefined, true); } run(): Promise { diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.ts index d321a560f095e..42134b1127a22 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.ts @@ -40,7 +40,7 @@ export class KeymapExtensions implements IWorkbenchContribution { lifecycleService.onShutdown(() => this.dispose()), instantiationService.invokeFunction(onExtensionChanged)((identifiers => { Promise.all(identifiers.map(identifier => this.checkForOtherKeymaps(identifier))) - .then(void 0, onUnexpectedError); + .then(undefined, onUnexpectedError); })) ); } diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts index 99492408d996f..b3a1149b90216 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts @@ -445,7 +445,7 @@ export class ExtensionsViewlet extends ViewContainerViewlet implements IExtensio } private triggerSearch(immediate = false): void { - this.searchDelayer.trigger(() => this.doSearch(), immediate || !this.searchBox.getValue() ? 0 : 500).then(void 0, err => this.onError(err)); + this.searchDelayer.trigger(() => this.doSearch(), immediate || !this.searchBox.getValue() ? 0 : 500).then(undefined, err => this.onError(err)); } private normalizedQuery(): string { diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsViews.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsViews.ts index e138c76269ee4..c2e02117e21da 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsViews.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsViews.ts @@ -640,7 +640,7 @@ export class ExtensionsListView extends ViewletPanel { } private openExtension(extension: IExtension): void { - this.extensionsWorkbenchService.open(extension).then(void 0, err => this.onError(err)); + this.extensionsWorkbenchService.open(extension).then(undefined, err => this.onError(err)); } private pin(): void { diff --git a/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts b/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts index 50788052d72fa..168a1a1c351ab 100644 --- a/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts +++ b/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts @@ -443,7 +443,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService, const locals = groupById[getGalleryExtensionIdFromLocal(local)]; locals.splice(locals.indexOf(local), 1); locals.splice(0, 0, local); - const extension = installedById[local.identifier.id] || new Extension(this.galleryService, this.stateProvider, locals, void 0, this.telemetryService, this.logService); + const extension = installedById[local.identifier.id] || new Extension(this.galleryService, this.stateProvider, locals, undefined, this.telemetryService, this.logService); extension.locals = locals; extension.enablementState = this.extensionEnablementService.getEnablementState(local); return extension; @@ -461,7 +461,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService, return this.galleryService.query(options) .then(result => mapPager(result, gallery => this.fromGallery(gallery, maliciousSet))) - .then(void 0, err => { + .then(undefined, err => { if (/No extension gallery service configured/.test(err.message)) { return Promise.resolve(singlePagePager([])); } @@ -493,7 +493,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService, } open(extension: IExtension, sideByside: boolean = false): Promise { - return Promise.resolve(this.editorService.openEditor(this.instantiationService.createInstance(ExtensionsInput, extension), void 0, sideByside ? SIDE_GROUP : ACTIVE_GROUP)); + return Promise.resolve(this.editorService.openEditor(this.instantiationService.createInstance(ExtensionsInput, extension), undefined, sideByside ? SIDE_GROUP : ACTIVE_GROUP)); } private getDistinctInstalledExtensions(allInstalled: ILocalExtension[]): Promise { @@ -611,11 +611,11 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService, private eventuallySyncWithGallery(immediate = false): void { const shouldSync = this.isAutoUpdateEnabled() || this.isAutoCheckUpdatesEnabled(); - const loop = () => (shouldSync ? this.syncWithGallery() : Promise.resolve(void 0)).then(() => this.eventuallySyncWithGallery()); + const loop = () => (shouldSync ? this.syncWithGallery() : Promise.resolve(undefined)).then(() => this.eventuallySyncWithGallery()); const delay = immediate ? 0 : ExtensionsWorkbenchService.SyncPeriod; this.syncDelayer.trigger(loop, delay) - .then(void 0, err => null); + .then(undefined, err => null); } private syncWithGallery(): Promise { @@ -638,12 +638,12 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService, promises.push(this.queryGallery({ names, pageSize: names.length })); } - return Promise.all(promises).then(() => void 0); + return Promise.all(promises).then(() => undefined); } private eventuallyAutoUpdateExtensions(): void { this.autoUpdateDelayer.trigger(() => this.autoUpdateExtensions()) - .then(void 0, err => null); + .then(undefined, err => null); } private autoUpdateExtensions(): Promise { @@ -717,7 +717,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService, location: ProgressLocation.Extensions, title: nls.localize('uninstallingExtension', 'Uninstalling extension....'), source: `${toUninstall[0].identifier.id}` - }, () => Promise.all(toUninstall.map(local => this.extensionService.uninstall(local))).then(() => void 0)); + }, () => Promise.all(toUninstall.map(local => this.extensionService.uninstall(local))).then(() => undefined)); } installVersion(extension: IExtension, version: string): Promise { @@ -732,7 +732,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService, return this.galleryService.getExtension(extension.gallery.identifier, version) .then(gallery => { if (!gallery) { - return void 0; + return undefined; } return this.installWithProgress( () => this.extensionService.installFromGallery(gallery) @@ -760,7 +760,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService, return this.progressService.withProgress({ location: ProgressLocation.Extensions, source: `${toReinstall[0].identifier.id}` - }, () => Promise.all(toReinstall.map(local => this.extensionService.reinstallFromGallery(local))).then(() => void 0)); + }, () => Promise.all(toReinstall.map(local => this.extensionService.reinstallFromGallery(local))).then(() => undefined)); } private installWithProgress(installTask: () => Promise, extensionName?: string): Promise { @@ -931,7 +931,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService, private onDidInstallExtension(event: DidInstallExtensionEvent): void { const { local, zipPath, error, gallery } = event; const installingExtension = gallery ? this.installing.filter(e => areSameExtensions(e.identifier, gallery.identifier))[0] : null; - let extension: Extension | undefined = installingExtension ? installingExtension : zipPath ? new Extension(this.galleryService, this.stateProvider, local ? [local] : [], void 0, this.telemetryService, this.logService) : undefined; + let extension: Extension | undefined = installingExtension ? installingExtension : zipPath ? new Extension(this.galleryService, this.stateProvider, local ? [local] : [], undefined, this.telemetryService, this.logService) : undefined; if (extension) { this.installing = installingExtension ? this.installing.filter(e => e !== installingExtension) : this.installing; if (local) { diff --git a/src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts b/src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts index 9e0266724f221..1d5614d4c25a2 100644 --- a/src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts +++ b/src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts @@ -1271,7 +1271,7 @@ suite('ExtensionsActions Test', () => { assign(localExtension.manifest, { name, publisher: 'pub', version: '1.0.0' }, manifest); localExtension.identifier = { id: getLocalExtensionIdFromManifest(localExtension.manifest) }; localExtension.metadata = { id: localExtension.identifier.id, publisherId: localExtension.manifest.publisher, publisherDisplayName: 'somename' }; - localExtension.galleryIdentifier = { id: getGalleryExtensionIdFromLocal(localExtension), uuid: void 0 }; + localExtension.galleryIdentifier = { id: getGalleryExtensionIdFromLocal(localExtension), uuid: undefined }; return localExtension; } diff --git a/src/vs/workbench/parts/extensions/test/electron-browser/extensionsViews.test.ts b/src/vs/workbench/parts/extensions/test/electron-browser/extensionsViews.test.ts index d93c65516c7fa..321a24067f296 100644 --- a/src/vs/workbench/parts/extensions/test/electron-browser/extensionsViews.test.ts +++ b/src/vs/workbench/parts/extensions/test/electron-browser/extensionsViews.test.ts @@ -504,7 +504,7 @@ suite('ExtensionsListView Tests', () => { assign(localExtension.manifest, { name, publisher: 'pub', version: '1.0.0' }, manifest); localExtension.identifier = { id: getLocalExtensionIdFromManifest(localExtension.manifest) }; localExtension.metadata = { id: localExtension.identifier.id, publisherId: localExtension.manifest.publisher, publisherDisplayName: 'somename' }; - localExtension.galleryIdentifier = { id: getGalleryExtensionIdFromLocal(localExtension), uuid: void 0 }; + localExtension.galleryIdentifier = { id: getGalleryExtensionIdFromLocal(localExtension), uuid: undefined }; return localExtension; } diff --git a/src/vs/workbench/parts/extensions/test/electron-browser/extensionsWorkbenchService.test.ts b/src/vs/workbench/parts/extensions/test/electron-browser/extensionsWorkbenchService.test.ts index 3205c28f36dc5..12e3140f7c2fe 100644 --- a/src/vs/workbench/parts/extensions/test/electron-browser/extensionsWorkbenchService.test.ts +++ b/src/vs/workbench/parts/extensions/test/electron-browser/extensionsWorkbenchService.test.ts @@ -1186,7 +1186,7 @@ suite('ExtensionsWorkbenchServiceTest', () => { assign(localExtension.manifest, { name, publisher: 'pub', version: '1.0.0' }, manifest); localExtension.identifier = { id: getLocalExtensionIdFromManifest(localExtension.manifest) }; localExtension.metadata = { id: localExtension.identifier.id, publisherId: localExtension.manifest.publisher, publisherDisplayName: 'somename' }; - localExtension.galleryIdentifier = { id: getGalleryExtensionIdFromLocal(localExtension), uuid: void 0 }; + localExtension.galleryIdentifier = { id: getGalleryExtensionIdFromLocal(localExtension), uuid: undefined }; return localExtension; } @@ -1219,7 +1219,7 @@ suite('ExtensionsWorkbenchServiceTest', () => { let counter = 0; event(() => { if (++counter === count) { - c(void 0); + c(undefined); } }); }); diff --git a/src/vs/workbench/parts/feedback/electron-browser/feedbackStatusbarItem.ts b/src/vs/workbench/parts/feedback/electron-browser/feedbackStatusbarItem.ts index 09be3a9f93fe6..0c063708507f0 100644 --- a/src/vs/workbench/parts/feedback/electron-browser/feedbackStatusbarItem.ts +++ b/src/vs/workbench/parts/feedback/electron-browser/feedbackStatusbarItem.ts @@ -144,7 +144,7 @@ export class FeedbackStatusbarItem extends Themable implements IStatusbarItem { // Dispose else { dispose(this.dropdown); - this.dropdown = void 0; + this.dropdown = undefined; clearNode(this.container); } diff --git a/src/vs/workbench/parts/files/browser/editors/binaryFileEditor.ts b/src/vs/workbench/parts/files/browser/editors/binaryFileEditor.ts index e2a6bf40fe6e3..737c31585b6ba 100644 --- a/src/vs/workbench/parts/files/browser/editors/binaryFileEditor.ts +++ b/src/vs/workbench/parts/files/browser/editors/binaryFileEditor.ts @@ -48,7 +48,7 @@ export class BinaryFileEditor extends BaseBinaryResourceEditor { if (input instanceof FileEditorInput) { input.setForceOpenAsText(); - return this.editorService.openEditor(input, options, this.group).then(() => void 0); + return this.editorService.openEditor(input, options, this.group).then(() => undefined); } return Promise.resolve(); @@ -60,7 +60,7 @@ export class BinaryFileEditor extends BaseBinaryResourceEditor { return this.windowsService.showItemInFolder(resource.fsPath); } - return void 0; + return undefined; }); } diff --git a/src/vs/workbench/parts/files/browser/editors/fileEditorTracker.ts b/src/vs/workbench/parts/files/browser/editors/fileEditorTracker.ts index fc8f77b2b8456..0a629446fc02c 100644 --- a/src/vs/workbench/parts/files/browser/editors/fileEditorTracker.ts +++ b/src/vs/workbench/parts/files/browser/editors/fileEditorTracker.ts @@ -95,7 +95,7 @@ export class FileEditorTracker extends Disposable implements IWorkbenchContribut this.editorService.visibleEditors .map(editorInput => { const resource = toResource(editorInput, { supportSideBySide: true }); - return resource ? this.textFileService.models.get(resource) : void 0; + return resource ? this.textFileService.models.get(resource) : undefined; }) .filter(model => model && !model.isDirty()), m => m.getResource().toString() @@ -116,7 +116,7 @@ export class FileEditorTracker extends Disposable implements IWorkbenchContribut // Handle deletes if (e.operation === FileOperation.DELETE || e.operation === FileOperation.MOVE) { - this.handleDeletes(e.resource, false, e.target ? e.target.resource : void 0); + this.handleDeletes(e.resource, false, e.target ? e.target.resource : undefined); } } @@ -283,7 +283,7 @@ export class FileEditorTracker extends Disposable implements IWorkbenchContribut } } - return void 0; + return undefined; } private handleUpdates(e: FileChangesEvent): void { diff --git a/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts b/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts index ba0a6eac16eed..c700404bd397e 100644 --- a/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts +++ b/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts @@ -120,7 +120,7 @@ export class TextFileEditor extends BaseTextEditor { // Check for cancellation if (token.isCancellationRequested) { - return void 0; + return undefined; } // There is a special case where the text editor has to handle binary file editor input: if a binary file diff --git a/src/vs/workbench/parts/files/common/explorerModel.ts b/src/vs/workbench/parts/files/common/explorerModel.ts index 4f101f1d1b4d1..efc03521ff7df 100644 --- a/src/vs/workbench/parts/files/common/explorerModel.ts +++ b/src/vs/workbench/parts/files/common/explorerModel.ts @@ -409,7 +409,7 @@ export class NewStatPlaceholder extends ExplorerItem { this.isDirectoryResolved = false; this.isDirectory = false; - this.mtime = void 0; + this.mtime = undefined; } public getId(): string { diff --git a/src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts b/src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts index 0e1d9d3b494bc..cc6fe49a16455 100644 --- a/src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts +++ b/src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts @@ -29,7 +29,7 @@ import { Schemas } from 'vs/base/common/network'; const category = nls.localize('filesCategory', "File"); const registry = Registry.as(ActionExtensions.WorkbenchActions); -registry.registerWorkbenchAction(new SyncActionDescriptor(SaveAllAction, SaveAllAction.ID, SaveAllAction.LABEL, { primary: void 0, mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_S }, win: { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.KEY_S) } }), 'File: Save All', category); +registry.registerWorkbenchAction(new SyncActionDescriptor(SaveAllAction, SaveAllAction.ID, SaveAllAction.LABEL, { primary: undefined, mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_S }, win: { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.KEY_S) } }), 'File: Save All', category); registry.registerWorkbenchAction(new SyncActionDescriptor(GlobalCompareResourcesAction, GlobalCompareResourcesAction.ID, GlobalCompareResourcesAction.LABEL), 'File: Compare Active File With...', category); registry.registerWorkbenchAction(new SyncActionDescriptor(FocusFilesExplorer, FocusFilesExplorer.ID, FocusFilesExplorer.LABEL), 'File: Focus on Files Explorer', category); registry.registerWorkbenchAction(new SyncActionDescriptor(ShowActiveFileInExplorer, ShowActiveFileInExplorer.ID, ShowActiveFileInExplorer.LABEL), 'File: Reveal Active File in Side Bar', category); diff --git a/src/vs/workbench/parts/files/electron-browser/fileActions.ts b/src/vs/workbench/parts/files/electron-browser/fileActions.ts index a020dda27992b..2827d61714db9 100644 --- a/src/vs/workbench/parts/files/electron-browser/fileActions.ts +++ b/src/vs/workbench/parts/files/electron-browser/fileActions.ts @@ -211,7 +211,7 @@ class TriggerRenameFileAction extends BaseFileAction { }); }); - return void 0; + return undefined; } } @@ -254,7 +254,7 @@ export abstract class BaseRenameAction extends BaseFileAction { } // Call function and Emit Event through viewer - const promise = this.runAction(name).then(void 0, (error: any) => { + const promise = this.runAction(name).then(undefined, (error: any) => { this.onError(error); }); @@ -520,7 +520,7 @@ class CreateFolderAction extends BaseCreateAction { public runAction(fileName: string): Promise { const resource = this.element.parent.resource; - return this.fileService.createFolder(resources.joinPath(resource, fileName)).then(void 0, (error) => { + return this.fileService.createFolder(resources.joinPath(resource, fileName)).then(undefined, (error) => { this.onErrorWithRetry(error, () => this.runAction(fileName)); }); } @@ -644,7 +644,7 @@ class BaseDeleteFileAction extends BaseFileAction { return confirmDeletePromise.then(confirmation => { // Check for confirmation checkbox - let updateConfirmSettingsPromise: Promise = Promise.resolve(void 0); + let updateConfirmSettingsPromise: Promise = Promise.resolve(undefined); if (confirmation.confirmed && confirmation.checkboxChecked === true) { updateConfirmSettingsPromise = this.configurationService.updateValue(BaseDeleteFileAction.CONFIRM_DELETE_SETTING_KEY, false, ConfigurationTarget.USER); } @@ -696,7 +696,7 @@ class BaseDeleteFileAction extends BaseFileAction { return this.run(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); }); }); @@ -823,7 +823,7 @@ export class AddFilesAction extends BaseFileAction { return overwritePromise.then(res => { if (!res.confirmed) { - return void 0; + return undefined; } // Run add in sequence @@ -859,7 +859,7 @@ export class AddFilesAction extends BaseFileAction { }); } - return void 0; + return undefined; }); return addPromise.then(() => { @@ -962,7 +962,7 @@ class PasteFileAction extends BaseFileAction { return this.editorService.openEditor({ resource: stat.resource, options: { pinned: true } }); } - return void 0; + return undefined; }, error => this.onError(error)).then(() => { this.tree.domFocus(); }); @@ -1007,7 +1007,7 @@ export class DuplicateFileAction extends BaseFileAction { return this.editorService.openEditor({ resource: stat.resource, options: { pinned: true } }); } - return void 0; + return undefined; }, error => this.onError(error)); return result; @@ -1115,7 +1115,7 @@ export class GlobalCompareResourcesAction extends Action { public run(): Promise { const activeInput = this.editorService.activeEditor; - const activeResource = activeInput ? activeInput.getResource() : void 0; + const activeResource = activeInput ? activeInput.getResource() : undefined; if (activeResource) { // Compare with next editor that opens @@ -1131,11 +1131,11 @@ export class GlobalCompareResourcesAction extends Action { override: this.editorService.openEditor({ leftResource: activeResource, rightResource: resource - }).then(() => void 0) + }).then(() => undefined) }; } - return void 0; + return undefined; }); // Bring up quick open diff --git a/src/vs/workbench/parts/files/electron-browser/fileCommands.ts b/src/vs/workbench/parts/files/electron-browser/fileCommands.ts index 7d6505f3a82d9..c03f7b4a3beca 100644 --- a/src/vs/workbench/parts/files/electron-browser/fileCommands.ts +++ b/src/vs/workbench/parts/files/electron-browser/fileCommands.ts @@ -142,12 +142,12 @@ function save( // fixes https://github.com/Microsoft/vscode/issues/59655 options = ensureForcedSave(options); - savePromise = textFileService.saveAs(resource, void 0, options); + savePromise = textFileService.saveAs(resource, undefined, options); } return savePromise.then((target) => { if (!target || target.toString() === resource.toString()) { - return void 0; // save canceled or same resource used + return undefined; // save canceled or same resource used } const replacement: IResourceInput = { @@ -239,7 +239,7 @@ CommandsRegistry.registerCommand({ .filter(resource => resource.scheme !== Schemas.untitled); if (resources.length) { - return textFileService.revertAll(resources, { force: true }).then(void 0, error => { + return textFileService.revertAll(resources, { force: true }).then(undefined, error => { notificationService.error(nls.localize('genericRevertError', "Failed to revert '{0}': {1}", resources.map(r => paths.basename(r.fsPath)).join(', '), toErrorMessage(error, false))); }); } @@ -304,7 +304,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ const name = paths.basename(uri.fsPath); const editorLabel = nls.localize('modifiedLabel', "{0} (on disk) ↔ {1}", name, name); - return editorService.openEditor({ leftResource: uri.with({ scheme: COMPARE_WITH_SAVED_SCHEMA }), rightResource: uri, label: editorLabel }).then(() => void 0); + return editorService.openEditor({ leftResource: uri.with({ scheme: COMPARE_WITH_SAVED_SCHEMA }), rightResource: uri, label: editorLabel }).then(() => undefined); } return Promise.resolve(true); @@ -364,7 +364,7 @@ CommandsRegistry.registerCommand({ return editorService.openEditor({ leftResource: globalResourceToCompare, rightResource: getResourceForCommand(resource, listService, editorService) - }).then(() => void 0); + }).then(() => undefined); } }); @@ -497,7 +497,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ resource = getResourceForCommand(resourceOrObject, accessor.get(IListService), editorService); } - return save(resource, true, void 0, editorService, accessor.get(IFileService), accessor.get(IUntitledEditorService), accessor.get(ITextFileService), accessor.get(IEditorGroupsService)); + return save(resource, true, undefined, editorService, accessor.get(IFileService), accessor.get(IUntitledEditorService), accessor.get(ITextFileService), accessor.get(IEditorGroupsService)); } }); @@ -512,7 +512,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ if (resources.length === 1) { // If only one resource is selected explictly call save since the behavior is a bit different than save all #41841 - return save(resources[0], false, void 0, editorService, accessor.get(IFileService), accessor.get(IUntitledEditorService), accessor.get(ITextFileService), accessor.get(IEditorGroupsService)); + return save(resources[0], false, undefined, editorService, accessor.get(IFileService), accessor.get(IUntitledEditorService), accessor.get(ITextFileService), accessor.get(IEditorGroupsService)); } return saveAll(resources, editorService, accessor.get(IUntitledEditorService), accessor.get(ITextFileService), accessor.get(IEditorGroupsService)); } @@ -532,7 +532,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ return save(resource, false, { skipSaveParticipants: true }, editorService, accessor.get(IFileService), accessor.get(IUntitledEditorService), accessor.get(ITextFileService), accessor.get(IEditorGroupsService)); } - return void 0; + return undefined; } }); diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts index 8cc11a0f7050d..d12674094f150 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts @@ -125,7 +125,7 @@ export class ExplorerView extends TreeViewsViewletPanel implements IExplorerView } private getFileEventsExcludes(root?: URI): glob.IExpression { - const scope = root ? { resource: root } : void 0; + const scope = root ? { resource: root } : undefined; const configuration = this.configurationService.getValue(scope); return (configuration && configuration.files && configuration.files.exclude) || Object.create(null); @@ -255,7 +255,7 @@ export class ExplorerView extends TreeViewsViewletPanel implements IExplorerView // Handle closed or untitled file (convince explorer to not reopen any file when getting visible) const activeInput = this.editorService.activeEditor; if (!activeInput || toResource(activeInput, { supportSideBySide: true, filter: Schemas.untitled })) { - this.viewState[ExplorerView.MEMENTO_LAST_ACTIVE_FILE_RESOURCE] = void 0; + this.viewState[ExplorerView.MEMENTO_LAST_ACTIVE_FILE_RESOURCE] = undefined; clearFocus = true; } @@ -738,7 +738,7 @@ export class ExplorerView extends TreeViewsViewletPanel implements IExplorerView */ public refresh(): Promise { if (!this.explorerViewer || this.explorerViewer.getHighlight()) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } // Focus @@ -761,7 +761,7 @@ export class ExplorerView extends TreeViewsViewletPanel implements IExplorerView return this.select(resourceToFocus, true); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); }); } @@ -927,18 +927,18 @@ export class ExplorerView extends TreeViewsViewletPanel implements IExplorerView // Require valid path if (!resource) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } // If path already selected, just reveal and return const selection = this.hasSingleSelection(resource); if (selection) { - return reveal ? this.reveal(selection, 0.5) : Promise.resolve(void 0); + return reveal ? this.reveal(selection, 0.5) : Promise.resolve(undefined); } // First try to get the stat object from the input to avoid a roundtrip if (!this.isCreated) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } const fileStat = this.model.findClosest(resource); @@ -973,7 +973,7 @@ export class ExplorerView extends TreeViewsViewletPanel implements IExplorerView private doSelect(fileStat: ExplorerItem, reveal: boolean): Promise { if (!fileStat) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } // Special case: we are asked to reveal and select an element that is not visible @@ -981,7 +981,7 @@ export class ExplorerView extends TreeViewsViewletPanel implements IExplorerView if (!this.filter.isVisible(this.tree, fileStat)) { fileStat = fileStat.parent; if (!fileStat) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -990,7 +990,7 @@ export class ExplorerView extends TreeViewsViewletPanel implements IExplorerView if (reveal) { revealPromise = this.reveal(fileStat, 0.5); } else { - revealPromise = Promise.resolve(void 0); + revealPromise = Promise.resolve(undefined); } return revealPromise.then(() => { @@ -1004,7 +1004,7 @@ export class ExplorerView extends TreeViewsViewletPanel implements IExplorerView private reveal(element: any, relativeTop?: number): Promise { if (!this.tree) { - return Promise.resolve(void 0); // return early if viewlet has not yet been created + return Promise.resolve(undefined); // return early if viewlet has not yet been created } return this.tree.reveal(element, relativeTop); } diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts index 4b24a42e8744f..813b30fe62e12 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts @@ -955,7 +955,7 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop { return this.workspaceEditingService.addFolders(folders); } - return void 0; + return undefined; }); } @@ -966,7 +966,7 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop { return addFilesAction.run(droppedResources.map(res => res.resource)); } - return void 0; + return undefined; }); } @@ -997,7 +997,7 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop { return confirmPromise.then(res => { // Check for confirmation checkbox - let updateConfirmSettingsPromise: Promise = Promise.resolve(void 0); + let updateConfirmSettingsPromise: Promise = Promise.resolve(undefined); if (res.confirmed && res.checkboxChecked === true) { updateConfirmSettingsPromise = this.configurationService.updateValue(FileDragAndDrop.CONFIRM_DND_SETTING_KEY, false, ConfigurationTarget.USER); } @@ -1005,10 +1005,10 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop { return updateConfirmSettingsPromise.then(() => { if (res.confirmed) { const rootDropPromise = this.doHandleRootDrop(sources.filter(s => s.isRoot), target); - return Promise.all(sources.filter(s => !s.isRoot).map(source => this.doHandleExplorerDrop(tree, source, target, isCopy)).concat(rootDropPromise)).then(() => void 0); + return Promise.all(sources.filter(s => !s.isRoot).map(source => this.doHandleExplorerDrop(tree, source, target, isCopy)).concat(rootDropPromise)).then(() => undefined); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); }); }); } @@ -1047,13 +1047,13 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop { private doHandleExplorerDrop(tree: ITree, source: ExplorerItem, target: ExplorerItem | Model, isCopy: boolean): Promise { if (!(target instanceof ExplorerItem)) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } return tree.expand(target).then(() => { if (target.isReadonly) { - return void 0; + return undefined; } // Reuse duplicate action if user copies @@ -1064,7 +1064,7 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop { // Otherwise move const targetResource = resources.joinPath(target.resource, source.name); - return this.textFileService.move(source.resource, targetResource).then(void 0, error => { + return this.textFileService.move(source.resource, targetResource).then(undefined, error => { // Conflict if ((error).fileOperationResult === FileOperationResult.FILE_MOVE_CONFLICT) { @@ -1078,10 +1078,10 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop { // Move with overwrite if the user confirms return this.dialogService.confirm(confirm).then(res => { if (res.confirmed) { - return this.textFileService.move(source.resource, targetResource, true /* overwrite */).then(void 0, error => this.notificationService.error(error)); + return this.textFileService.move(source.resource, targetResource, true /* overwrite */).then(undefined, error => this.notificationService.error(error)); } - return void 0; + return undefined; }); } @@ -1090,7 +1090,7 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop { this.notificationService.error(error); } - return void 0; + return undefined; }); }, errors.onUnexpectedError); } diff --git a/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts b/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts index 3375decb15ef8..56433813ebae7 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts @@ -566,11 +566,11 @@ class EditorGroupRenderer implements IListRenderer { @@ -639,7 +639,7 @@ class OpenEditorRenderer implements IListRenderer { }); test('Basics', function () { - let input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/file.js'), void 0); - const otherInput = instantiationService.createInstance(FileEditorInput, toResource(this, 'foo/bar/otherfile.js'), void 0); - const otherInputSame = instantiationService.createInstance(FileEditorInput, toResource(this, 'foo/bar/file.js'), void 0); + let input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/file.js'), undefined); + const otherInput = instantiationService.createInstance(FileEditorInput, toResource(this, 'foo/bar/otherfile.js'), undefined); + const otherInputSame = instantiationService.createInstance(FileEditorInput, toResource(this, 'foo/bar/file.js'), undefined); assert(input.matches(input)); assert(input.matches(otherInputSame)); @@ -57,10 +57,10 @@ suite('Files - FileEditorInput', () => { assert.strictEqual(toResource(this, '/foo/bar/file.js').fsPath, input.getResource().fsPath); assert(input.getResource() instanceof URI); - input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar.html'), void 0); + input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar.html'), undefined); - const inputToResolve: FileEditorInput = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/file.js'), void 0); - const sameOtherInput: FileEditorInput = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/file.js'), void 0); + const inputToResolve: FileEditorInput = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/file.js'), undefined); + const sameOtherInput: FileEditorInput = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/file.js'), undefined); return inputToResolve.resolve().then(resolved => { assert.ok(inputToResolve.isResolved()); @@ -99,10 +99,10 @@ suite('Files - FileEditorInput', () => { }); test('matches', function () { - const input1 = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), void 0); - const input2 = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), void 0); - const input3 = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/other.js'), void 0); - const input2Upper = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/UPDATEFILE.js'), void 0); + const input1 = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), undefined); + const input2 = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), undefined); + const input3 = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/other.js'), undefined); + const input2Upper = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/UPDATEFILE.js'), undefined); assert.strictEqual(input1.matches(null), false); assert.strictEqual(input1.matches(input1), true); @@ -113,7 +113,7 @@ suite('Files - FileEditorInput', () => { }); test('getEncoding/setEncoding', function () { - const input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), void 0); + const input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), undefined); input.setEncoding('utf16', EncodingMode.Encode); assert.equal(input.getEncoding(), 'utf16'); @@ -126,7 +126,7 @@ suite('Files - FileEditorInput', () => { }); test('save', function () { - const input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), void 0); + const input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), undefined); return input.resolve().then((resolved: TextFileEditorModel) => { resolved.textEditorModel.setValue('changed'); @@ -141,7 +141,7 @@ suite('Files - FileEditorInput', () => { }); test('revert', function () { - const input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), void 0); + const input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), undefined); return input.resolve().then((resolved: TextFileEditorModel) => { resolved.textEditorModel.setValue('changed'); @@ -156,7 +156,7 @@ suite('Files - FileEditorInput', () => { }); test('resolve handles binary files', function () { - const input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), void 0); + const input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), undefined); accessor.textFileService.setResolveTextContentErrorOnce(new FileOperationError('error', FileOperationResult.FILE_IS_BINARY)); @@ -168,7 +168,7 @@ suite('Files - FileEditorInput', () => { }); test('resolve handles too large files', function () { - const input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), void 0); + const input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), undefined); accessor.textFileService.setResolveTextContentErrorOnce(new FileOperationError('error', FileOperationResult.FILE_TOO_LARGE)); diff --git a/src/vs/workbench/parts/localizations/electron-browser/localizationsActions.ts b/src/vs/workbench/parts/localizations/electron-browser/localizationsActions.ts index 314887009ba79..4af595651f9bc 100644 --- a/src/vs/workbench/parts/localizations/electron-browser/localizationsActions.ts +++ b/src/vs/workbench/parts/localizations/electron-browser/localizationsActions.ts @@ -38,7 +38,7 @@ export class ConfigureLocaleAction extends Action { public run(event?: any): Promise { const file = URI.file(join(this.environmentService.appSettingsHome, 'locale.json')); - return this.fileService.resolveFile(file).then(void 0, (error) => { + return this.fileService.resolveFile(file).then(undefined, (error) => { return this.fileService.createFile(file, ConfigureLocaleAction.DEFAULT_CONTENT); }).then((stat): Promise | undefined => { if (!stat) { diff --git a/src/vs/workbench/parts/logs/electron-browser/logsActions.ts b/src/vs/workbench/parts/logs/electron-browser/logsActions.ts index 9b44b0f3fe3d5..a4d6c938d09c3 100644 --- a/src/vs/workbench/parts/logs/electron-browser/logsActions.ts +++ b/src/vs/workbench/parts/logs/electron-browser/logsActions.ts @@ -69,6 +69,6 @@ export class SetLogLevelAction extends Action { if (current === level) { return nls.localize('current', "Current"); } - return void 0; + return undefined; } } diff --git a/src/vs/workbench/parts/markers/electron-browser/markers.ts b/src/vs/workbench/parts/markers/electron-browser/markers.ts index 59940b9b88903..87af6149f01ac 100644 --- a/src/vs/workbench/parts/markers/electron-browser/markers.ts +++ b/src/vs/workbench/parts/markers/electron-browser/markers.ts @@ -109,7 +109,7 @@ export class MarkersWorkbenchService extends Disposable implements IMarkersWorkb return codeActions.map(codeAction => new Action( codeAction.command ? codeAction.command.id : codeAction.title, codeAction.title, - void 0, + undefined, true, () => { return this.openFileAtMarker(marker) @@ -149,7 +149,7 @@ export class MarkersWorkbenchService extends Disposable implements IMarkersWorkb pinned: false, revealIfVisible: true }, - }, ACTIVE_GROUP).then(() => void 0); + }, ACTIVE_GROUP).then(() => undefined); } private getFixes(marker: Marker): Promise { diff --git a/src/vs/workbench/parts/markers/electron-browser/markersModel.ts b/src/vs/workbench/parts/markers/electron-browser/markersModel.ts index 61ad8a6c8d23b..fec2e56c60d39 100644 --- a/src/vs/workbench/parts/markers/electron-browser/markersModel.ts +++ b/src/vs/workbench/parts/markers/electron-browser/markersModel.ts @@ -86,7 +86,7 @@ export class Marker { return JSON.stringify({ ...this.marker, resource: this.marker.resource.path, - relatedInformation: this.relatedInformation.length ? this.relatedInformation.map(r => ({ ...r.raw, resource: r.raw.resource.path })) : void 0 + relatedInformation: this.relatedInformation.length ? this.relatedInformation.map(r => ({ ...r.raw, resource: r.raw.resource.path })) : undefined }, null, '\t'); } } diff --git a/src/vs/workbench/parts/markers/electron-browser/markersPanel.ts b/src/vs/workbench/parts/markers/electron-browser/markersPanel.ts index 00e58fa9e517c..9ec004d32a5d1 100644 --- a/src/vs/workbench/parts/markers/electron-browser/markersPanel.ts +++ b/src/vs/workbench/parts/markers/electron-browser/markersPanel.ts @@ -413,7 +413,7 @@ export class MarkersPanel extends Panel implements IMarkerFilterController { private setCurrentActiveEditor(): void { const activeEditor = this.editorService.activeEditor; - this.currentActiveResource = activeEditor ? activeEditor.getResource() : void 0; + this.currentActiveResource = activeEditor ? activeEditor.getResource() : undefined; } private onSelected(): void { diff --git a/src/vs/workbench/parts/output/browser/outputPanel.ts b/src/vs/workbench/parts/output/browser/outputPanel.ts index 346b76de9e678..9ad546c5ac270 100644 --- a/src/vs/workbench/parts/output/browser/outputPanel.ts +++ b/src/vs/workbench/parts/output/browser/outputPanel.ts @@ -115,7 +115,7 @@ export class OutputPanel extends AbstractTextResourceEditor { public setInput(input: EditorInput, options: EditorOptions, token: CancellationToken): Promise { this._focus = !options.preserveFocus; if (input.matches(this.input)) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } if (this.input) { diff --git a/src/vs/workbench/parts/output/electron-browser/outputServices.ts b/src/vs/workbench/parts/output/electron-browser/outputServices.ts index 18019f5d085c8..e20c5dc6247ac 100644 --- a/src/vs/workbench/parts/output/electron-browser/outputServices.ts +++ b/src/vs/workbench/parts/output/electron-browser/outputServices.ts @@ -246,9 +246,9 @@ class OutputChannelBackedByFile extends AbstractFileOutputChannel implements Out this.startOffset = 0; this.endOffset = 0; if (this.model) { - return this.loadModel().then(() => void 0); + return this.loadModel().then(() => undefined); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } private loadFile(): Promise { @@ -487,7 +487,7 @@ export class OutputService extends Disposable implements IOutputService, ITextMo if (this._outputPanel && !preserveFocus) { this._outputPanel.focus(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } this.activeChannel = channel; @@ -530,7 +530,7 @@ export class OutputService extends Disposable implements IOutputService, ITextMo return this.doShowChannel(this.activeChannel, preserveFocus); } } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } private onDidPanelClose(panel: IPanel): void { @@ -570,7 +570,7 @@ export class OutputService extends Disposable implements IOutputService, ITextMo this.showChannel(channel.id, true); } else { this.activeChannel = channel; - this._onActiveOutputChannel.fire(channel ? channel.id : void 0); + this._onActiveOutputChannel.fire(channel ? channel.id : undefined); } } Registry.as(Extensions.OutputChannels).removeChannel(id); @@ -616,7 +616,7 @@ export class OutputService extends Disposable implements IOutputService, ITextMo // Activate smart scroll when switching back to the output panel .then(() => this.setPrimaryCursorToLastLine()); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } private isChannelShown(channel: IOutputChannel): boolean { @@ -692,7 +692,7 @@ class BufferredOutputChannel extends Disposable implements OutputChannel { private modelUpdater: RunOnceScheduler; private model: ITextModel; private readonly bufferredContent: BufferedContent; - private lastReadId: number = void 0; + private lastReadId: number = undefined; constructor( protected readonly outputChannelIdentifier: IOutputChannelDescriptor, @@ -728,7 +728,7 @@ class BufferredOutputChannel extends Disposable implements OutputChannel { this.model.setValue(''); } this.bufferredContent.clear(); - this.lastReadId = void 0; + this.lastReadId = undefined; } loadModel(): Promise { @@ -803,7 +803,7 @@ class BufferedContent { public getDelta(previousId?: number): { value: string, id: number } { let idx = -1; - if (previousId !== void 0) { + if (previousId !== undefined) { idx = binarySearch(this.dataIds, previousId, (a, b) => a - b); } diff --git a/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts b/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts index 7b2fad0626403..75c97362584b8 100644 --- a/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts +++ b/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts @@ -304,7 +304,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor this.sortByPrecedenceAction = new Action('keybindings.editor.sortByPrecedence', sortByPrecedenceActionKeybinding ? localize('sortByPrecedeneLabelWithKeybinding', "{0} ({1})", sortByPrecedenceActionLabel, sortByPrecedenceActionKeybinding.getLabel()) : sortByPrecedenceActionLabel, 'sort-by-precedence'); this.sortByPrecedenceAction.checked = false; this._register(this.sortByPrecedenceAction.onDidChange(e => { - if (e.checked !== void 0) { + if (e.checked !== undefined) { this.renderKeybindingsEntries(false); } })); @@ -314,7 +314,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor this.recordKeysAction = new Action(KEYBINDINGS_EDITOR_COMMAND_RECORD_SEARCH_KEYS, recordKeysActionKeybinding ? localize('recordKeysLabelWithKeybinding', "{0} ({1})", recordKeysActionLabel, recordKeysActionKeybinding.getLabel()) : recordKeysActionLabel, 'record-keys'); this.recordKeysAction.checked = false; this._register(this.recordKeysAction.onDidChange(e => { - if (e.checked !== void 0) { + if (e.checked !== undefined) { DOM.toggleClass(recordingBadge, 'disabled', !e.checked); if (e.checked) { this.searchWidget.inputBox.setPlaceHolder(keybindingsSearchPlaceholder); @@ -426,7 +426,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor return this.input.resolve() .then((keybindingsModel: KeybindingsEditorModel) => { if (token.isCancellationRequested) { - return void 0; + return undefined; } this.keybindingsEditorModel = keybindingsModel; @@ -440,7 +440,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor }) .then(() => { if (token.isCancellationRequested) { - return void 0; + return undefined; } this.renderKeybindingsEntries(false, preserveFocus); diff --git a/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts b/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts index 1e41885feef69..97b15e1c5e775 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts @@ -210,7 +210,7 @@ export class PreferencesEditor extends BaseEditor { private updateInput(newInput: PreferencesEditorInput, options: EditorOptions, token: CancellationToken): Promise { return this.sideBySidePreferencesWidget.setInput(newInput.details, newInput.master, options, token).then(({ defaultPreferencesRenderer, editablePreferencesRenderer }) => { if (token.isCancellationRequested) { - return void 0; + return undefined; } this.preferencesRenderers.defaultPreferencesRenderer = defaultPreferencesRenderer; @@ -523,7 +523,7 @@ class PreferencesRenderersController extends Disposable { if (!query) { // Don't open the other settings targets when query is empty this._onDidFilterResultsCountChange.fire({ target, count: 0 }); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } return this.getPreferencesEditorModel(target).then(model => { @@ -937,7 +937,7 @@ class SideBySidePreferencesWidget extends Widget { return editor.setInput(input, options, token) .then(() => { if (token.isCancellationRequested) { - return void 0; + return undefined; } return (editor.getControl()).getContribution(editorContributionId).updatePreferencesRenderer(associatedPreferencesModelUri); @@ -1046,14 +1046,14 @@ export class DefaultPreferencesEditor extends BaseTextEditor { .then(() => this.input.resolve() .then(editorModel => { if (token.isCancellationRequested) { - return void 0; + return undefined; } return editorModel.load(); }) .then(editorModel => { if (token.isCancellationRequested) { - return void 0; + return undefined; } this.getControl().setModel((editorModel).textEditorModel); diff --git a/src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts b/src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts index 251dd5500f005..b4328ef07d01a 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts @@ -554,7 +554,7 @@ export class SettingsTargetsWidget extends Widget { this.settingsTarget = settingsTarget; this._onDidTargetChange.fire(this.settingsTarget); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } private update(): void { diff --git a/src/vs/workbench/parts/preferences/browser/settingsTree.ts b/src/vs/workbench/parts/preferences/browser/settingsTree.ts index d15e7418c92a2..17c665a1760a4 100644 --- a/src/vs/workbench/parts/preferences/browser/settingsTree.ts +++ b/src/vs/workbench/parts/preferences/browser/settingsTree.ts @@ -1395,7 +1395,7 @@ class CopySettingIdAction extends Action { this.clipboardService.writeText(context.setting.key); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -1415,6 +1415,6 @@ class CopySettingAsJSONAction extends Action { this.clipboardService.writeText(jsonResult); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } diff --git a/src/vs/workbench/parts/preferences/common/preferencesContribution.ts b/src/vs/workbench/parts/preferences/common/preferencesContribution.ts index aba86dff4c431..30ea0ebe585f8 100644 --- a/src/vs/workbench/parts/preferences/common/preferencesContribution.ts +++ b/src/vs/workbench/parts/preferences/common/preferencesContribution.ts @@ -68,14 +68,14 @@ export class PreferencesContribution implements IWorkbenchContribution { !endsWith(resource.path, 'settings.json') || // resource must end in settings.json !this.configurationService.getValue(USE_SPLIT_JSON_SETTING) // user has not disabled default settings editor ) { - return void 0; + return undefined; } // If the resource was already opened before in the group, do not prevent // the opening of that resource. Otherwise we would have the same settings // opened twice (https://github.com/Microsoft/vscode/issues/36447) if (group.isOpened(editor)) { - return void 0; + return undefined; } // Global User Settings File @@ -102,7 +102,7 @@ export class PreferencesContribution implements IWorkbenchContribution { } } - return void 0; + return undefined; } private start(): void { diff --git a/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts b/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts index b2e23c82996e2..2c7496088f7a7 100644 --- a/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts +++ b/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts @@ -787,7 +787,7 @@ export class SettingsEditor2 extends BaseEditor { return this.input.resolve() .then((model: Settings2EditorModel) => { if (token.isCancellationRequested) { - return void 0; + return undefined; } this._register(model.onDidChangeGroups(() => this.onConfigUpdate())); @@ -874,7 +874,7 @@ export class SettingsEditor2 extends BaseEditor { this.tocTree.collapseAll(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } private updateElementsByKey(keys: string[]): Promise { @@ -904,7 +904,7 @@ export class SettingsEditor2 extends BaseEditor { private renderTree(key?: string, force = false): Promise { if (!force && key && this.scheduledRefreshes.has(key)) { this.updateModifiedLabelForKey(key); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } // If a setting control is currently focused, schedule a refresh for later diff --git a/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts b/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts index 23b5d9275d793..5b0c8b977957c 100644 --- a/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts +++ b/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts @@ -154,9 +154,9 @@ export class ShowAllCommandsAction extends Action { value = `${value}${lastCommandPaletteInput}`; } - this.quickOpenService.show(value, { inputSelection: lastCommandPaletteInput ? { start: 1 /* after prefix */, end: value.length } : void 0 }); + this.quickOpenService.show(value, { inputSelection: lastCommandPaletteInput ? { start: 1 /* after prefix */, end: value.length } : undefined }); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -180,7 +180,7 @@ export class ClearCommandHistoryAction extends Action { commandCounter = 1; } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -205,7 +205,7 @@ class CommandPaletteEditorAction extends EditorAction { // Show with prefix quickOpenService.show(ALL_COMMANDS_PREFIX); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -228,7 +228,7 @@ abstract class BaseCommandEntry extends QuickOpenEntryGroup { super(); this.labelLowercase = this.label.toLowerCase(); - this.keybindingAriaLabel = keybinding ? keybinding.getAriaLabel() : void 0; + this.keybindingAriaLabel = keybinding ? keybinding.getAriaLabel() : undefined; if (this.label !== alias) { this.alias = alias; @@ -555,7 +555,7 @@ export class CommandsHandler extends QuickOpenHandler { if (autoFocusPrefixMatch && this.commandHistoryEnabled) { const firstEntry = context.model && context.model.entries[0]; if (firstEntry instanceof BaseCommandEntry && this.commandsHistory.peek(firstEntry.getCommandId())) { - autoFocusPrefixMatch = void 0; // keep focus on MRU element if we have history elements + autoFocusPrefixMatch = undefined; // keep focus on MRU element if we have history elements } } diff --git a/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts b/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts index 5ef1f1673d1ba..dc7fcb9d8a9ff 100644 --- a/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts +++ b/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts @@ -386,8 +386,8 @@ export class GotoSymbolHandler extends QuickOpenHandler { private onDidActiveEditorChange(): void { this.clearOutlineRequest(); - this.lastKnownEditorViewState = void 0; - this.rangeHighlightDecorationId = void 0; + this.lastKnownEditorViewState = undefined; + this.rangeHighlightDecorationId = undefined; } getResults(searchValue: string, token: CancellationToken): Promise { @@ -595,7 +595,7 @@ export class GotoSymbolHandler extends QuickOpenHandler { if (this.pendingOutlineRequest) { this.pendingOutlineRequest.cancel(); this.pendingOutlineRequest.dispose(); - this.pendingOutlineRequest = void 0; + this.pendingOutlineRequest = undefined; } this.cachedOutlineRequest = null; diff --git a/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.ts b/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.ts index a6b47c941300c..ecd1cf645d694 100644 --- a/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.ts +++ b/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.ts @@ -122,7 +122,7 @@ export class ViewPickerHandler extends QuickOpenHandler { } } else { e.setShowBorder(false); - e.setGroupLabel(void 0); + e.setGroupLabel(undefined); } }); diff --git a/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts b/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts index 25c48d35b3019..70c6ea82a473f 100644 --- a/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts +++ b/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts @@ -59,7 +59,7 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo super(); const workspace = this.contextService.getWorkspace(); - this.firstFolderResource = workspace.folders.length > 0 ? workspace.folders[0].uri : void 0; + this.firstFolderResource = workspace.folders.length > 0 ? workspace.folders[0].uri : undefined; this.extensionHostRestarter = new RunOnceScheduler(() => this.extensionService.restartExtensionHost(), 10); this.onConfigurationChange(configurationService.getValue(), false); @@ -162,7 +162,7 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo // Update our known first folder path if we entered workspace const workspace = this.contextService.getWorkspace(); - this.firstFolderResource = workspace.folders.length > 0 ? workspace.folders[0].uri : void 0; + this.firstFolderResource = workspace.folders.length > 0 ? workspace.folders[0].uri : undefined; // Install workspace folder listener if (!this.onDidChangeWorkspaceFoldersUnbind) { @@ -180,7 +180,7 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo const workspace = this.contextService.getWorkspace(); // Restart extension host if first root folder changed (impact on deprecated workspace.rootPath API) - const newFirstFolderResource = workspace.folders.length > 0 ? workspace.folders[0].uri : void 0; + const newFirstFolderResource = workspace.folders.length > 0 ? workspace.folders[0].uri : undefined; if (!isEqual(this.firstFolderResource, newFirstFolderResource, !isLinux)) { this.firstFolderResource = newFirstFolderResource; @@ -203,7 +203,7 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo }); } - return void 0; + return undefined; }); } } diff --git a/src/vs/workbench/parts/scm/electron-browser/scmActivity.ts b/src/vs/workbench/parts/scm/electron-browser/scmActivity.ts index 487682e96d3e9..a90d7f067d0a4 100644 --- a/src/vs/workbench/parts/scm/electron-browser/scmActivity.ts +++ b/src/vs/workbench/parts/scm/electron-browser/scmActivity.ts @@ -93,7 +93,7 @@ export class StatusBarController implements IWorkbenchContribution { @IContextKeyService contextKeyService: IContextKeyService, @IEditorService private editorService: IEditorService ) { - this.focusedProviderContextKey = contextKeyService.createKey('scmProvider', void 0); + this.focusedProviderContextKey = contextKeyService.createKey('scmProvider', undefined); this.scmService.onDidAddRepository(this.onDidAddRepository, this, this.disposables); for (const repository of this.scmService.repositories) { diff --git a/src/vs/workbench/parts/scm/electron-browser/scmMenus.ts b/src/vs/workbench/parts/scm/electron-browser/scmMenus.ts index 094ccd6766504..bb11097129e16 100644 --- a/src/vs/workbench/parts/scm/electron-browser/scmMenus.ts +++ b/src/vs/workbench/parts/scm/electron-browser/scmMenus.ts @@ -55,7 +55,7 @@ export class SCMMenus implements IDisposable { @IContextMenuService private contextMenuService: IContextMenuService ) { this.contextKeyService = contextKeyService.createScoped(); - const scmProviderKey = this.contextKeyService.createKey('scmProvider', void 0); + const scmProviderKey = this.contextKeyService.createKey('scmProvider', undefined); if (provider) { scmProviderKey.set(provider.contextValue); diff --git a/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts b/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts index 926949b2902d3..22a296419ecbb 100644 --- a/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts +++ b/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts @@ -317,7 +317,7 @@ class MainPanel extends ViewletPanel { const repository = e.element; const contextKeyService = this.contextKeyService.createScoped(); - const scmProviderKey = contextKeyService.createKey('scmProvider', void 0); + const scmProviderKey = contextKeyService.createKey('scmProvider', undefined); scmProviderKey.set(repository.provider.contextValue); const menu = this.menuService.createMenu(MenuId.SCMSourceControl, contextKeyService); diff --git a/src/vs/workbench/parts/search/browser/openFileHandler.ts b/src/vs/workbench/parts/search/browser/openFileHandler.ts index 68fae351be9e6..cdaf562dab860 100644 --- a/src/vs/workbench/parts/search/browser/openFileHandler.ts +++ b/src/vs/workbench/parts/search/browser/openFileHandler.ts @@ -193,7 +193,7 @@ export class OpenFileHandler extends QuickOpenHandler { if (paths.isAbsolute(query.original)) { const resource = URI.file(query.original); - return this.fileService.resolveFile(resource).then(stat => stat.isDirectory ? void 0 : resource, error => void 0); + return this.fileService.resolveFile(resource).then(stat => stat.isDirectory ? undefined : resource, error => undefined); } return Promise.resolve(null); @@ -320,11 +320,11 @@ export class CacheState { dispose(): void { if (this.promise) { - this.promise.then(void 0, () => { }) + this.promise.then(undefined, () => { }) .then(() => { this.loadingPhase = LoadingPhase.Disposed; return this.doDispose(this._cacheKey); - }).then(void 0, err => { + }).then(undefined, err => { errors.onUnexpectedError(err); }); } else { diff --git a/src/vs/workbench/parts/search/browser/openSymbolHandler.ts b/src/vs/workbench/parts/search/browser/openSymbolHandler.ts index d9261996f532d..4b4012b8ee6a8 100644 --- a/src/vs/workbench/parts/search/browser/openSymbolHandler.ts +++ b/src/vs/workbench/parts/search/browser/openSymbolHandler.ts @@ -82,7 +82,7 @@ class SymbolEntry extends EditorQuickOpenEntry { // open after resolving Promise.resolve(this.bearingResolve).then(() => { - const scheme = this.bearing.location.uri ? this.bearing.location.uri.scheme : void 0; + const scheme = this.bearing.location.uri ? this.bearing.location.uri.scheme : undefined; if (scheme === Schemas.http || scheme === Schemas.https) { if (mode === Mode.OPEN || mode === Mode.OPEN_IN_BACKGROUND) { this.openerService.open(this.bearing.location.uri); // support http/https resources (https://github.com/Microsoft/vscode/issues/58924)) diff --git a/src/vs/workbench/parts/search/browser/searchActions.ts b/src/vs/workbench/parts/search/browser/searchActions.ts index 887b1416eee13..7bf48df1053a9 100644 --- a/src/vs/workbench/parts/search/browser/searchActions.ts +++ b/src/vs/workbench/parts/search/browser/searchActions.ts @@ -298,7 +298,7 @@ export class CollapseDeepestExpandedLevelAction extends Action { viewer.domFocus(); viewer.focusFirst(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -353,7 +353,7 @@ export class CancelSearchAction extends Action { searchView.cancelSearch(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -629,7 +629,7 @@ export class ReplaceAction extends AbstractSearchAndReplaceAction { private hasToOpenFile(): boolean { const activeEditor = this.editorService.activeEditor; - const file = activeEditor ? activeEditor.getResource() : void 0; + const file = activeEditor ? activeEditor.getResource() : undefined; if (file) { return file.toString() === this.element.parent().resource().toString(); } diff --git a/src/vs/workbench/parts/search/browser/searchView.ts b/src/vs/workbench/parts/search/browser/searchView.ts index db602c6a9bbe8..3335fb154622e 100644 --- a/src/vs/workbench/parts/search/browser/searchView.ts +++ b/src/vs/workbench/parts/search/browser/searchView.ts @@ -599,7 +599,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { } private clearMessage(): HTMLElement { - this.searchWithoutFolderMessageElement = void 0; + this.searchWithoutFolderMessageElement = undefined; dom.clearNode(this.messagesElement); dom.show(this.messagesElement); @@ -1630,7 +1630,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { } return range; } - return void 0; + return undefined; } private onUntitledDidChangeDirty(resource: URI): void { diff --git a/src/vs/workbench/parts/search/browser/searchWidget.ts b/src/vs/workbench/parts/search/browser/searchWidget.ts index 3292422af4524..830eb477d9191 100644 --- a/src/vs/workbench/parts/search/browser/searchWidget.ts +++ b/src/vs/workbench/parts/search/browser/searchWidget.ts @@ -193,7 +193,7 @@ export class SearchWidget extends Widget { } toggleReplace(show?: boolean): void { - if (show === void 0 || show !== this.isReplaceShown()) { + if (show === undefined || show !== this.isReplaceShown()) { this.onToggleReplaceButton(); } } diff --git a/src/vs/workbench/parts/search/electron-browser/search.contribution.ts b/src/vs/workbench/parts/search/electron-browser/search.contribution.ts index 2769981458a90..ec37aa744eca9 100644 --- a/src/vs/workbench/parts/search/electron-browser/search.contribution.ts +++ b/src/vs/workbench/parts/search/electron-browser/search.contribution.ts @@ -362,7 +362,7 @@ const searchInFolderCommand: ICommandHandler = (accessor, resource?: URI) => { }); } - return void 0; + return undefined; }); }; @@ -436,7 +436,7 @@ class ShowAllSymbolsAction extends Action { run(context?: any): Promise { let prefix = ShowAllSymbolsAction.ALL_SYMBOLS_PREFIX; - let inputSelection: { start: number; end: number; } = void 0; + let inputSelection: { start: number; end: number; } = undefined; const editor = this.editorService.getFocusedCodeEditor(); const word = editor && getSelectionSearchString(editor); if (word) { @@ -446,7 +446,7 @@ class ShowAllSymbolsAction extends Action { this.quickOpenService.show(prefix, { inputSelection }); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } diff --git a/src/vs/workbench/parts/search/test/browser/searchActions.test.ts b/src/vs/workbench/parts/search/test/browser/searchActions.test.ts index a43433f850334..26dbb0d902cf3 100644 --- a/src/vs/workbench/parts/search/test/browser/searchActions.test.ts +++ b/src/vs/workbench/parts/search/test/browser/searchActions.test.ts @@ -77,7 +77,7 @@ suite('Search Actions', () => { const testObject: ReplaceAction = instantiationService.createInstance(ReplaceAction, tree, target, null); const actual = testObject.getElementToFocusAfterRemoved(tree, target); - assert.equal(void 0, actual); + assert.equal(undefined, actual); }); test('get next element to focus after removing a file match when it has next sibling', function () { @@ -114,7 +114,7 @@ suite('Search Actions', () => { const testObject: ReplaceAction = instantiationService.createInstance(ReplaceAction, tree, target, null); const actual = testObject.getElementToFocusAfterRemoved(tree, target); - assert.equal(void 0, actual); + assert.equal(undefined, actual); }); function aFileMatch(): FileMatch { diff --git a/src/vs/workbench/parts/stats/node/workspaceStats.ts b/src/vs/workbench/parts/stats/node/workspaceStats.ts index bd4fa9de7eead..82f14b0e445ae 100644 --- a/src/vs/workbench/parts/stats/node/workspaceStats.ts +++ b/src/vs/workbench/parts/stats/node/workspaceStats.ts @@ -319,7 +319,7 @@ export class WorkspaceStats implements IWorkbenchContribution { let workspaceId: string | undefined; switch (state) { case WorkbenchState.EMPTY: - workspaceId = void 0; + workspaceId = undefined; break; case WorkbenchState.FOLDER: workspaceId = crypto.createHash('sha1').update(workspace.folders[0].uri.scheme === Schemas.file ? workspace.folders[0].uri.fsPath : workspace.folders[0].uri.toString()).digest('hex'); @@ -687,7 +687,7 @@ export class WorkspaceStats implements IWorkbenchContribution { */ this.telemetryService.publicLog('workspace.azure', tags); } - }).then(void 0, onUnexpectedError); + }).then(undefined, onUnexpectedError); } private reportCloudStats(): void { @@ -712,6 +712,6 @@ export class WorkspaceStats implements IWorkbenchContribution { } */ this.telemetryService.publicLog('resolveProxy.stats', { type }); - }).then(void 0, onUnexpectedError); + }).then(undefined, onUnexpectedError); } } diff --git a/src/vs/workbench/parts/tasks/common/problemCollectors.ts b/src/vs/workbench/parts/tasks/common/problemCollectors.ts index 08b3b3d7b0a29..2c226920567b7 100644 --- a/src/vs/workbench/parts/tasks/common/problemCollectors.ts +++ b/src/vs/workbench/parts/tasks/common/problemCollectors.ts @@ -79,7 +79,7 @@ export class AbstractProblemCollector implements IDisposable { this.applyToByOwner = new Map(); for (let problemMatcher of problemMatchers) { let current = this.applyToByOwner.get(problemMatcher.owner); - if (current === void 0) { + if (current === undefined) { this.applyToByOwner.set(problemMatcher.owner, problemMatcher.applyTo); } else { this.applyToByOwner.set(problemMatcher.owner, this.mergeApplyTo(current, problemMatcher.applyTo)); @@ -188,7 +188,7 @@ export class AbstractProblemCollector implements IDisposable { private captureMatch(match: ProblemMatch): void { this._numberOfMatches++; - if (this._maxMarkerSeverity === void 0 || match.marker.severity > this._maxMarkerSeverity) { + if (this._maxMarkerSeverity === undefined || match.marker.severity > this._maxMarkerSeverity) { this._maxMarkerSeverity = match.marker.severity; } } diff --git a/src/vs/workbench/parts/tasks/common/problemMatcher.ts b/src/vs/workbench/parts/tasks/common/problemMatcher.ts index 6da519a9154f9..8b636ab93cedb 100644 --- a/src/vs/workbench/parts/tasks/common/problemMatcher.ts +++ b/src/vs/workbench/parts/tasks/common/problemMatcher.ts @@ -189,14 +189,14 @@ export function getResource(filename: string, matcher: ProblemMatcher): URI { } else if ((kind === FileLocationKind.Relative) && matcher.filePrefix) { fullPath = Paths.join(matcher.filePrefix, filename); } - if (fullPath === void 0) { + if (fullPath === undefined) { throw new Error('FileLocationKind is not actionable. Does the matcher have a filePrefix? This should never happen.'); } fullPath = fullPath.replace(/\\/g, '/'); if (fullPath[0] !== '/') { fullPath = '/' + fullPath; } - if (matcher.uriProvider !== void 0) { + if (matcher.uriProvider !== undefined) { return matcher.uriProvider(fullPath); } else { return URI.file(fullPath); @@ -272,7 +272,7 @@ abstract class AbstractLineMatcher implements ILineMatcher { const patternAtProperty = pattern[property]; if (Types.isUndefined(data[property]) && !Types.isUndefined(patternAtProperty) && patternAtProperty < matches.length) { let value = matches[patternAtProperty]; - if (value !== void 0) { + if (value !== undefined) { if (trim) { value = Strings.trim(value)!; } @@ -293,10 +293,10 @@ abstract class AbstractLineMatcher implements ILineMatcher { endColumn: location.endCharacter, message: data.message }; - if (data.code !== void 0) { + if (data.code !== undefined) { marker.code = data.code; } - if (this.matcher.source !== void 0) { + if (this.matcher.source !== undefined) { marker.source = this.matcher.source; } return { @@ -400,7 +400,7 @@ class SingleLineMatcher extends AbstractLineMatcher { public handle(lines: string[], start: number = 0): HandleResult { Assert.ok(lines.length - start === 1); let data: ProblemData = Object.create(null); - if (this.pattern.kind !== void 0) { + if (this.pattern.kind !== undefined) { data.kind = this.pattern.kind; } let matches = this.pattern.regexp.exec(lines[start]); @@ -884,7 +884,7 @@ export class ProblemPatternParser extends Parser { private doCreateSingleProblemPattern(value: Config.CheckedProblemPattern, setDefaults: boolean): ProblemPattern { const regexp = this.createRegularExpression(value.regexp); - if (regexp === void 0) { + if (regexp === undefined) { throw new Error('Invalid regular expression'); } let result: ProblemPattern = { regexp }; @@ -1367,23 +1367,23 @@ export class ProblemMatcherParser extends Parser { let base = ProblemMatcherRegistry.get(variableName.substring(1)); if (base) { result = Objects.deepClone(base); - if (description.owner !== void 0 && owner !== void 0) { + if (description.owner !== undefined && owner !== undefined) { result.owner = owner; } - if (description.source !== void 0 && source !== void 0) { + if (description.source !== undefined && source !== undefined) { result.source = source; } - if (description.fileLocation !== void 0 && fileLocation !== void 0) { + if (description.fileLocation !== undefined && fileLocation !== undefined) { result.fileLocation = fileLocation; result.filePrefix = filePrefix; } - if (description.pattern !== void 0 && pattern !== void 0 && pattern !== null) { + if (description.pattern !== undefined && pattern !== undefined && pattern !== null) { result.pattern = pattern; } - if (description.severity !== void 0 && severity !== void 0) { + if (description.severity !== undefined && severity !== undefined) { result.severity = severity; } - if (description.applyTo !== void 0 && applyTo !== void 0) { + if (description.applyTo !== undefined && applyTo !== undefined) { result.applyTo = applyTo; } } diff --git a/src/vs/workbench/parts/tasks/common/taskDefinitionRegistry.ts b/src/vs/workbench/parts/tasks/common/taskDefinitionRegistry.ts index daec033c515f8..6d901a55a63a0 100644 --- a/src/vs/workbench/parts/tasks/common/taskDefinitionRegistry.ts +++ b/src/vs/workbench/parts/tasks/common/taskDefinitionRegistry.ts @@ -125,7 +125,7 @@ class TaskDefinitionRegistryImpl implements ITaskDefinitionRegistry { } public getJsonSchema(): IJSONSchema { - if (this._schema === void 0) { + if (this._schema === undefined) { let schemas: IJSONSchema[] = []; for (let definition of this.all()) { let schema: IJSONSchema = { @@ -135,7 +135,7 @@ class TaskDefinitionRegistryImpl implements ITaskDefinitionRegistry { if (definition.required.length > 0) { schema.required = definition.required.slice(0); } - if (definition.properties !== void 0) { + if (definition.properties !== undefined) { schema.properties = Objects.deepClone(definition.properties); } else { schema.properties = Object.create(null); diff --git a/src/vs/workbench/parts/tasks/common/tasks.ts b/src/vs/workbench/parts/tasks/common/tasks.ts index 5aed91f76788f..fce06577c70f8 100644 --- a/src/vs/workbench/parts/tasks/common/tasks.ts +++ b/src/vs/workbench/parts/tasks/common/tasks.ts @@ -510,14 +510,14 @@ export abstract class CommonTask { } public matches(key: string | KeyedTaskIdentifier, compareId: boolean = false): boolean { - if (key === void 0) { + if (key === undefined) { return false; } if (Types.isString(key)) { return key === this._label || key === this.configurationProperties.identifier || (compareId && key === this._id); } let identifier = this.getDefinition(true); - return identifier !== void 0 && identifier._key === key._key; + return identifier !== undefined && identifier._key === key._key; } public getQualifiedLabel(): string { @@ -538,7 +538,7 @@ export abstract class CommonTask { } public addTaskLoadMessages(messages: string[] | undefined) { - if (this._taskLoadMessages === void 0) { + if (this._taskLoadMessages === undefined) { this._taskLoadMessages = []; } if (messages) { @@ -585,11 +585,11 @@ export class CustomTask extends CommonTask { } public getDefinition(useSource: boolean = false): KeyedTaskIdentifier { - if (useSource && this._source.customizes !== void 0) { + if (useSource && this._source.customizes !== undefined) { return this._source.customizes; } else { let type: string; - if (this.command !== void 0) { + if (this.command !== undefined) { type = this.command.runtime === RuntimeType.Shell ? 'shell' : 'process'; } else { type = '$composite'; @@ -812,9 +812,9 @@ export class TaskSorter { let bw = b.getWorkspaceFolder(); if (aw && bw) { let ai = this._order.get(aw.uri.toString()); - ai = ai === void 0 ? 0 : ai + 1; + ai = ai === undefined ? 0 : ai + 1; let bi = this._order.get(bw.uri.toString()); - bi = bi === void 0 ? 0 : bi + 1; + bi = bi === undefined ? 0 : bi + 1; if (ai === bi) { return a._label.localeCompare(b._label); } else { diff --git a/src/vs/workbench/parts/tasks/electron-browser/runAutomaticTasks.ts b/src/vs/workbench/parts/tasks/electron-browser/runAutomaticTasks.ts index bd6c3b7a113df..daf10109fa631 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/runAutomaticTasks.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/runAutomaticTasks.ts @@ -85,7 +85,7 @@ export class RunAutomaticTasks extends Disposable implements IWorkbenchContribut public static promptForPermission(taskService: ITaskService, storageService: IStorageService, notificationService: INotificationService, workspaceTaskResult: Map) { const isFolderAutomaticAllowed = storageService.getBoolean(ARE_AUTOMATIC_TASKS_ALLOWED_IN_WORKSPACE, StorageScope.WORKSPACE, undefined); - if (isFolderAutomaticAllowed !== void 0) { + if (isFolderAutomaticAllowed !== undefined) { return; } @@ -145,7 +145,7 @@ export class AllowAutomaticTaskRunning extends Action { public run(event?: any): Promise { this.storageService.store(ARE_AUTOMATIC_TASKS_ALLOWED_IN_WORKSPACE, true, StorageScope.WORKSPACE); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -163,6 +163,6 @@ export class DisallowAutomaticTaskRunning extends Action { public run(event?: any): Promise { this.storageService.store(ARE_AUTOMATIC_TASKS_ALLOWED_IN_WORKSPACE, false, StorageScope.WORKSPACE); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } diff --git a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts index 28201789f1709..936a7c08a0ddb 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts @@ -281,7 +281,7 @@ class BuildStatusBarItem extends Themable implements IStatusbarItem { if (!event.__task) { return false; } - return event.__task.configurationProperties.problemMatchers === void 0 || event.__task.configurationProperties.problemMatchers.length === 0; + return event.__task.configurationProperties.problemMatchers === undefined || event.__task.configurationProperties.problemMatchers.length === 0; } } @@ -625,21 +625,21 @@ class TaskService extends Disposable implements ITaskService { } private get executionEngine(): ExecutionEngine { - if (this._executionEngine === void 0) { + if (this._executionEngine === undefined) { this.updateSetup(); } return this._executionEngine; } private get schemaVersion(): JsonSchemaVersion { - if (this._schemaVersion === void 0) { + if (this._schemaVersion === undefined) { this.updateSetup(); } return this._schemaVersion; } private get showIgnoreMessage(): boolean { - if (this._showIgnoreMessage === void 0) { + if (this._showIgnoreMessage === undefined) { this._showIgnoreMessage = !this.storageService.getBoolean(TaskService.IgnoreTask010DonotShowAgain_key, StorageScope.WORKSPACE, false); } return this._showIgnoreMessage; @@ -717,7 +717,7 @@ class TaskService extends Disposable implements ITaskService { } else { key = identifier; } - if (key === void 0) { + if (key === undefined) { return Promise.resolve(undefined); } return this.getGroupedTasks().then((map) => { @@ -881,10 +881,10 @@ class TaskService extends Disposable implements ITaskService { if (!this.canCustomize(task)) { return false; } - if (task.configurationProperties.group !== void 0 && task.configurationProperties.group !== TaskGroup.Build) { + if (task.configurationProperties.group !== undefined && task.configurationProperties.group !== TaskGroup.Build) { return false; } - if (task.configurationProperties.problemMatchers !== void 0 && task.configurationProperties.problemMatchers.length > 0) { + if (task.configurationProperties.problemMatchers !== undefined && task.configurationProperties.problemMatchers.length > 0) { return false; } if (ContributedTask.is(task)) { @@ -892,7 +892,7 @@ class TaskService extends Disposable implements ITaskService { } if (CustomTask.is(task)) { let configProperties: TaskConfig.ConfigurationProperties = task._source.config.element; - return configProperties.problemMatcher === void 0 && !task.hasDefinedMatchers; + return configProperties.problemMatcher === undefined && !task.hasDefinedMatchers; } return false; } @@ -943,7 +943,7 @@ class TaskService extends Disposable implements ITaskService { let properties: CustomizationProperties = { problemMatcher: [matcherReference] }; newTask.configurationProperties.problemMatchers = [matcherReference]; let matcher = ProblemMatcherRegistry.get(selected.matcher.name); - if (matcher && matcher.watching !== void 0) { + if (matcher && matcher.watching !== undefined) { properties.isBackground = true; newTask.configurationProperties.isBackground = true; } @@ -1025,12 +1025,12 @@ class TaskService extends Disposable implements ITaskService { if (properties) { for (let property of Object.getOwnPropertyNames(properties)) { let value = properties[property]; - if (value !== void 0 && value !== null) { + if (value !== undefined && value !== null) { toCustomize[property] = value; } } } else { - if (toCustomize.problemMatcher === void 0 && task.configurationProperties.problemMatchers === void 0 || task.configurationProperties.problemMatchers.length === 0) { + if (toCustomize.problemMatcher === undefined && task.configurationProperties.problemMatchers === undefined || task.configurationProperties.problemMatchers.length === 0) { toCustomize.problemMatcher = []; } } @@ -1053,10 +1053,10 @@ class TaskService extends Disposable implements ITaskService { } else { // We have a global task configuration if (index === -1) { - if (properties.problemMatcher !== void 0) { + if (properties.problemMatcher !== undefined) { fileConfig.problemMatcher = properties.problemMatcher; promise = this.writeConfiguration(workspaceFolder, 'tasks.problemMatchers', fileConfig.problemMatcher); - } else if (properties.group !== void 0) { + } else if (properties.group !== undefined) { fileConfig.group = properties.group; promise = this.writeConfiguration(workspaceFolder, 'tasks.group', fileConfig.group); } @@ -1064,7 +1064,7 @@ class TaskService extends Disposable implements ITaskService { if (!Array.isArray(fileConfig.tasks)) { fileConfig.tasks = []; } - if (index === void 0) { + if (index === undefined) { fileConfig.tasks.push(toCustomize); } else { fileConfig.tasks[index] = toCustomize; @@ -1215,7 +1215,7 @@ class TaskService extends Disposable implements ITaskService { data.label.set(task._label, task); data.identifier.set(task.configurationProperties.identifier, task); let keyedIdentifier = task.getDefinition(true); - if (keyedIdentifier !== void 0) { + if (keyedIdentifier !== undefined) { data.taskIdentifier.set(keyedIdentifier._key, task); } } @@ -1230,7 +1230,7 @@ class TaskService extends Disposable implements ITaskService { return data.label.get(identifier) || data.identifier.get(identifier); } else { let key = TaskDefinition.createTaskIdentifier(identifier, console); - return key !== void 0 ? data.taskIdentifier.get(key._key) : undefined; + return key !== undefined ? data.taskIdentifier.get(key._key) : undefined; } } }; @@ -1776,7 +1776,7 @@ class TaskService extends Disposable implements ITaskService { success = success && response.success; // We only have a code in the old output runner which only has one task // So we can use the first code. - if (code === void 0 && response.code !== void 0) { + if (code === undefined && response.code !== undefined) { code = response.code; } } @@ -1843,7 +1843,7 @@ class TaskService extends Disposable implements ITaskService { } private createTaskQuickPickEntries(tasks: Task[], group: boolean = false, sort: boolean = false, selectedEntry?: TaskQuickPickEntry): TaskQuickPickEntry[] { - if (tasks === void 0 || tasks === null || tasks.length === 0) { + if (tasks === undefined || tasks === null || tasks.length === 0) { return []; } const TaskQuickPickEntry = (task: Task): TaskQuickPickEntry => { @@ -1974,7 +1974,7 @@ class TaskService extends Disposable implements ITaskService { return; } let identifier = this.getTaskIdentifier(arg); - if (identifier !== void 0) { + if (identifier !== undefined) { this.getGroupedTasks().then((grouped) => { let resolver = this.createResolver(grouped); let folders = this.contextService.getWorkspace().folders; @@ -2006,7 +2006,7 @@ class TaskService extends Disposable implements ITaskService { }, true). then((task) => { - if (task === void 0) { + if (task === undefined) { return; } if (task === null) { @@ -2086,7 +2086,7 @@ class TaskService extends Disposable implements ITaskService { task: null }, true).then((task) => { - if (task === void 0) { + if (task === undefined) { return; } if (task === null) { @@ -2134,7 +2134,7 @@ class TaskService extends Disposable implements ITaskService { task: null }, true ).then((task) => { - if (task === void 0) { + if (task === undefined) { return; } if (task === null) { @@ -2163,7 +2163,7 @@ class TaskService extends Disposable implements ITaskService { }, false, true ).then(task => { - if (task === void 0 || task === null) { + if (task === undefined || task === null) { return; } this.terminate(task); @@ -2172,7 +2172,7 @@ class TaskService extends Disposable implements ITaskService { if (this.inTerminal()) { let identifier = this.getTaskIdentifier(arg); let promise: Promise; - if (identifier !== void 0) { + if (identifier !== undefined) { promise = this.getActiveTasks(); promise.then((tasks) => { for (let task of tasks) { @@ -2219,7 +2219,7 @@ class TaskService extends Disposable implements ITaskService { }, false, true ).then(task => { - if (task === void 0 || task === null) { + if (task === undefined || task === null) { return; } this.restart(task); @@ -2228,7 +2228,7 @@ class TaskService extends Disposable implements ITaskService { if (this.inTerminal()) { let identifier = this.getTaskIdentifier(arg); let promise: Promise; - if (identifier !== void 0) { + if (identifier !== undefined) { promise = this.getActiveTasks(); promise.then((tasks) => { for (let task of tasks) { @@ -2356,7 +2356,7 @@ class TaskService extends Disposable implements ITaskService { } } if (needsCreateOrOpen) { - let label = stats[0] !== void 0 ? openLabel : createLabel; + let label = stats[0] !== undefined ? openLabel : createLabel; if (entries.length) { entries.push({ type: 'separator' }); } @@ -2377,7 +2377,7 @@ class TaskService extends Disposable implements ITaskService { entries.push(entry); } } else { - let label = stats[index] !== void 0 ? openLabel : createLabel; + let label = stats[index] !== undefined ? openLabel : createLabel; let entry: EntryType = { label, folder: folder }; entries.push({ type: 'separator', label: folder.name }); entries.push(entry); @@ -2431,7 +2431,7 @@ class TaskService extends Disposable implements ITaskService { this.showQuickPick(tasks, nls.localize('TaskService.pickDefaultBuildTask', 'Select the task to be used as the default build task'), undefined, true, false, selectedEntry). then((task) => { - if (task === void 0) { + if (task === undefined) { return; } if (task === selectedTask && CustomTask.is(task)) { @@ -2514,7 +2514,7 @@ class TaskService extends Disposable implements ITaskService { }, false, true ).then((task) => { - if (task === void 0 || task === null) { + if (task === undefined || task === null) { return; } this._taskSystem.revealTask(task); diff --git a/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts b/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts index 749cf499a9351..65fcf03953545 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts @@ -224,7 +224,7 @@ export class TerminalTaskSystem implements ITaskSystem { public rerun(): ITaskExecuteResult | undefined { if (this.lastTask && this.lastTask.verify()) { - if ((this.lastTask.task.runOptions.reevaluateOnRerun !== void 0) && !this.lastTask.task.runOptions.reevaluateOnRerun) { + if ((this.lastTask.task.runOptions.reevaluateOnRerun !== undefined) && !this.lastTask.task.runOptions.reevaluateOnRerun) { this.isRerun = true; } const result = this.run(this.lastTask.task, this.lastTask.resolver); @@ -916,7 +916,7 @@ export class TerminalTaskSystem implements ITaskSystem { let ch = value[i]; if (ch === quote) { quote = undefined; - } else if (quote !== void 0) { + } else if (quote !== undefined) { // skip the character. We are quoted. continue; } else if (ch === shellQuoteOptions.escape) { @@ -1016,7 +1016,7 @@ export class TerminalTaskSystem implements ITaskSystem { } private collectCommandVariables(variables: Set, command: CommandConfiguration, task: CustomTask | ContributedTask): void { - if (command.name === void 0) { + if (command.name === undefined) { throw new Error('Command name should never be undefined here.'); } this.collectVariables(variables, command.name); @@ -1054,7 +1054,7 @@ export class TerminalTaskSystem implements ITaskSystem { } private collectMatcherVariables(variables: Set, values: Array | undefined): void { - if (values === void 0 || values === null || values.length === 0) { + if (values === undefined || values === null || values.length === 0) { return; } values.forEach((value) => { @@ -1101,7 +1101,7 @@ export class TerminalTaskSystem implements ITaskSystem { } private resolveMatchers(resolver: VariableResolver, values: Array | undefined): ProblemMatcher[] { - if (values === void 0 || values === null || values.length === 0) { + if (values === undefined || values === null || values.length === 0) { return []; } let result: ProblemMatcher[] = []; @@ -1121,13 +1121,13 @@ export class TerminalTaskSystem implements ITaskSystem { return; } let taskSystemInfo: TaskSystemInfo | undefined = resolver.taskSystemInfo; - let hasFilePrefix = matcher.filePrefix !== void 0; - let hasUriProvider = taskSystemInfo !== void 0 && taskSystemInfo.uriProvider !== void 0; + let hasFilePrefix = matcher.filePrefix !== undefined; + let hasUriProvider = taskSystemInfo !== undefined && taskSystemInfo.uriProvider !== undefined; if (!hasFilePrefix && !hasUriProvider) { result.push(matcher); } else { let copy = Objects.deepClone(matcher); - if (hasUriProvider && (taskSystemInfo !== void 0)) { + if (hasUriProvider && (taskSystemInfo !== undefined)) { copy.uriProvider = taskSystemInfo.uriProvider; } if (hasFilePrefix) { @@ -1145,7 +1145,7 @@ export class TerminalTaskSystem implements ITaskSystem { // TODO@Dirk Task.getWorkspaceFolder should return a WorkspaceFolder that is defined in workspace.ts if (Types.isString(value)) { return resolver.resolve(value); - } else if (value !== void 0) { + } else if (value !== undefined) { return { value: resolver.resolve(value.value), quoting: value.quoting @@ -1156,7 +1156,7 @@ export class TerminalTaskSystem implements ITaskSystem { } private resolveOptions(resolver: VariableResolver, options: CommandOptions | undefined): CommandOptions { - if (options === void 0 || options === null) { + if (options === undefined || options === null) { return { cwd: this.resolveVariable(resolver, '${workspaceFolder}') }; } let result: CommandOptions = Types.isString(options.cwd) diff --git a/src/vs/workbench/parts/tasks/node/processTaskSystem.ts b/src/vs/workbench/parts/tasks/node/processTaskSystem.ts index 13b6482057dfb..1a5f7caec5c0e 100644 --- a/src/vs/workbench/parts/tasks/node/processTaskSystem.ts +++ b/src/vs/workbench/parts/tasks/node/processTaskSystem.ts @@ -420,7 +420,7 @@ export class ProcessTaskSystem implements ITaskSystem { } private resolveMatchers(task: CustomTask, values: Array): ProblemMatcher[] { - if (values === void 0 || values === null || values.length === 0) { + if (values === undefined || values === null || values.length === 0) { return []; } let result: ProblemMatcher[] = []; diff --git a/src/vs/workbench/parts/tasks/node/taskConfiguration.ts b/src/vs/workbench/parts/tasks/node/taskConfiguration.ts index 11ad32645d6b1..23a661b1c9f0d 100644 --- a/src/vs/workbench/parts/tasks/node/taskConfiguration.ts +++ b/src/vs/workbench/parts/tasks/node/taskConfiguration.ts @@ -133,7 +133,7 @@ export interface TaskIdentifier { export namespace TaskIdentifier { export function is(value: any): value is TaskIdentifier { let candidate: TaskIdentifier = value; - return candidate !== void 0 && Types.isString(value.type); + return candidate !== undefined && Types.isString(value.type); } } @@ -505,14 +505,14 @@ Object.freeze(EMPTY_ARRAY); function assignProperty(target: T, source: Partial, key: K) { const sourceAtKey = source[key]; - if (sourceAtKey !== void 0) { + if (sourceAtKey !== undefined) { target[key] = sourceAtKey!; } } function fillProperty(target: T, source: Partial, key: K) { const sourceAtKey = source[key]; - if (target[key] === void 0 && sourceAtKey !== void 0) { + if (target[key] === undefined && sourceAtKey !== undefined) { target[key] = sourceAtKey!; } } @@ -533,13 +533,13 @@ interface MetaData { function _isEmpty(this: void, value: T, properties: MetaData[] | undefined): boolean { - if (value === void 0 || value === null || properties === void 0) { + if (value === undefined || value === null || properties === undefined) { return true; } for (let meta of properties) { let property = value[meta.property]; - if (property !== void 0 && property !== null) { - if (meta.type !== void 0 && !meta.type.isEmpty(property)) { + if (property !== undefined && property !== null) { + if (meta.type !== undefined && !meta.type.isEmpty(property)) { return false; } else if (!Array.isArray(property) || property.length > 0) { return false; @@ -559,12 +559,12 @@ function _assignProperties(this: void, target: T, source: T, properties: Meta for (let meta of properties) { let property = meta.property; let value: any; - if (meta.type !== void 0) { + if (meta.type !== undefined) { value = meta.type.assignProperties(target[property], source[property]); } else { value = source[property]; } - if (value !== void 0 && value !== null) { + if (value !== undefined && value !== null) { target[property] = value; } } @@ -583,10 +583,10 @@ function _fillProperties(this: void, target: T, source: T, properties: MetaDa let value: any; if (meta.type) { value = meta.type.fillProperties(target[property], source[property]); - } else if (target[property] === void 0) { + } else if (target[property] === undefined) { value = source[property]; } - if (value !== void 0 && value !== null) { + if (value !== undefined && value !== null) { target[property] = value; } } @@ -597,8 +597,8 @@ function _fillDefaults(this: void, target: T, defaults: T, properties: MetaDa if (target && Object.isFrozen(target)) { return target; } - if (target === void 0 || target === null) { - if (defaults !== void 0 && defaults !== null) { + if (target === undefined || target === null) { + if (defaults !== undefined && defaults !== null) { return Objects.deepClone(defaults); } else { return undefined; @@ -606,7 +606,7 @@ function _fillDefaults(this: void, target: T, defaults: T, properties: MetaDa } for (let meta of properties) { let property = meta.property; - if (target[property] !== void 0) { + if (target[property] !== undefined) { continue; } let value: any; @@ -616,7 +616,7 @@ function _fillDefaults(this: void, target: T, defaults: T, properties: MetaDa value = defaults[property]; } - if (value !== void 0 && value !== null) { + if (value !== undefined && value !== null) { target[property] = value; } } @@ -624,7 +624,7 @@ function _fillDefaults(this: void, target: T, defaults: T, properties: MetaDa } function _freeze(this: void, target: T, properties: MetaData[]): Readonly | undefined { - if (target === void 0 || target === null) { + if (target === undefined || target === null) { return undefined; } if (Object.isFrozen(target)) { @@ -692,13 +692,13 @@ namespace ShellConfiguration { return undefined; } let result: ShellConfiguration = {}; - if (config.executable !== void 0) { + if (config.executable !== undefined) { result.executable = config.executable; } - if (config.args !== void 0) { + if (config.args !== undefined) { result.args = config.args.slice(); } - if (config.quoting !== void 0) { + if (config.quoting !== undefined) { result.quoting = Objects.deepClone(config.quoting); } @@ -736,14 +736,14 @@ namespace CommandOptions { export function from(this: void, options: CommandOptionsConfig, context: ParseContext): Tasks.CommandOptions | undefined { let result: Tasks.CommandOptions = {}; - if (options.cwd !== void 0) { + if (options.cwd !== undefined) { if (Types.isString(options.cwd)) { result.cwd = options.cwd; } else { context.taskLoadIssues.push(nls.localize('ConfigurationParser.invalidCWD', 'Warning: options.cwd must be of type string. Ignoring value {0}\n', options.cwd)); } } - if (options.env !== void 0) { + if (options.env !== undefined) { result.env = Objects.deepClone(options.env); } result.shell = ShellConfiguration.from(options.shell, context); @@ -755,21 +755,21 @@ namespace CommandOptions { } export function assignProperties(target: Tasks.CommandOptions | undefined, source: Tasks.CommandOptions | undefined): Tasks.CommandOptions | undefined { - if ((source === void 0) || isEmpty(source)) { + if ((source === undefined) || isEmpty(source)) { return target; } - if ((target === void 0) || isEmpty(target)) { + if ((target === undefined) || isEmpty(target)) { return source; } assignProperty(target, source, 'cwd'); - if (target.env === void 0) { + if (target.env === undefined) { target.env = source.env; - } else if (source.env !== void 0) { + } else if (source.env !== undefined) { let env: { [key: string]: string; } = Object.create(null); - if (target.env !== void 0) { + if (target.env !== undefined) { Object.keys(target.env).forEach(key => env[key] = target.env![key]); } - if (source.env !== void 0) { + if (source.env !== undefined) { Object.keys(source.env).forEach(key => env[key] = source.env![key]); } target.env = env; @@ -868,7 +868,7 @@ namespace CommandConfiguration { namespace ShellString { export function from(this: void, value: CommandString | undefined): Tasks.CommandString | undefined { - if (value === void 0 || value === null) { + if (value === undefined || value === null) { return undefined; } if (Types.isString(value)) { @@ -933,7 +933,7 @@ namespace CommandConfiguration { let isShellConfiguration = ShellConfiguration.is(config.isShellCommand); if (Types.isBoolean(config.isShellCommand) || isShellConfiguration) { runtime = Tasks.RuntimeType.Shell; - } else if (config.isShellCommand !== void 0) { + } else if (config.isShellCommand !== undefined) { runtime = !!config.isShellCommand ? Tasks.RuntimeType.Shell : Tasks.RuntimeType.Process; } @@ -943,11 +943,11 @@ namespace CommandConfiguration { presentation: PresentationOptions.from(config, context)! }; - if (config.args !== void 0) { + if (config.args !== undefined) { result.args = []; for (let arg of config.args) { let converted = ShellString.from(arg); - if (converted !== void 0) { + if (converted !== undefined) { result.args.push(converted); } else { context.taskLoadIssues.push( @@ -959,9 +959,9 @@ namespace CommandConfiguration { } } } - if (config.options !== void 0) { + if (config.options !== undefined) { result.options = CommandOptions.from(config.options, context); - if (result.options && result.options.shell === void 0 && isShellConfiguration) { + if (result.options && result.options.shell === undefined && isShellConfiguration) { result.options.shell = ShellConfiguration.from(config.isShellCommand as ShellConfiguration, context); if (context.engine !== Tasks.ExecutionEngine.Terminal) { context.taskLoadIssues.push(nls.localize('ConfigurationParser.noShell', 'Warning: shell configuration is only supported when executing tasks in the terminal.')); @@ -998,8 +998,8 @@ namespace CommandConfiguration { assignProperty(target, source, 'runtime'); assignProperty(target, source, 'taskSelector'); assignProperty(target, source, 'suppressTaskName'); - if (source.args !== void 0) { - if (target.args === void 0 || overwriteArgs) { + if (source.args !== undefined) { + if (target.args === undefined || overwriteArgs) { target.args = source.args; } else { target.args = target.args.concat(source.args); @@ -1023,13 +1023,13 @@ namespace CommandConfiguration { runtime: undefined, presentation: undefined }; - if (target.name === void 0) { + if (target.name === undefined) { fillProperty(target, source, 'name'); fillProperty(target, source, 'taskSelector'); fillProperty(target, source, 'suppressTaskName'); let args: Tasks.CommandString[] = source.args ? source.args.slice() : []; if (!target.suppressTaskName && taskName) { - if (target.taskSelector !== void 0) { + if (target.taskSelector !== undefined) { args.push(target.taskSelector + taskName); } else { args.push(taskName); @@ -1052,17 +1052,17 @@ namespace CommandConfiguration { if (!value || Object.isFrozen(value)) { return; } - if (value.name !== void 0 && value.runtime === void 0) { + if (value.name !== undefined && value.runtime === undefined) { value.runtime = Tasks.RuntimeType.Process; } value.presentation = PresentationOptions.fillDefaults(value.presentation!, context)!; if (!isEmpty(value)) { value.options = CommandOptions.fillDefaults(value.options, context); } - if (value.args === void 0) { + if (value.args === undefined) { value.args = EMPTY_ARRAY; } - if (value.suppressTaskName === void 0) { + if (value.suppressTaskName === undefined) { value.suppressTaskName = false; } } @@ -1093,7 +1093,7 @@ namespace ProblemMatcherConverter { export function from(this: void, config: ProblemMatcherConfig.ProblemMatcherType | undefined, context: ParseContext): ProblemMatcher[] { let result: ProblemMatcher[] = []; - if (config === void 0) { + if (config === undefined) { return result; } let kind = getProblemMatcherKind(config); @@ -1166,7 +1166,7 @@ const source: Partial = { namespace GroupKind { export function from(this: void, external: string | GroupKind | undefined): [string, Tasks.GroupType] | undefined { - if (external === void 0) { + if (external === undefined) { return undefined; } if (Types.isString(external)) { @@ -1221,13 +1221,13 @@ namespace ConfigurationProperties { if (Types.isString(external.identifier)) { result.identifier = external.identifier; } - if (external.isBackground !== void 0) { + if (external.isBackground !== undefined) { result.isBackground = !!external.isBackground; } - if (external.promptOnClose !== void 0) { + if (external.promptOnClose !== undefined) { result.promptOnClose = !!external.promptOnClose; } - if (external.group !== void 0) { + if (external.group !== undefined) { if (Types.isString(external.group) && Tasks.TaskGroup.is(external.group)) { result.group = external.group; result.groupType = Tasks.GroupType.user; @@ -1239,7 +1239,7 @@ namespace ConfigurationProperties { } } } - if (external.dependsOn !== void 0) { + if (external.dependsOn !== undefined) { if (Types.isArray(external.dependsOn)) { result.dependsOn = external.dependsOn.reduce((dependencies: Tasks.TaskDependency[], item): Tasks.TaskDependency[] => { const dependency = TaskDependency.from(item, context); @@ -1253,10 +1253,10 @@ namespace ConfigurationProperties { result.dependsOn = dependsOnValue ? [dependsOnValue] : undefined; } } - if (includeCommandOptions && (external.presentation !== void 0 || (external as LegacyCommandProperties).terminal !== void 0)) { + if (includeCommandOptions && (external.presentation !== undefined || (external as LegacyCommandProperties).terminal !== undefined)) { result.presentation = CommandConfiguration.PresentationOptions.from(external, context); } - if (includeCommandOptions && (external.options !== void 0)) { + if (includeCommandOptions && (external.options !== undefined)) { result.options = CommandOptions.from(external.options, context); } if (external.problemMatcher) { @@ -1316,7 +1316,7 @@ namespace ConfiguringTask { identifier = external as Tasks.TaskIdentifier; } } - if (identifier === void 0) { + if (identifier === undefined) { context.problemReporter.error(nls.localize( 'ConfigurationParser.missingType', 'Error: the task configuration \'{0}\' is missing the required property \'type\'. The task configuration will be ignored.', JSON.stringify(external, undefined, 0) @@ -1324,7 +1324,7 @@ namespace ConfiguringTask { return undefined; } let taskIdentifier: Tasks.KeyedTaskIdentifier | undefined = TaskDefinition.createTaskIdentifier(identifier, context.problemReporter); - if (taskIdentifier === void 0) { + if (taskIdentifier === undefined) { context.problemReporter.error(nls.localize( 'ConfigurationParser.incorrectType', 'Error: the task configuration \'{0}\' is using an unknown type. The task configuration will be ignored.', JSON.stringify(external, undefined, 0) @@ -1379,7 +1379,7 @@ namespace CustomTask { return undefined; } let type = external.type; - if (type === void 0 || type === null) { + if (type === undefined || type === null) { type = Tasks.CUSTOMIZED_TASK_TYPE; } if (type !== Tasks.CUSTOMIZED_TASK_TYPE && type !== 'shell' && type !== 'process') { @@ -1415,10 +1415,10 @@ namespace CustomTask { let supportLegacy: boolean = true; //context.schemaVersion === Tasks.JsonSchemaVersion.V2_0_0; if (supportLegacy) { let legacy: LegacyTaskProperties = external as LegacyTaskProperties; - if (result.configurationProperties.isBackground === void 0 && legacy.isWatching !== void 0) { + if (result.configurationProperties.isBackground === undefined && legacy.isWatching !== undefined) { result.configurationProperties.isBackground = !!legacy.isWatching; } - if (result.configurationProperties.group === void 0) { + if (result.configurationProperties.group === undefined) { if (legacy.isBuildCommand === true) { result.configurationProperties.group = Tasks.TaskGroup.Build; } else if (legacy.isTestCommand === true) { @@ -1430,7 +1430,7 @@ namespace CustomTask { if (command) { result.command = command; } - if (external.command !== void 0) { + if (external.command !== undefined) { // if the task has its own command then we suppress the // task name by default. command.suppressTaskName = true; @@ -1441,31 +1441,31 @@ namespace CustomTask { export function fillGlobals(task: Tasks.CustomTask, globals: Globals): void { // We only merge a command from a global definition if there is no dependsOn // or there is a dependsOn and a defined command. - if (CommandConfiguration.hasCommand(task.command) || task.configurationProperties.dependsOn === void 0) { + if (CommandConfiguration.hasCommand(task.command) || task.configurationProperties.dependsOn === undefined) { task.command = CommandConfiguration.fillGlobals(task.command, globals.command, task.configurationProperties.name); } - if (task.configurationProperties.problemMatchers === void 0 && globals.problemMatcher !== void 0) { + if (task.configurationProperties.problemMatchers === undefined && globals.problemMatcher !== undefined) { task.configurationProperties.problemMatchers = Objects.deepClone(globals.problemMatcher); task.hasDefinedMatchers = true; } // promptOnClose is inferred from isBackground if available - if (task.configurationProperties.promptOnClose === void 0 && task.configurationProperties.isBackground === void 0 && globals.promptOnClose !== void 0) { + if (task.configurationProperties.promptOnClose === undefined && task.configurationProperties.isBackground === undefined && globals.promptOnClose !== undefined) { task.configurationProperties.promptOnClose = globals.promptOnClose; } } export function fillDefaults(task: Tasks.CustomTask, context: ParseContext): void { CommandConfiguration.fillDefaults(task.command, context); - if (task.configurationProperties.promptOnClose === void 0) { - task.configurationProperties.promptOnClose = task.configurationProperties.isBackground !== void 0 ? !task.configurationProperties.isBackground : true; + if (task.configurationProperties.promptOnClose === undefined) { + task.configurationProperties.promptOnClose = task.configurationProperties.isBackground !== undefined ? !task.configurationProperties.isBackground : true; } - if (task.configurationProperties.isBackground === void 0) { + if (task.configurationProperties.isBackground === undefined) { task.configurationProperties.isBackground = false; } - if (task.configurationProperties.problemMatchers === void 0) { + if (task.configurationProperties.problemMatchers === undefined) { task.configurationProperties.problemMatchers = EMPTY_ARRAY; } - if (task.configurationProperties.group !== void 0 && task.configurationProperties.groupType === void 0) { + if (task.configurationProperties.group !== undefined && task.configurationProperties.groupType === undefined) { task.configurationProperties.groupType = Tasks.GroupType.user; } } @@ -1526,7 +1526,7 @@ namespace TaskParser { function isCustomTask(value: CustomTask | ConfiguringTask): value is CustomTask { let type = value.type; let customize = (value as any).customize; - return customize === void 0 && (type === void 0 || type === null || type === Tasks.CUSTOMIZED_TASK_TYPE || type === 'shell' || type === 'process'); + return customize === undefined && (type === undefined || type === null || type === Tasks.CUSTOMIZED_TASK_TYPE || type === 'shell' || type === 'process'); } export function from(this: void, externals: Array | undefined, globals: Globals, context: ParseContext): TaskParseResult { @@ -1546,7 +1546,7 @@ namespace TaskParser { CustomTask.fillGlobals(customTask, globals); CustomTask.fillDefaults(customTask, context); if (schema2_0_0) { - if ((customTask.command === void 0 || customTask.command.name === void 0) && (customTask.configurationProperties.dependsOn === void 0 || customTask.configurationProperties.dependsOn.length === 0)) { + if ((customTask.command === undefined || customTask.command.name === undefined) && (customTask.configurationProperties.dependsOn === undefined || customTask.configurationProperties.dependsOn.length === 0)) { context.problemReporter.error(nls.localize( 'taskConfiguration.noCommandOrDependsOn', 'Error: the task \'{0}\' neither specifies a command nor a dependsOn property. The task will be ignored. Its definition is:\n{1}', customTask.configurationProperties.name, JSON.stringify(external, undefined, 4) @@ -1554,7 +1554,7 @@ namespace TaskParser { continue; } } else { - if (customTask.command === void 0 || customTask.command.name === void 0) { + if (customTask.command === undefined || customTask.command.name === undefined) { context.problemReporter.warn(nls.localize( 'taskConfiguration.noCommand', 'Error: the task \'{0}\' doesn\'t define a command. The task will be ignored. Its definition is:\n{1}', customTask.configurationProperties.name, JSON.stringify(external, undefined, 4) @@ -1599,10 +1599,10 @@ namespace TaskParser { } export function assignTasks(target: Tasks.CustomTask[], source: Tasks.CustomTask[]): Tasks.CustomTask[] { - if (source === void 0 || source.length === 0) { + if (source === undefined || source.length === 0) { return target; } - if (target === void 0 || target.length === 0) { + if (target === undefined || target.length === 0) { return source; } @@ -1661,10 +1661,10 @@ namespace Globals { export function fromBase(this: void, config: BaseTaskRunnerConfiguration, context: ParseContext): Globals { let result: Globals = {}; - if (config.suppressTaskName !== void 0) { + if (config.suppressTaskName !== undefined) { result.suppressTaskName = !!config.suppressTaskName; } - if (config.promptOnClose !== void 0) { + if (config.promptOnClose !== undefined) { result.promptOnClose = !!config.promptOnClose; } if (config.problemMatcher) { @@ -1674,7 +1674,7 @@ namespace Globals { } export function isEmpty(value: Globals): boolean { - return !value || value.command === void 0 && value.promptOnClose === void 0 && value.suppressTaskName === void 0; + return !value || value.command === undefined && value.promptOnClose === undefined && value.suppressTaskName === undefined; } export function assignProperties(target: Globals, source: Globals): Globals { @@ -1694,10 +1694,10 @@ namespace Globals { return; } CommandConfiguration.fillDefaults(value.command, context); - if (value.suppressTaskName === void 0) { + if (value.suppressTaskName === undefined) { value.suppressTaskName = false; } - if (value.promptOnClose === void 0) { + if (value.promptOnClose === undefined) { value.promptOnClose = true; } } @@ -1793,7 +1793,7 @@ class UUIDMap { public getUUID(identifier: string): string { let lastValue = this.last ? this.last[identifier] : undefined; let result: string | undefined = undefined; - if (lastValue !== void 0) { + if (lastValue !== undefined) { if (Array.isArray(lastValue)) { result = lastValue.shift(); if (lastValue.length === 0) { @@ -1804,11 +1804,11 @@ class UUIDMap { delete this.last![identifier]; } } - if (result === void 0) { + if (result === undefined) { result = UUID.generateUuid(); } let currentValue = this.current[identifier]; - if (currentValue === void 0) { + if (currentValue === undefined) { this.current[identifier] = result; } else { if (Array.isArray(currentValue)) { diff --git a/src/vs/workbench/parts/tasks/node/tasks.ts b/src/vs/workbench/parts/tasks/node/tasks.ts index 1f4ccb036c0d9..4a794eed8d833 100644 --- a/src/vs/workbench/parts/tasks/node/tasks.ts +++ b/src/vs/workbench/parts/tasks/node/tasks.ts @@ -25,7 +25,7 @@ namespace KeyedTaskIdentifier { namespace TaskDefinition { export function createTaskIdentifier(external: TaskIdentifier, reporter: { error(message: string): void; }): KeyedTaskIdentifier | undefined { let definition = TaskDefinitionRegistry.get(external.type); - if (definition === void 0) { + if (definition === undefined) { // We have no task definition so we can't sanitize the literal. Take it as is let copy = Objects.deepClone(external); delete copy._key; @@ -40,11 +40,11 @@ namespace TaskDefinition { let properties = definition.properties; for (let property of Object.keys(properties)) { let value = external[property]; - if (value !== void 0 && value !== null) { + if (value !== undefined && value !== null) { literal[property] = value; } else if (required.has(property)) { let schema = properties[property]; - if (schema.default !== void 0) { + if (schema.default !== undefined) { literal[property] = Objects.deepClone(schema.default); } else { switch (schema.type) { diff --git a/src/vs/workbench/parts/terminal/common/terminalCommands.ts b/src/vs/workbench/parts/terminal/common/terminalCommands.ts index 5ddb88fa3cb6d..c9d27764e85ce 100644 --- a/src/vs/workbench/parts/terminal/common/terminalCommands.ts +++ b/src/vs/workbench/parts/terminal/common/terminalCommands.ts @@ -81,7 +81,7 @@ function registerOpenTerminalAtIndexCommands(): void { KeybindingsRegistry.registerCommandAndKeybindingRule({ id: `workbench.action.terminal.focusAtIndex${visibleIndex}`, weight: KeybindingWeight.WorkbenchContrib, - when: void 0, + when: undefined, primary: 0, handler: accessor => { const terminalService = accessor.get(ITerminalService); diff --git a/src/vs/workbench/parts/terminal/common/terminalService.ts b/src/vs/workbench/parts/terminal/common/terminalService.ts index 88a5fc320abd0..ef3daa0244b96 100644 --- a/src/vs/workbench/parts/terminal/common/terminalService.ts +++ b/src/vs/workbench/parts/terminal/common/terminalService.ts @@ -310,13 +310,13 @@ export abstract class TerminalService implements ITerminalService { setTimeout(() => { const instance = this.getActiveInstance(); if (instance) { - instance.focusWhenReady(true).then(() => complete(void 0)); + instance.focusWhenReady(true).then(() => complete(undefined)); } else { - complete(void 0); + complete(undefined); } }, 0); } else { - complete(void 0); + complete(undefined); } } else { if (focus) { @@ -325,13 +325,13 @@ export abstract class TerminalService implements ITerminalService { setTimeout(() => { const instance = this.getActiveInstance(); if (instance) { - instance.focusWhenReady(true).then(() => complete(void 0)); + instance.focusWhenReady(true).then(() => complete(undefined)); } else { - complete(void 0); + complete(undefined); } }, 0); } else { - complete(void 0); + complete(undefined); } } return undefined; diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts index 58d05bb0c5fc9..bb1e786e7fbf9 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts @@ -114,7 +114,7 @@ export class KillTerminalAction extends Action { this.terminalService.showPanel(true); } } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -162,7 +162,7 @@ export class CopyTerminalSelectionAction extends Action { if (terminalInstance) { terminalInstance.copySelection(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -183,7 +183,7 @@ export class SelectAllTerminalAction extends Action { if (terminalInstance) { terminalInstance.selectAll(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -202,7 +202,7 @@ export abstract class BaseSendTextTerminalAction extends Action { if (terminalInstance) { terminalInstance.sendText(this._text, false); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -336,7 +336,7 @@ export class CreateNewTerminalAction extends Action { return instancePromise.then(instance => { if (!instance) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } this.terminalService.setActiveInstance(instance); return this.terminalService.showPanel(true); @@ -359,7 +359,7 @@ export class CreateNewInActiveWorkspaceTerminalAction extends Action { public run(event?: any): Promise { const instance = this.terminalService.createTerminal(undefined, true); if (!instance) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } this.terminalService.setActiveInstance(instance); return this.terminalService.showPanel(true); @@ -383,7 +383,7 @@ export class SplitTerminalAction extends Action { public run(event?: any): Promise { const instance = this._terminalService.getActiveInstance(); if (!instance) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } return getCwdForSplit(this._terminalService.configHelper, instance, this.workspaceContextService.getWorkspace().folders, this.commandService).then(cwd => { @@ -411,7 +411,7 @@ export class SplitInActiveWorkspaceTerminalAction extends Action { public run(event?: any): Promise { const instance = this._terminalService.getActiveInstance(); if (!instance) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } return getCwdForSplit(this._terminalService.configHelper, instance).then(cwd => { this._terminalService.splitInstance(instance, { cwd }); @@ -434,7 +434,7 @@ export class FocusPreviousPaneTerminalAction extends Action { public run(event?: any): Promise { const tab = this._terminalService.getActiveTab(); if (!tab) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } tab.focusPreviousPane(); return this._terminalService.showPanel(true); @@ -455,7 +455,7 @@ export class FocusNextPaneTerminalAction extends Action { public run(event?: any): Promise { const tab = this._terminalService.getActiveTab(); if (!tab) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } tab.focusNextPane(); return this._terminalService.showPanel(true); @@ -476,7 +476,7 @@ export abstract class BaseFocusDirectionTerminalAction extends Action { if (tab) { tab.resizePane(this._direction); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -543,7 +543,7 @@ export class FocusActiveTerminalAction extends Action { public run(event?: any): Promise { const instance = this.terminalService.getActiveOrCreateInstance(true); if (!instance) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } this.terminalService.setActiveInstance(instance); return this.terminalService.showPanel(true); @@ -604,7 +604,7 @@ export class TerminalPasteAction extends Action { if (instance) { instance.paste(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -641,11 +641,11 @@ export class RunSelectedTextInTerminalAction extends Action { public run(event?: any): Promise { const instance = this.terminalService.getActiveOrCreateInstance(); if (!instance) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } let editor = this.codeEditorService.getFocusedCodeEditor(); if (!editor) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } let selection = editor.getSelection(); let text: string; @@ -677,16 +677,16 @@ export class RunActiveFileInTerminalAction extends Action { public run(event?: any): Promise { const instance = this.terminalService.getActiveOrCreateInstance(); if (!instance) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } const editor = this.codeEditorService.getActiveCodeEditor(); if (!editor) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } const uri = editor.getModel().uri; if (uri.scheme !== 'file') { this.notificationService.warn(nls.localize('workbench.action.terminal.runActiveFile.noFile', 'Only files on disk can be run in the terminal')); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } return instance.preparePathForTerminalAsync(uri.fsPath).then(path => { @@ -756,7 +756,7 @@ export class ScrollDownTerminalAction extends Action { if (terminalInstance) { terminalInstance.scrollDownLine(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -777,7 +777,7 @@ export class ScrollDownPageTerminalAction extends Action { if (terminalInstance) { terminalInstance.scrollDownPage(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -798,7 +798,7 @@ export class ScrollToBottomTerminalAction extends Action { if (terminalInstance) { terminalInstance.scrollToBottom(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -819,7 +819,7 @@ export class ScrollUpTerminalAction extends Action { if (terminalInstance) { terminalInstance.scrollUpLine(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -840,7 +840,7 @@ export class ScrollUpPageTerminalAction extends Action { if (terminalInstance) { terminalInstance.scrollUpPage(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -861,7 +861,7 @@ export class ScrollToTopTerminalAction extends Action { if (terminalInstance) { terminalInstance.scrollToTop(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -882,7 +882,7 @@ export class ClearTerminalAction extends Action { if (terminalInstance) { terminalInstance.clear(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -903,7 +903,7 @@ export class ClearSelectionTerminalAction extends Action { if (terminalInstance && terminalInstance.hasSelection()) { terminalInstance.clearSelection(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -921,7 +921,7 @@ export class AllowWorkspaceShellTerminalCommand extends Action { public run(event?: any): Promise { this.terminalService.setWorkspaceShellAllowed(true); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -939,7 +939,7 @@ export class DisallowWorkspaceShellTerminalCommand extends Action { public run(event?: any): Promise { this.terminalService.setWorkspaceShellAllowed(false); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -960,7 +960,7 @@ export class RenameTerminalAction extends Action { public run(entry?: TerminalEntry): Promise { const terminalInstance = entry ? entry.instance : this.terminalService.getActiveInstance(); if (!terminalInstance) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } return this.quickInputService.input({ value: terminalInstance.title, @@ -1086,7 +1086,7 @@ export class ScrollToPreviousCommandAction extends Action { instance.commandTracker.scrollToPreviousCommand(); instance.focus(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -1107,7 +1107,7 @@ export class ScrollToNextCommandAction extends Action { instance.commandTracker.scrollToNextCommand(); instance.focus(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -1128,7 +1128,7 @@ export class SelectToPreviousCommandAction extends Action { instance.commandTracker.selectToPreviousCommand(); instance.focus(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -1149,7 +1149,7 @@ export class SelectToNextCommandAction extends Action { instance.commandTracker.selectToNextCommand(); instance.focus(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -1170,7 +1170,7 @@ export class SelectToPreviousLineAction extends Action { instance.commandTracker.selectToPreviousLine(); instance.focus(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -1191,7 +1191,7 @@ export class SelectToNextLineAction extends Action { instance.commandTracker.selectToNextLine(); instance.focus(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -1212,7 +1212,7 @@ export class ToggleEscapeSequenceLoggingAction extends Action { if (instance) { instance.toggleEscapeSequenceLogging(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -1229,7 +1229,7 @@ abstract class ToggleFindOptionCommand extends Action { public run(): Promise { const state = this.terminalService.getFindState(); this.runInner(state); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -1277,7 +1277,7 @@ export class FindNext extends Action { public run(): Promise { this.terminalService.findNext(); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -1295,6 +1295,6 @@ export class FindPrevious extends Action { public run(): Promise { this.terminalService.findPrevious(); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts index 33dfaefb86d03..774f2fd3ad0be 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts @@ -87,7 +87,7 @@ export class TerminalInstance implements ITerminalInstance { public get processId(): number | undefined { return this._processManager ? this._processManager.shellProcessId : undefined; } // TODO: How does this work with detached processes? // TODO: Should this be an event as it can fire twice? - public get processReady(): Promise { return this._processManager ? this._processManager.ptyProcessReady : Promise.resolve(void 0); } + public get processReady(): Promise { return this._processManager ? this._processManager.ptyProcessReady : Promise.resolve(undefined); } public get title(): string { return this._title; } public get hadFocusOnExit(): boolean { return this._hadFocusOnExit; } public get isTitleSetByProcess(): boolean { return !!this._messageTitleDisposable; } diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts index 45b1296c579f9..3662cf597cc72 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts @@ -63,7 +63,7 @@ export class TerminalProcessManager implements ITerminalProcessManager { this.ptyProcessReady = new Promise(c => { this.onProcessReady(() => { this._logService.debug(`Terminal process ready (shellProcessId: ${this.shellProcessId})`); - c(void 0); + c(undefined); }); }); } diff --git a/src/vs/workbench/parts/terminal/node/terminalProcess.ts b/src/vs/workbench/parts/terminal/node/terminalProcess.ts index e3348f4922b64..7527d1196acd9 100644 --- a/src/vs/workbench/parts/terminal/node/terminalProcess.ts +++ b/src/vs/workbench/parts/terminal/node/terminalProcess.ts @@ -67,7 +67,7 @@ export class TerminalProcess implements ITerminalChildProcess, IDisposable { // The only time this is expected to happen is when the file specified to launch with does not exist. this._exitCode = 2; this._queueProcessExit(); - this._processStartupComplete = Promise.resolve(void 0); + this._processStartupComplete = Promise.resolve(undefined); return; } this._ptyProcess.on('data', (data) => { diff --git a/src/vs/workbench/parts/themes/electron-browser/themes.contribution.ts b/src/vs/workbench/parts/themes/electron-browser/themes.contribution.ts index 0f91c4e17d62e..ccee4f70f9a21 100644 --- a/src/vs/workbench/parts/themes/electron-browser/themes.contribution.ts +++ b/src/vs/workbench/parts/themes/electron-browser/themes.contribution.ts @@ -66,7 +66,7 @@ export class SelectColorThemeAction extends Action { target = typeof confValue.workspace !== 'undefined' ? ConfigurationTarget.WORKSPACE : ConfigurationTarget.USER; } - this.themeService.setColorTheme(theme.id, target).then(void 0, + this.themeService.setColorTheme(theme.id, target).then(undefined, err => { onUnexpectedError(err); this.themeService.setColorTheme(currentTheme.id, null); @@ -126,7 +126,7 @@ class SelectIconThemeAction extends Action { let confValue = this.configurationService.inspect(ICON_THEME_SETTING); target = typeof confValue.workspace !== 'undefined' ? ConfigurationTarget.WORKSPACE : ConfigurationTarget.USER; } - this.themeService.setFileIconTheme(theme && theme.id, target).then(void 0, + this.themeService.setFileIconTheme(theme && theme.id, target).then(undefined, err => { onUnexpectedError(err); this.themeService.setFileIconTheme(currentTheme.id, null); @@ -153,7 +153,7 @@ function configurationEntries(extensionGalleryService: IExtensionGalleryService, type: 'separator' }, { - id: void 0, + id: undefined, label: label, alwaysShow: true, } diff --git a/src/vs/workbench/parts/themes/test/electron-browser/themes.test.contribution.ts b/src/vs/workbench/parts/themes/test/electron-browser/themes.test.contribution.ts index 19aaed047082c..85bb9a316cd39 100644 --- a/src/vs/workbench/parts/themes/test/electron-browser/themes.test.contribution.ts +++ b/src/vs/workbench/parts/themes/test/electron-browser/themes.test.contribution.ts @@ -168,7 +168,7 @@ class Snapper { if (startIdx !== -1) { return id.substring(startIdx + part.length, id.length - 5); } - return void 0; + return undefined; }; let result: IThemesResult = {}; diff --git a/src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts b/src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts index 81e3ab1ff7730..94afb719e647c 100644 --- a/src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts +++ b/src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts @@ -172,7 +172,7 @@ export class ReleaseNotesManager { private onDidClickLink(uri: URI) { addGAParameters(this._telemetryService, this._environmentService, uri, 'ReleaseNotes') .then(updated => this._openerService.open(updated)) - .then(void 0, onUnexpectedError); + .then(undefined, onUnexpectedError); } private async renderBody(text: string) { diff --git a/src/vs/workbench/parts/update/electron-browser/update.ts b/src/vs/workbench/parts/update/electron-browser/update.ts index afd15901fb13c..943ea9623249e 100644 --- a/src/vs/workbench/parts/update/electron-browser/update.ts +++ b/src/vs/workbench/parts/update/electron-browser/update.ts @@ -74,7 +74,7 @@ export abstract class AbstractShowReleaseNotesAction extends Action { this.enabled = false; return showReleaseNotes(this.instantiationService, this.version) - .then(void 0, () => { + .then(undefined, () => { const action = this.instantiationService.createInstance(OpenLatestReleaseNotesInBrowserAction); return action.run().then(() => false); }); diff --git a/src/vs/workbench/parts/webview/electron-browser/webviewEditorService.ts b/src/vs/workbench/parts/webview/electron-browser/webviewEditorService.ts index 624aa9affcc68..bf099faef94f6 100644 --- a/src/vs/workbench/parts/webview/electron-browser/webviewEditorService.ts +++ b/src/vs/workbench/parts/webview/electron-browser/webviewEditorService.ts @@ -140,7 +140,7 @@ export class WebviewEditorService implements IWebviewEditorService { reviveWebview: (webview: WebviewEditorInput): Promise => { return this.tryRevive(webview).then(didRevive => { if (didRevive) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } // A reviver may not be registered yet. Put into queue and resolve promise when we can revive @@ -171,7 +171,7 @@ export class WebviewEditorService implements IWebviewEditorService { this._awaitingRevival = this._awaitingRevival.filter(x => x.input.viewType !== viewType); for (const input of toRevive) { - reviver.reviveWebview(input.input).then(() => input.resolve(void 0)); + reviver.reviveWebview(input.input).then(() => input.resolve(undefined)); } return toDisposable(() => { diff --git a/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/telemetryOptOut.ts b/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/telemetryOptOut.ts index d67e30d2d251d..ac4bafa078b79 100644 --- a/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/telemetryOptOut.ts +++ b/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/telemetryOptOut.ts @@ -70,7 +70,7 @@ export class TelemetryOptOut implements IWorkbenchContribution { { sticky: true } ); }) - .then(void 0, onUnexpectedError); + .then(undefined, onUnexpectedError); } private runExperiment(experimentId: string) { diff --git a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts b/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts index ff5baff90e5a9..9727a14e8984a 100644 --- a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts +++ b/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts @@ -100,7 +100,7 @@ export class WelcomePageContribution implements IWorkbenchContribution { } } return undefined; - }).then(void 0, onUnexpectedError); + }).then(undefined, onUnexpectedError); } } } @@ -376,7 +376,7 @@ class WelcomePage { ul.insertBefore(li, before); }); - }).then(void 0, onUnexpectedError); + }).then(undefined, onUnexpectedError); this.addExtensionList(container, '.extensionPackList', extensionPacks, extensionPackStrings); this.addExtensionList(container, '.keymapList', keymapExtensions, keymapStrings); @@ -523,7 +523,7 @@ class WelcomePage { return undefined; } }); - }).then(void 0, err => { + }).then(undefined, err => { /* __GDPR__FRAGMENT__ "WelcomePageInstalled-4" : { "from" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, @@ -556,11 +556,11 @@ class WelcomePage { }); this.extensionsWorkbenchService.queryGallery({ names: [extensionSuggestion.id] }) .then(result => this.extensionsWorkbenchService.open(result.firstPage[0])) - .then(void 0, onUnexpectedError); + .then(undefined, onUnexpectedError); } }] ); - }).then(void 0, err => { + }).then(undefined, err => { /* __GDPR__FRAGMENT__ "WelcomePageInstalled-6" : { "from" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, @@ -597,7 +597,7 @@ class WelcomePage { enabled[i].classList.add('installed'); } }); - }).then(void 0, onUnexpectedError); + }).then(undefined, onUnexpectedError); } dispose(): void { diff --git a/src/vs/workbench/services/actions/electron-browser/menusExtensionPoint.ts b/src/vs/workbench/services/actions/electron-browser/menusExtensionPoint.ts index 2b4c5afbd6083..d9cddda6cb03b 100644 --- a/src/vs/workbench/services/actions/electron-browser/menusExtensionPoint.ts +++ b/src/vs/workbench/services/actions/electron-browser/menusExtensionPoint.ts @@ -43,7 +43,7 @@ namespace schema { case 'view/item/context': return MenuId.ViewItemContext; } - return void 0; + return undefined; } export function isValidMenuItems(menu: IUserFriendlyMenuItem[], collector: ExtensionMessageCollector): boolean { diff --git a/src/vs/workbench/services/backup/node/backupFileService.ts b/src/vs/workbench/services/backup/node/backupFileService.ts index 2a19636ebc0a9..d9c46f9dc1a7c 100644 --- a/src/vs/workbench/services/backup/node/backupFileService.ts +++ b/src/vs/workbench/services/backup/node/backupFileService.ts @@ -153,7 +153,7 @@ export class BackupFileService implements IBackupFileService { return backupResource; } - return void 0; + return undefined; }); } @@ -165,7 +165,7 @@ export class BackupFileService implements IBackupFileService { return this.ready.then(model => { const backupResource = this.toBackupResource(resource); if (model.has(backupResource, versionId)) { - return void 0; // return early if backup version id matches requested one + return undefined; // return early if backup version id matches requested one } return this.ioOperationQueues.queueFor(backupResource).queue(() => { diff --git a/src/vs/workbench/services/configuration/node/configuration.ts b/src/vs/workbench/services/configuration/node/configuration.ts index 7660e399bde1f..db77e6eba2b9c 100644 --- a/src/vs/workbench/services/configuration/node/configuration.ts +++ b/src/vs/workbench/services/configuration/node/configuration.ts @@ -65,7 +65,7 @@ export class WorkspaceConfiguration extends Disposable { parseErrors = [...this._workspaceConfigurationModelParser.errors]; this.consolidate(); return this._workspaceConfigurationModelParser; - }, initCallback: () => c(void 0) + }, initCallback: () => c(undefined) }); this.listenToWatcher(); }); @@ -75,7 +75,7 @@ export class WorkspaceConfiguration extends Disposable { this.stopListeningToWatcher(); return new Promise(c => this._workspaceConfigurationWatcher.reload(() => { this.listenToWatcher(); - c(void 0); + c(undefined); })); } @@ -231,7 +231,7 @@ export class NodeBasedFolderConfiguration extends AbstractFolderConfiguration { return this.resolveContents(stat.children.filter(stat => isFolderConfigurationFile(stat.resource)) .map(stat => stat.resource)); }, err => [] /* never fail this call */) - .then(void 0, e => { + .then(undefined, e => { errors.onUnexpectedError(e); return []; }); @@ -291,11 +291,11 @@ export class FileServiceBasedFolderConfiguration extends AbstractFolderConfigura .forEach(child => { const folderRelativePath = this.toFolderRelativePath(child.resource); if (folderRelativePath) { - workspaceFilePathToConfiguration[folderRelativePath] = Promise.resolve(this.fileService.resolveContent(child.resource)).then(void 0, errors.onUnexpectedError); + workspaceFilePathToConfiguration[folderRelativePath] = Promise.resolve(this.fileService.resolveContent(child.resource)).then(undefined, errors.onUnexpectedError); } }); } - }).then(void 0, err => [] /* never fail this call */); + }).then(undefined, err => [] /* never fail this call */); return bulkContentFetchromise.then(() => Promise.all(collections.values(workspaceFilePathToConfiguration))); } @@ -395,7 +395,7 @@ export class CachedFolderConfiguration extends Disposable implements IFolderConf if (created) { return configurationModel.keys.length ? pfs.writeFile(this.cachedConfigurationPath, raw) : pfs.rimraf(this.cachedFolderPath); } - return void 0; + return undefined; }); } @@ -409,7 +409,7 @@ export class CachedFolderConfiguration extends Disposable implements IFolderConf private createCachedFolder(): Promise { return Promise.resolve(pfs.exists(this.cachedFolderPath)) - .then(void 0, () => false) + .then(undefined, () => false) .then(exists => exists ? exists : pfs.mkdirp(this.cachedFolderPath).then(() => true, () => false)); } } @@ -500,6 +500,6 @@ export class FolderConfiguration extends Disposable implements IFolderConfigurat return this.folderConfiguration.loadConfiguration() .then(configurationModel => this.cachedFolderConfiguration.updateConfiguration(configurationModel)); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } diff --git a/src/vs/workbench/services/configuration/node/configurationService.ts b/src/vs/workbench/services/configuration/node/configurationService.ts index 6a4e63bc7b0de..04965cbe28a15 100644 --- a/src/vs/workbench/services/configuration/node/configurationService.ts +++ b/src/vs/workbench/services/configuration/node/configurationService.ts @@ -137,11 +137,11 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat private doUpdateFolders(foldersToAdd: IWorkspaceFolderCreationData[], foldersToRemove: URI[], index?: number): Promise { if (this.getWorkbenchState() !== WorkbenchState.WORKSPACE) { - return Promise.resolve(void 0); // we need a workspace to begin with + return Promise.resolve(undefined); // we need a workspace to begin with } if (foldersToAdd.length + foldersToRemove.length === 0) { - return Promise.resolve(void 0); // nothing to do + return Promise.resolve(undefined); // nothing to do } let foldersHaveChanged = false; @@ -214,7 +214,7 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat return this.setFolders(newStoredFolders); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } private setFolders(folders: IStoredWorkspaceFolder[]): Promise { @@ -245,8 +245,8 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat getValue(overrides: IConfigurationOverrides): T; getValue(section: string, overrides: IConfigurationOverrides): T; getValue(arg1?: any, arg2?: any): any { - const section = typeof arg1 === 'string' ? arg1 : void 0; - const overrides = isConfigurationOverrides(arg1) ? arg1 : isConfigurationOverrides(arg2) ? arg2 : void 0; + const section = typeof arg1 === 'string' ? arg1 : undefined; + const overrides = isConfigurationOverrides(arg1) ? arg1 : isConfigurationOverrides(arg2) ? arg2 : undefined; return this._configuration.getValue(section, overrides); } @@ -257,7 +257,7 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat updateValue(key: string, value: any, overrides: IConfigurationOverrides, target: ConfigurationTarget, donotNotifyError: boolean): Promise; updateValue(key: string, value: any, arg3?: any, arg4?: any, donotNotifyError?: any): Promise { assert.ok(this.configurationEditingService, 'Workbench is not initialized yet'); - const overrides = isConfigurationOverrides(arg3) ? arg3 : void 0; + const overrides = isConfigurationOverrides(arg3) ? arg3 : undefined; const target = this.deriveConfigurationTarget(key, value, overrides, overrides ? arg4 : arg3); return target ? this.writeConfigurationValue(key, value, target, overrides, donotNotifyError) : Promise.resolve(null); @@ -369,7 +369,7 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat if (hasWorkspaceBefore) { previousState = this.getWorkbenchState(); - previousWorkspacePath = this.workspace.configuration ? this.workspace.configuration.fsPath : void 0; + previousWorkspacePath = this.workspace.configuration ? this.workspace.configuration.fsPath : undefined; previousFolders = this.workspace.folders; this.workspace.update(workspace); } else { @@ -387,7 +387,7 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat this._onDidChangeWorkbenchState.fire(newState); } - const newWorkspacePath = this.workspace.configuration ? this.workspace.configuration.fsPath : void 0; + const newWorkspacePath = this.workspace.configuration ? this.workspace.configuration.fsPath : undefined; if (previousWorkspacePath && newWorkspacePath !== previousWorkspacePath || newState !== previousState) { this._onDidChangeWorkspaceName.fire(); } @@ -436,7 +436,7 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat if (workbenchState === WorkbenchState.WORKSPACE) { return this.workspaceConfiguration.reload().then(() => this.onWorkspaceConfigurationChanged()); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } private reloadWorkspaceFolderConfiguration(folder: IWorkspaceFolder, key?: string): Promise { @@ -544,7 +544,7 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat this.triggerConfigurationChange(workspaceConfigurationChangeEvent, ConfigurationTarget.WORKSPACE); } } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } private onWorkspaceFolderConfigurationChanged(folder: IWorkspaceFolder, key?: string): Promise { @@ -606,7 +606,7 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat if (target === ConfigurationTarget.MEMORY) { this._configuration.updateValue(key, value, overrides); this.triggerConfigurationChange(new ConfigurationChangeEvent().change(overrides.overrideIdentifier ? [keyFromOverrideIdentifier(overrides.overrideIdentifier)] : [key], overrides.resource), target); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } return this.configurationEditingService.writeConfiguration(target, { key, value }, { scopes: overrides, donotNotifyError }) @@ -631,22 +631,22 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat return target; } - if (value === void 0) { + if (value === undefined) { // Ignore. But expected is to remove the value from all targets - return void 0; + return undefined; } const inspect = this.inspect(key, overrides); if (equals(value, inspect.value)) { // No change. So ignore. - return void 0; + return undefined; } - if (inspect.workspaceFolder !== void 0) { + if (inspect.workspaceFolder !== undefined) { return ConfigurationTarget.WORKSPACE_FOLDER; } - if (inspect.workspace !== void 0) { + if (inspect.workspace !== undefined) { return ConfigurationTarget.WORKSPACE; } diff --git a/src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts b/src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts index d29fd761b245e..857ba62339e22 100644 --- a/src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts +++ b/src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts @@ -129,9 +129,9 @@ suite('ConfigurationEditingService', () => { function clearWorkspace(): Promise { return new Promise((c, e) => { if (parentDir) { - extfs.del(parentDir, os.tmpdir(), () => c(void 0), () => c(void 0)); + extfs.del(parentDir, os.tmpdir(), () => c(undefined), () => c(undefined)); } else { - c(void 0); + c(undefined); } }).then(() => parentDir = null!); } diff --git a/src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts b/src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts index d3920ed67bdc3..ff7292b55e6e8 100644 --- a/src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts +++ b/src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts @@ -104,7 +104,7 @@ suite('WorkspaceContextService - Folder', () => { if (parentResource) { return pfs.del(parentResource, os.tmpdir()); } - return void 0; + return undefined; }); test('getWorkspace()', () => { @@ -177,7 +177,7 @@ suite('WorkspaceContextService - Workspace', () => { if (parentResource) { return pfs.del(parentResource, os.tmpdir()); } - return void 0; + return undefined; }); test('workspace folders', () => { @@ -436,7 +436,7 @@ suite('WorkspaceService - Initialization', () => { if (parentResource) { return pfs.del(parentResource, os.tmpdir()); } - return void 0; + return undefined; }); test('initialize a folder workspace from an empty workspace with no configuration changes', () => { @@ -691,7 +691,7 @@ suite('WorkspaceConfigurationService - Folder', () => { if (parentResource) { return pfs.del(parentResource, os.tmpdir()); } - return void 0; + return undefined; }); test('defaults', () => { @@ -798,17 +798,17 @@ suite('WorkspaceConfigurationService - Folder', () => { test('inspect', () => { let actual = testObject.inspect('something.missing'); - assert.equal(actual.default, void 0); - assert.equal(actual.user, void 0); - assert.equal(actual.workspace, void 0); - assert.equal(actual.workspaceFolder, void 0); - assert.equal(actual.value, void 0); + assert.equal(actual.default, undefined); + assert.equal(actual.user, undefined); + assert.equal(actual.workspace, undefined); + assert.equal(actual.workspaceFolder, undefined); + assert.equal(actual.value, undefined); actual = testObject.inspect('configurationService.folder.testSetting'); assert.equal(actual.default, 'isSet'); - assert.equal(actual.user, void 0); - assert.equal(actual.workspace, void 0); - assert.equal(actual.workspaceFolder, void 0); + assert.equal(actual.user, undefined); + assert.equal(actual.workspace, undefined); + assert.equal(actual.workspaceFolder, undefined); assert.equal(actual.value, 'isSet'); fs.writeFileSync(globalSettingsFile, '{ "configurationService.folder.testSetting": "userValue" }'); @@ -817,8 +817,8 @@ suite('WorkspaceConfigurationService - Folder', () => { actual = testObject.inspect('configurationService.folder.testSetting'); assert.equal(actual.default, 'isSet'); assert.equal(actual.user, 'userValue'); - assert.equal(actual.workspace, void 0); - assert.equal(actual.workspaceFolder, void 0); + assert.equal(actual.workspace, undefined); + assert.equal(actual.workspaceFolder, undefined); assert.equal(actual.value, 'userValue'); fs.writeFileSync(path.join(workspaceDir, '.vscode', 'settings.json'), '{ "configurationService.folder.testSetting": "workspaceValue" }'); @@ -829,7 +829,7 @@ suite('WorkspaceConfigurationService - Folder', () => { assert.equal(actual.default, 'isSet'); assert.equal(actual.user, 'userValue'); assert.equal(actual.workspace, 'workspaceValue'); - assert.equal(actual.workspaceFolder, void 0); + assert.equal(actual.workspaceFolder, undefined); assert.equal(actual.value, 'workspaceValue'); }); }); @@ -972,7 +972,7 @@ suite('WorkspaceConfigurationService-Multiroot', () => { if (parentResource) { return pfs.del(parentResource, os.tmpdir()); } - return void 0; + return undefined; }); test('application settings are not read from workspace', () => { @@ -1050,17 +1050,17 @@ suite('WorkspaceConfigurationService-Multiroot', () => { test('inspect', () => { let actual = testObject.inspect('something.missing'); - assert.equal(actual.default, void 0); - assert.equal(actual.user, void 0); - assert.equal(actual.workspace, void 0); - assert.equal(actual.workspaceFolder, void 0); - assert.equal(actual.value, void 0); + assert.equal(actual.default, undefined); + assert.equal(actual.user, undefined); + assert.equal(actual.workspace, undefined); + assert.equal(actual.workspaceFolder, undefined); + assert.equal(actual.value, undefined); actual = testObject.inspect('configurationService.workspace.testResourceSetting'); assert.equal(actual.default, 'isSet'); - assert.equal(actual.user, void 0); - assert.equal(actual.workspace, void 0); - assert.equal(actual.workspaceFolder, void 0); + assert.equal(actual.user, undefined); + assert.equal(actual.workspace, undefined); + assert.equal(actual.workspaceFolder, undefined); assert.equal(actual.value, 'isSet'); fs.writeFileSync(environmentService.appSettingsPath, '{ "configurationService.workspace.testResourceSetting": "userValue" }'); @@ -1069,8 +1069,8 @@ suite('WorkspaceConfigurationService-Multiroot', () => { actual = testObject.inspect('configurationService.workspace.testResourceSetting'); assert.equal(actual.default, 'isSet'); assert.equal(actual.user, 'userValue'); - assert.equal(actual.workspace, void 0); - assert.equal(actual.workspaceFolder, void 0); + assert.equal(actual.workspace, undefined); + assert.equal(actual.workspaceFolder, undefined); assert.equal(actual.value, 'userValue'); return jsonEditingServce.write(workspaceContextService.getWorkspace().configuration!, { key: 'settings', value: { 'configurationService.workspace.testResourceSetting': 'workspaceValue' } }, true) @@ -1080,7 +1080,7 @@ suite('WorkspaceConfigurationService-Multiroot', () => { assert.equal(actual.default, 'isSet'); assert.equal(actual.user, 'userValue'); assert.equal(actual.workspace, 'workspaceValue'); - assert.equal(actual.workspaceFolder, void 0); + assert.equal(actual.workspaceFolder, undefined); assert.equal(actual.value, 'workspaceValue'); fs.writeFileSync(workspaceContextService.getWorkspace().folders[0].toResource('.vscode/settings.json').fsPath, '{ "configurationService.workspace.testResourceSetting": "workspaceFolderValue" }'); @@ -1225,7 +1225,7 @@ suite('WorkspaceConfigurationService-Multiroot', () => { .then(() => testObject.reloadConfiguration()) .then(() => { const actual = testObject.inspect('tasks.version'); - assert.equal(actual.workspace, void 0); + assert.equal(actual.workspace, undefined); }); }); }); diff --git a/src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts b/src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts index 0b7ce4f582ec5..2d6bf3ad7f513 100644 --- a/src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts +++ b/src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts @@ -479,7 +479,7 @@ class MockConfigurationService implements IConfigurationService { public _serviceBrand: any; public serviceId = IConfigurationService; public constructor(private configuration: any = {}) { } - public inspect(key: string, overrides?: IConfigurationOverrides): any { return { value: getConfigurationValue(this.getValue(), key), default: getConfigurationValue(this.getValue(), key), user: getConfigurationValue(this.getValue(), key), workspaceFolder: void 0, folder: void 0 }; } + public inspect(key: string, overrides?: IConfigurationOverrides): any { return { value: getConfigurationValue(this.getValue(), key), default: getConfigurationValue(this.getValue(), key), user: getConfigurationValue(this.getValue(), key), workspaceFolder: undefined, folder: undefined }; } public keys() { return { default: [], user: [], workspace: [], workspaceFolder: [] }; } public getValue(): any; public getValue(value: string): any; diff --git a/src/vs/workbench/services/contextview/electron-browser/contextmenuService.ts b/src/vs/workbench/services/contextview/electron-browser/contextmenuService.ts index bba75cdfe883f..b2092c9c5ffd7 100644 --- a/src/vs/workbench/services/contextview/electron-browser/contextmenuService.ts +++ b/src/vs/workbench/services/contextview/electron-browser/contextmenuService.ts @@ -67,7 +67,7 @@ export class ContextMenuService extends Disposable implements IContextMenuServic popup(menu, { x: Math.floor(x), y: Math.floor(y), - positioningItem: delegate.autoSelectFirstItem ? 0 : void 0, + positioningItem: delegate.autoSelectFirstItem ? 0 : undefined, onHide: () => onHide() }); } @@ -99,7 +99,7 @@ export class ContextMenuService extends Disposable implements IContextMenuServic const item: IContextMenuItem = { label: unmnemonicLabel(entry.label), checked: !!entry.checked || !!entry.radio, - type: !!entry.checked ? 'checkbox' : !!entry.radio ? 'radio' : void 0, + type: !!entry.checked ? 'checkbox' : !!entry.radio ? 'radio' : undefined, enabled: !!entry.enabled, click: event => { diff --git a/src/vs/workbench/services/crashReporter/electron-browser/crashReporterService.ts b/src/vs/workbench/services/crashReporter/electron-browser/crashReporterService.ts index 0930fed9d45de..8ac304db7b90a 100644 --- a/src/vs/workbench/services/crashReporter/electron-browser/crashReporterService.ts +++ b/src/vs/workbench/services/crashReporter/electron-browser/crashReporterService.ts @@ -121,6 +121,6 @@ export class CrashReporterService implements ICrashReporterService { return childProcessOptions; } - return void 0; + return undefined; } } diff --git a/src/vs/workbench/services/dialogs/electron-browser/dialogService.ts b/src/vs/workbench/services/dialogs/electron-browser/dialogService.ts index 671852871abbb..8e0017285c212 100644 --- a/src/vs/workbench/services/dialogs/electron-browser/dialogService.ts +++ b/src/vs/workbench/services/dialogs/electron-browser/dialogService.ts @@ -100,8 +100,8 @@ export class DialogService implements IDialogService { message, buttons, type: (severity === Severity.Info) ? 'question' : (severity === Severity.Error) ? 'error' : (severity === Severity.Warning) ? 'warning' : 'none', - cancelId: dialogOptions ? dialogOptions.cancelId : void 0, - detail: dialogOptions ? dialogOptions.detail : void 0 + cancelId: dialogOptions ? dialogOptions.cancelId : undefined, + detail: dialogOptions ? dialogOptions.detail : undefined }); return this.windowService.showMessageBox(options).then(result => buttonIndexMap[result.button]); @@ -174,7 +174,7 @@ export class FileDialogService implements IFileDialogService { candidate = this.historyService.getLastActiveWorkspaceRoot(schemeFilter); } - return candidate && resources.dirname(candidate) || void 0; + return candidate && resources.dirname(candidate) || undefined; } public defaultFolderPath(schemeFilter: string): URI | undefined { @@ -188,7 +188,7 @@ export class FileDialogService implements IFileDialogService { candidate = this.historyService.getLastActiveFile(schemeFilter); } - return candidate && resources.dirname(candidate) || void 0; + return candidate && resources.dirname(candidate) || undefined; } public defaultWorkspacePath(schemeFilter: string): URI | undefined { @@ -197,7 +197,7 @@ export class FileDialogService implements IFileDialogService { if (schemeFilter === Schemas.file && this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE) { const configuration = this.contextService.getWorkspace().configuration; if (configuration && !isUntitledWorkspace(configuration.fsPath, this.environmentService)) { - return resources.dirname(configuration) || void 0; + return resources.dirname(configuration) || undefined; } } @@ -266,7 +266,7 @@ export class FileDialogService implements IFileDialogService { if (result) { return URI.file(result); } - return void 0; + return undefined; }); } @@ -293,7 +293,7 @@ export class FileDialogService implements IFileDialogService { if (options.canSelectMany) { newOptions.properties!.push('multiSelections'); } - return this.windowService.showOpenDialog(newOptions).then(result => result ? result.map(URI.file) : void 0); + return this.windowService.showOpenDialog(newOptions).then(result => result ? result.map(URI.file) : undefined); } } diff --git a/src/vs/workbench/services/editor/browser/editorService.ts b/src/vs/workbench/services/editor/browser/editorService.ts index 873050c1dc4d4..0771881fd5c9f 100644 --- a/src/vs/workbench/services/editor/browser/editorService.ts +++ b/src/vs/workbench/services/editor/browser/editorService.ts @@ -156,7 +156,7 @@ export class EditorService extends Disposable implements EditorServiceImpl { get activeControl(): IEditor { const activeGroup = this.editorGroupService.activeGroup; - return activeGroup ? activeGroup.activeControl : void 0; + return activeGroup ? activeGroup.activeControl : undefined; } get activeTextEditorWidget(): ICodeEditor | IDiffEditor { @@ -168,7 +168,7 @@ export class EditorService extends Disposable implements EditorServiceImpl { } } - return void 0; + return undefined; } get editors(): IEditorInput[] { @@ -183,7 +183,7 @@ export class EditorService extends Disposable implements EditorServiceImpl { get activeEditor(): IEditorInput { const activeGroup = this.editorGroupService.activeGroup; - return activeGroup ? activeGroup.activeEditor : void 0; + return activeGroup ? activeGroup.activeEditor : undefined; } get visibleControls(): IEditor[] { @@ -388,7 +388,7 @@ export class EditorService extends Disposable implements EditorServiceImpl { if (!(editor instanceof EditorInput)) { const resourceInput = editor as IResourceInput | IUntitledResourceInput; if (!resourceInput.resource) { - return void 0; // we need a resource at least + return undefined; // we need a resource at least } } @@ -429,7 +429,7 @@ export class EditorService extends Disposable implements EditorServiceImpl { } } - return void 0; + return undefined; } //#endregion diff --git a/src/vs/workbench/services/editor/test/browser/editorService.test.ts b/src/vs/workbench/services/editor/test/browser/editorService.test.ts index c391d7e4abf09..267af62dc3cd1 100644 --- a/src/vs/workbench/services/editor/test/browser/editorService.test.ts +++ b/src/vs/workbench/services/editor/test/browser/editorService.test.ts @@ -36,7 +36,7 @@ export class TestEditorControl extends BaseEditor { setInput(input: EditorInput, options: EditorOptions, token: CancellationToken): Promise { super.setInput(input, options, token); - return input.resolve().then(() => void 0); + return input.resolve().then(() => undefined); } getId(): string { return 'MyTestEditorForEditorService'; } diff --git a/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts b/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts index 8a749895af59b..8966e737e151e 100644 --- a/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts +++ b/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts @@ -280,7 +280,7 @@ export class CachedExtensionScanner { const user = extensionDescriptions[1]; const development = extensionDescriptions[2]; return { system, user, development }; - }).then(void 0, err => { + }).then(undefined, err => { log.error('', err); return { system: [], user: [], development: [] }; }); diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts b/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts index 53a6b9389e5ce..9df031a8252ac 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts @@ -422,8 +422,8 @@ export class ExtensionHostProcessWorker implements IExtensionHostStarter { parentPid: process.pid, environment: { isExtensionDevelopmentDebug: this._isExtensionDevDebug, - appRoot: this._environmentService.appRoot ? URI.file(this._environmentService.appRoot) : void 0, - appSettingsHome: this._environmentService.appSettingsHome ? URI.file(this._environmentService.appSettingsHome) : void 0, + appRoot: this._environmentService.appRoot ? URI.file(this._environmentService.appRoot) : undefined, + appSettingsHome: this._environmentService.appSettingsHome ? URI.file(this._environmentService.appSettingsHome) : undefined, extensionDevelopmentLocationURI: this._environmentService.extensionDevelopmentLocationURI, extensionTestsPath: this._environmentService.extensionTestsPath, globalStorageHome: URI.file(this._environmentService.globalStorageHome) diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionHostProcessManager.ts b/src/vs/workbench/services/extensions/electron-browser/extensionHostProcessManager.ts index 44cd272a47ed5..e7195d12874a3 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionHostProcessManager.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionHostProcessManager.ts @@ -24,7 +24,7 @@ import { CanonicalExtensionIdentifier } from 'vs/platform/extensions/common/exte const LOG_EXTENSION_HOST_COMMUNICATION = false; const LOG_USE_COLORS = true; -const NO_OP_VOID_PROMISE = Promise.resolve(void 0); +const NO_OP_VOID_PROMISE = Promise.resolve(undefined); export class ExtensionHostProcessManager extends Disposable { diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts index 1f168541e8a3a..dbf60e095a048 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts @@ -32,7 +32,7 @@ import { ExtensionHostProcessManager } from 'vs/workbench/services/extensions/el import { CanonicalExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; const hasOwnProperty = Object.hasOwnProperty; -const NO_OP_VOID_PROMISE = Promise.resolve(void 0); +const NO_OP_VOID_PROMISE = Promise.resolve(undefined); const DYNAMIC_EXTENSION_POINTS = false; schema.properties.engines.properties.vscode.default = `^${pkg.version}`; @@ -431,7 +431,7 @@ export class ExtensionService extends Disposable implements IExtensionService { perf.mark('extensionHostReady'); this._installedExtensionsReady.open(); - this._onDidRegisterExtensions.fire(void 0); + this._onDidRegisterExtensions.fire(undefined); this._onDidChangeExtensionsStatus.fire(availableExtensions.map(e => e.identifier)); } diff --git a/src/vs/workbench/services/files/electron-browser/fileService.ts b/src/vs/workbench/services/files/electron-browser/fileService.ts index 1e4bd774d75dc..a08ba498f277b 100644 --- a/src/vs/workbench/services/files/electron-browser/fileService.ts +++ b/src/vs/workbench/services/files/electron-browser/fileService.ts @@ -121,7 +121,7 @@ export class FileService extends Disposable implements IFileService { } private handleError(error: string | Error): void { - const msg = error ? error.toString() : void 0; + const msg = error ? error.toString() : undefined; if (!msg) { return; } @@ -221,7 +221,7 @@ export class FileService extends Disposable implements IFileService { resolveFiles(toResolve: { resource: uri, options?: IResolveFileOptions }[]): Promise { return Promise.all(toResolve.map(resourceAndOptions => this.resolve(resourceAndOptions.resource, resourceAndOptions.options) - .then(stat => ({ stat, success: true }), error => ({ stat: void 0, success: false })))); + .then(stat => ({ stat, success: true }), error => ({ stat: undefined, success: false })))); } existsFile(resource: uri): Promise { @@ -263,13 +263,13 @@ export class FileService extends Disposable implements IFileService { } const result: IStreamContent = { - resource: void 0, - name: void 0, - mtime: void 0, - etag: void 0, - encoding: void 0, + resource: undefined, + name: undefined, + mtime: undefined, + etag: undefined, + encoding: undefined, isReadonly: false, - value: void 0 + value: undefined }; const contentResolverTokenSource = new CancellationTokenSource(); @@ -326,7 +326,7 @@ export class FileService extends Disposable implements IFileService { } } - return void 0; + return undefined; }, err => { // Wrap file not found errors @@ -358,8 +358,8 @@ export class FileService extends Disposable implements IFileService { let contentsError: Error; completePromise = Promise.all([ - statsPromise.then(() => void 0, error => statsError = error), - this.fillInContents(result, resource, options, contentResolverTokenSource.token).then(() => void 0, error => contentsError = error) + statsPromise.then(() => undefined, error => statsError = error), + this.fillInContents(result, resource, options, contentResolverTokenSource.token).then(() => undefined, error => contentsError = error) ]).then(() => { // Since each file operation can return a FileOperationError // we want to prefer that one if possible. Otherwise we just @@ -376,7 +376,7 @@ export class FileService extends Disposable implements IFileService { return Promise.reject(statsError || contentsError); } - return void 0; + return undefined; }); } @@ -402,8 +402,8 @@ export class FileService extends Disposable implements IFileService { const chunkBuffer = Buffer.allocUnsafe(64 * 1024); const result: IContentData = { - encoding: void 0, - stream: void 0 + encoding: undefined, + stream: undefined }; return new Promise((resolve, reject) => { @@ -528,7 +528,7 @@ export class FileService extends Disposable implements IFileService { resolve(result); handleChunk(bytesRead); } - }).then(void 0, err => { + }).then(undefined, err => { // failed to get encoding finish(err); }); @@ -599,7 +599,7 @@ export class FileService extends Disposable implements IFileService { return pfs.truncate(absolutePath, 0).then(() => { // 5.) set contents (with r+ mode) and resolve - return this.doSetContentsAndResolve(resource, absolutePath, value, addBom, encodingToWrite, { flag: 'r+' }).then(void 0, error => { + return this.doSetContentsAndResolve(resource, absolutePath, value, addBom, encodingToWrite, { flag: 'r+' }).then(undefined, error => { if (this.environmentService.verbose) { console.error(`Truncate succeeded, but save failed (${error}), retrying after 100ms`); } @@ -622,7 +622,7 @@ export class FileService extends Disposable implements IFileService { } }); }); - }).then(void 0, error => { + }).then(undefined, error => { if (error.code === 'EACCES' || error.code === 'EPERM') { return Promise.reject(new FileOperationError( nls.localize('filePermission', "Permission denied writing to file ({0})", resource.toString(true)), @@ -678,7 +678,7 @@ export class FileService extends Disposable implements IFileService { return new Promise((resolve, reject) => { const promptOptions = { name: this.environmentService.appNameLong.replace('-', ''), - icns: (isMacintosh && this.environmentService.isBuilt) ? paths.join(paths.dirname(this.environmentService.appRoot), `${product.nameShort}.icns`) : void 0 + icns: (isMacintosh && this.environmentService.isBuilt) ? paths.join(paths.dirname(this.environmentService.appRoot), `${product.nameShort}.icns`) : undefined }; const sudoCommand: string[] = [`"${this.environmentService.cliPath}"`]; @@ -691,7 +691,7 @@ export class FileService extends Disposable implements IFileService { if (error || stderr) { reject(error || stderr); } else { - resolve(void 0); + resolve(undefined); } }); }); @@ -705,7 +705,7 @@ export class FileService extends Disposable implements IFileService { }); }); }); - }).then(void 0, error => { + }).then(undefined, error => { if (this.environmentService.verbose) { this.handleError(`Unable to write to file '${resource.toString(true)}' as elevated user (${error})`); } @@ -938,12 +938,12 @@ export class FileService extends Disposable implements IFileService { if (!recursive) { assertNonRecursiveDelete = pfs.stat(absolutePath).then(stat => { if (!stat.isDirectory()) { - return void 0; + return undefined; } return pfs.readdir(absolutePath).then(children => { if (children.length === 0) { - return void 0; + return undefined; } return Promise.reject(new Error(nls.localize('deleteFailed', "Failed to delete non-empty folder '{0}'.", paths.basename(absolutePath)))); @@ -985,7 +985,7 @@ export class FileService extends Disposable implements IFileService { const absolutePath = this.toAbsolutePath(resource); return pfs.statLink(absolutePath).then(({ isSymbolicLink, stat }) => { - return new StatResolver(resource, isSymbolicLink, stat.isDirectory(), stat.mtime.getTime(), stat.size, this.environmentService.verbose ? err => this.handleError(err) : void 0); + return new StatResolver(resource, isSymbolicLink, stat.isDirectory(), stat.mtime.getTime(), stat.size, this.environmentService.verbose ? err => this.handleError(err) : undefined); }); } diff --git a/src/vs/workbench/services/files/electron-browser/remoteFileService.ts b/src/vs/workbench/services/files/electron-browser/remoteFileService.ts index 64e17826d53e5..945aa5832483d 100644 --- a/src/vs/workbench/services/files/electron-browser/remoteFileService.ts +++ b/src/vs/workbench/services/files/electron-browser/remoteFileService.ts @@ -482,7 +482,7 @@ export class RemoteFileService extends FileService { return new Promise((resolve, reject) => { readable.pipe(encoder).pipe(target); target.once('error', err => reject(err)); - target.once('finish', _ => resolve(void 0)); + target.once('finish', _ => resolve(undefined)); }).then(_ => { return this.resolveFile(resource); }); diff --git a/src/vs/workbench/services/files/node/watcher/nsfw/nsfwWatcherService.ts b/src/vs/workbench/services/files/node/watcher/nsfw/nsfwWatcherService.ts index ffd35ca59df69..246b58ddb1124 100644 --- a/src/vs/workbench/services/files/node/watcher/nsfw/nsfwWatcherService.ts +++ b/src/vs/workbench/services/files/node/watcher/nsfw/nsfwWatcherService.ts @@ -166,7 +166,7 @@ export class NsfwWatcherService implements IWatcherService { }); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); }); }).then(watcher => { this._pathWatchers[request.basePath].watcher = watcher; @@ -211,12 +211,12 @@ export class NsfwWatcherService implements IWatcherService { } }); - return Promise.all(promises).then(() => void 0); + return Promise.all(promises).then(() => undefined); } public setVerboseLogging(enabled: boolean): Promise { this._verboseLogging = enabled; - return Promise.resolve(void 0); + return Promise.resolve(undefined); } public stop(): Promise { diff --git a/src/vs/workbench/services/files/test/electron-browser/fileService.test.ts b/src/vs/workbench/services/files/test/electron-browser/fileService.test.ts index 597621ee31a45..6be722e48fbd9 100644 --- a/src/vs/workbench/services/files/test/electron-browser/fileService.test.ts +++ b/src/vs/workbench/services/files/test/electron-browser/fileService.test.ts @@ -69,7 +69,7 @@ suite('FileService', () => { fs.writeFileSync(resource.fsPath, ''); // create file - return service.createFile(resource, contents).then(void 0, error => { + return service.createFile(resource, contents).then(undefined, error => { assert.ok(error); }); }); @@ -284,7 +284,7 @@ suite('FileService', () => { }); return service.resolveFile(uri.file(path.join(testDir, 'index.html'))).then(source => { - return service.moveFile(uri.file(testDir), uri.file(path.join(testDir, 'binary.txt'))).then(void 0, (e: Error) => { + return service.moveFile(uri.file(testDir), uri.file(path.join(testDir, 'binary.txt'))).then(undefined, (e: Error) => { assert.ok(e); assert.ok(!event); @@ -300,7 +300,7 @@ suite('FileService', () => { }); return service.resolveFile(uri.file(path.join(testDir, 'index.html'))).then(source => { - return service.moveFile(source.resource, uri.file(path.join(testDir, 'binary.txt'))).then(void 0, (e: FileOperationError) => { + return service.moveFile(source.resource, uri.file(path.join(testDir, 'binary.txt'))).then(undefined, (e: FileOperationError) => { assert.equal(e.fileOperationResult, FileOperationResult.FILE_MOVE_CONFLICT); assert.ok(!event); @@ -710,7 +710,7 @@ suite('FileService', () => { test('resolveContent - FILE_IS_BINARY', function () { const resource = uri.file(path.join(testDir, 'binary.txt')); - return service.resolveContent(resource, { acceptTextOnly: true }).then(void 0, (e: FileOperationError) => { + return service.resolveContent(resource, { acceptTextOnly: true }).then(undefined, (e: FileOperationError) => { assert.equal(e.fileOperationResult, FileOperationResult.FILE_IS_BINARY); return service.resolveContent(uri.file(path.join(testDir, 'small.txt')), { acceptTextOnly: true }).then(r => { @@ -722,7 +722,7 @@ suite('FileService', () => { test('resolveContent - FILE_IS_DIRECTORY', function () { const resource = uri.file(path.join(testDir, 'deep')); - return service.resolveContent(resource).then(void 0, (e: FileOperationError) => { + return service.resolveContent(resource).then(undefined, (e: FileOperationError) => { assert.equal(e.fileOperationResult, FileOperationResult.FILE_IS_DIRECTORY); }); }); @@ -730,7 +730,7 @@ suite('FileService', () => { test('resolveContent - FILE_NOT_FOUND', function () { const resource = uri.file(path.join(testDir, '404.html')); - return service.resolveContent(resource).then(void 0, (e: FileOperationError) => { + return service.resolveContent(resource).then(undefined, (e: FileOperationError) => { assert.equal(e.fileOperationResult, FileOperationResult.FILE_NOT_FOUND); }); }); @@ -739,7 +739,7 @@ suite('FileService', () => { const resource = uri.file(path.join(testDir, 'index.html')); return service.resolveContent(resource).then(c => { - return service.resolveContent(resource, { etag: c.etag }).then(void 0, (e: FileOperationError) => { + return service.resolveContent(resource, { etag: c.etag }).then(undefined, (e: FileOperationError) => { assert.equal(e.fileOperationResult, FileOperationResult.FILE_NOT_MODIFIED_SINCE); }); }); @@ -751,7 +751,7 @@ suite('FileService', () => { return service.resolveContent(resource).then(c => { fs.writeFileSync(resource.fsPath, 'Updates Incoming!'); - return service.updateContent(resource, c.value, { etag: c.etag, mtime: c.mtime - 1000 }).then(void 0, (e: FileOperationError) => { + return service.updateContent(resource, c.value, { etag: c.etag, mtime: c.mtime - 1000 }).then(undefined, (e: FileOperationError) => { assert.equal(e.fileOperationResult, FileOperationResult.FILE_MODIFIED_SINCE); }); }); diff --git a/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/examples/company.js b/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/examples/company.js index ca4a62bf248b6..b65b52ade6906 100644 --- a/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/examples/company.js +++ b/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/examples/company.js @@ -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(); { diff --git a/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/examples/conway.js b/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/examples/conway.js index e99829c832531..96892a1f68923 100644 --- a/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/examples/conway.js +++ b/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/examples/conway.js @@ -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() { diff --git a/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/examples/small.js b/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/examples/small.js index 5e57b4c9439a3..2fb478319a52c 100644 --- a/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/examples/small.js +++ b/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/examples/small.js @@ -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) { diff --git a/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/other/deep/company.js b/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/other/deep/company.js index ca4a62bf248b6..b65b52ade6906 100644 --- a/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/other/deep/company.js +++ b/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/other/deep/company.js @@ -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(); { diff --git a/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/other/deep/conway.js b/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/other/deep/conway.js index e99829c832531..96892a1f68923 100644 --- a/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/other/deep/conway.js +++ b/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/other/deep/conway.js @@ -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() { diff --git a/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/other/deep/small.js b/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/other/deep/small.js index 5e57b4c9439a3..2fb478319a52c 100644 --- a/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/other/deep/small.js +++ b/src/vs/workbench/services/files/test/electron-browser/fixtures/resolver/other/deep/small.js @@ -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) { diff --git a/src/vs/workbench/services/files/test/electron-browser/fixtures/service/deep/company.js b/src/vs/workbench/services/files/test/electron-browser/fixtures/service/deep/company.js index ca4a62bf248b6..b65b52ade6906 100644 --- a/src/vs/workbench/services/files/test/electron-browser/fixtures/service/deep/company.js +++ b/src/vs/workbench/services/files/test/electron-browser/fixtures/service/deep/company.js @@ -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(); { diff --git a/src/vs/workbench/services/files/test/electron-browser/fixtures/service/deep/conway.js b/src/vs/workbench/services/files/test/electron-browser/fixtures/service/deep/conway.js index e99829c832531..96892a1f68923 100644 --- a/src/vs/workbench/services/files/test/electron-browser/fixtures/service/deep/conway.js +++ b/src/vs/workbench/services/files/test/electron-browser/fixtures/service/deep/conway.js @@ -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() { diff --git a/src/vs/workbench/services/files/test/electron-browser/fixtures/service/deep/small.js b/src/vs/workbench/services/files/test/electron-browser/fixtures/service/deep/small.js index 5e57b4c9439a3..2fb478319a52c 100644 --- a/src/vs/workbench/services/files/test/electron-browser/fixtures/service/deep/small.js +++ b/src/vs/workbench/services/files/test/electron-browser/fixtures/service/deep/small.js @@ -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) { diff --git a/src/vs/workbench/services/files/test/electron-browser/resolver.test.ts b/src/vs/workbench/services/files/test/electron-browser/resolver.test.ts index f8f5a279906af..8d2af37c06f8b 100644 --- a/src/vs/workbench/services/files/test/electron-browser/resolver.test.ts +++ b/src/vs/workbench/services/files/test/electron-browser/resolver.test.ts @@ -18,7 +18,7 @@ function create(relativePath: string): StatResolver { let absolutePath = relativePath ? path.join(basePath, relativePath) : basePath; let fsStat = fs.statSync(absolutePath); - return new StatResolver(uri.file(absolutePath), fsStat.isSymbolicLink(), fsStat.isDirectory(), fsStat.mtime.getTime(), fsStat.size, void 0); + return new StatResolver(uri.file(absolutePath), fsStat.isSymbolicLink(), fsStat.isDirectory(), fsStat.mtime.getTime(), fsStat.size, undefined); } function toResource(relativePath: string): uri { diff --git a/src/vs/workbench/services/group/test/browser/editorGroupsService.test.ts b/src/vs/workbench/services/group/test/browser/editorGroupsService.test.ts index 1fbe4a573c1a9..d9a1a1f8c33c4 100644 --- a/src/vs/workbench/services/group/test/browser/editorGroupsService.test.ts +++ b/src/vs/workbench/services/group/test/browser/editorGroupsService.test.ts @@ -29,7 +29,7 @@ export class TestEditorControl extends BaseEditor { setInput(input: EditorInput, options: EditorOptions, token: CancellationToken): Promise { super.setInput(input, options, token); - return input.resolve().then(() => void 0); + return input.resolve().then(() => undefined); } getId(): string { return 'MyFileEditorForEditorGroupService'; } diff --git a/src/vs/workbench/services/history/electron-browser/history.ts b/src/vs/workbench/services/history/electron-browser/history.ts index cbe72164380c5..fe1950e99cfdd 100644 --- a/src/vs/workbench/services/history/electron-browser/history.ts +++ b/src/vs/workbench/services/history/electron-browser/history.ts @@ -45,7 +45,7 @@ export class TextEditorState { this.textEditorSelection = Selection.isISelection(_selection) ? { startLineNumber: _selection.startLineNumber, startColumn: _selection.startColumn - } : void 0; + } : undefined; } get editorInput(): IEditorInput { @@ -164,7 +164,7 @@ export class HistoryService extends Disposable implements IHistoryService { } private getExcludes(root?: URI): IExpression { - const scope = root ? { resource: root } : void 0; + const scope = root ? { resource: root } : undefined; return getExcludes(this.configurationService.getValue(scope)); } @@ -192,7 +192,7 @@ export class HistoryService extends Disposable implements IHistoryService { } // Remember as last active editor (can be undefined if none opened) - this.lastActiveEditor = activeControl ? { editor: activeControl.input, groupId: activeControl.group.id } : void 0; + this.lastActiveEditor = activeControl ? { editor: activeControl.input, groupId: activeControl.group.id } : undefined; // Dispose old listeners dispose(this.activeEditorListeners); @@ -252,7 +252,7 @@ export class HistoryService extends Disposable implements IHistoryService { // Track closing of editor to support to reopen closed editors (unless editor was replaced) if (!event.replaced) { - const resource = event.editor ? event.editor.getResource() : void 0; + const resource = event.editor ? event.editor.getResource() : undefined; const supportsReopen = resource && this.fileService.canHandleResource(resource); // we only support file'ish things to reopen if (supportsReopen) { @@ -435,7 +435,7 @@ export class HistoryService extends Disposable implements IHistoryService { } private handleEditorEventInHistory(editor?: IBaseEditor): void { - const input = editor ? editor.input : void 0; + const input = editor ? editor.input : undefined; // Ensure we have at least a name to show and not configured to exclude input if (!input || !input.getName() || !this.include(input)) { @@ -538,7 +538,7 @@ export class HistoryService extends Disposable implements IHistoryService { } private handleEditorEventInStack(control: IBaseEditor, event?: ICursorPositionChangedEvent): void { - const codeEditor = control ? getCodeEditor(control.getControl()) : void 0; + const codeEditor = control ? getCodeEditor(control.getControl()) : undefined; // treat editor changes that happen as part of stack navigation specially // we do not want to add a new stack entry as a matter of navigating the @@ -832,7 +832,7 @@ export class HistoryService extends Disposable implements IHistoryService { return { resourceJSON: (input as IResourceInput).resource.toJSON() } as ISerializedEditorHistoryEntry; } - return void 0; + return undefined; })); this.storageService.store(HistoryService.STORAGE_KEY, JSON.stringify(entries), StorageScope.WORKSPACE); @@ -854,7 +854,7 @@ export class HistoryService extends Disposable implements IHistoryService { } catch (error) { onUnexpectedError(error); - return void 0; // https://github.com/Microsoft/vscode/issues/60960 + return undefined; // https://github.com/Microsoft/vscode/issues/60960 } })); } @@ -881,7 +881,7 @@ export class HistoryService extends Disposable implements IHistoryService { } } - return void 0; + return undefined; } getLastActiveWorkspaceRoot(schemeFilter?: string): URI { @@ -889,7 +889,7 @@ export class HistoryService extends Disposable implements IHistoryService { // No Folder: return early const folders = this.contextService.getWorkspace().folders; if (folders.length === 0) { - return void 0; + return undefined; } // Single Folder: return early @@ -899,7 +899,7 @@ export class HistoryService extends Disposable implements IHistoryService { return resource; } - return void 0; + return undefined; } // Multiple folders: find the last active one @@ -929,7 +929,7 @@ export class HistoryService extends Disposable implements IHistoryService { } } - return void 0; + return undefined; } getLastActiveFile(schemeFilter: string): URI { @@ -949,6 +949,6 @@ export class HistoryService extends Disposable implements IHistoryService { } } - return void 0; + return undefined; } } diff --git a/src/vs/workbench/services/keybinding/common/keybindingEditing.ts b/src/vs/workbench/services/keybinding/common/keybindingEditing.ts index 3e7f51d3990bc..d77fa82127cf5 100644 --- a/src/vs/workbench/services/keybinding/common/keybindingEditing.ts +++ b/src/vs/workbench/services/keybinding/common/keybindingEditing.ts @@ -130,7 +130,7 @@ export class KeybindingsEditingService extends Disposable implements IKeybinding const userKeybindingEntries = json.parse(model.getValue()); const userKeybindingEntryIndex = this.findUserKeybindingEntryIndex(keybindingItem, userKeybindingEntries); if (userKeybindingEntryIndex !== -1) { - this.applyEditsToBuffer(setProperty(model.getValue(), [userKeybindingEntryIndex], void 0, { tabSize, insertSpaces, eol })[0], model); + this.applyEditsToBuffer(setProperty(model.getValue(), [userKeybindingEntryIndex], undefined, { tabSize, insertSpaces, eol })[0], model); } } @@ -146,7 +146,7 @@ export class KeybindingsEditingService extends Disposable implements IKeybinding const userKeybindingEntries = json.parse(model.getValue()); const indices = this.findUnassignedDefaultKeybindingEntryIndex(keybindingItem, userKeybindingEntries).reverse(); for (const index of indices) { - this.applyEditsToBuffer(setProperty(model.getValue(), [index], void 0, { tabSize, insertSpaces, eol })[0], model); + this.applyEditsToBuffer(setProperty(model.getValue(), [index], undefined, { tabSize, insertSpaces, eol })[0], model); } } diff --git a/src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts b/src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts index 1b07bf6077630..b586ba0c870e4 100644 --- a/src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts +++ b/src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts @@ -111,9 +111,9 @@ suite('KeybindingsEditing', () => { teardown(() => { return new Promise((c, e) => { if (testDir) { - extfs.del(testDir, os.tmpdir(), () => c(void 0), () => c(void 0)); + extfs.del(testDir, os.tmpdir(), () => c(undefined), () => c(undefined)); } else { - c(void 0); + c(undefined); } }).then(() => testDir = null!); }); @@ -250,7 +250,7 @@ suite('KeybindingsEditing', () => { return new SimpleKeybinding(ctrlKey!, shiftKey!, altKey!, metaKey!, part.keyCode); }; const keybinding = firstPart ? chordPart ? new ChordKeybinding(aSimpleKeybinding(firstPart), aSimpleKeybinding(chordPart)) : aSimpleKeybinding(firstPart) : null; - return new ResolvedKeybindingItem(keybinding ? new USLayoutResolvedKeybinding(keybinding, OS) : null, command || 'some command', null, when ? ContextKeyExpr.deserialize(when) : null, isDefault === void 0 ? true : isDefault); + return new ResolvedKeybindingItem(keybinding ? new USLayoutResolvedKeybinding(keybinding, OS) : null, command || 'some command', null, when ? ContextKeyExpr.deserialize(when) : null, isDefault === undefined ? true : isDefault); } }); diff --git a/src/vs/workbench/services/preferences/browser/preferencesService.ts b/src/vs/workbench/services/preferences/browser/preferencesService.ts index 0eafccadbef90..397a3ecfe15e6 100644 --- a/src/vs/workbench/services/preferences/browser/preferencesService.ts +++ b/src/vs/workbench/services/preferences/browser/preferencesService.ts @@ -268,9 +268,9 @@ export class PreferencesService extends Disposable implements IPreferencesServic return Promise.all([ this.editorService.openEditor({ resource: this.defaultKeybindingsResource, options: { pinned: true, preserveFocus: true, revealIfOpened: true }, label: nls.localize('defaultKeybindings', "Default Keybindings"), description: '' }), this.editorService.openEditor({ resource: editableKeybindings, options: { pinned: true, revealIfOpened: true } }, sideEditorGroup.id) - ]).then(editors => void 0); + ]).then(editors => undefined); } else { - return this.editorService.openEditor({ resource: editableKeybindings, options: { pinned: true, revealIfOpened: true } }).then(() => void 0); + return this.editorService.openEditor({ resource: editableKeybindings, options: { pinned: true, revealIfOpened: true } }).then(() => undefined); } }); } @@ -514,13 +514,13 @@ export class PreferencesService extends Disposable implements IPreferencesServic if (this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE && target === ConfigurationTarget.WORKSPACE) { const workspaceConfig = this.contextService.getWorkspace().configuration; if (!workspaceConfig) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } return this.fileService.resolveContent(workspaceConfig) .then(content => { if (Object.keys(parse(content.value)).indexOf('settings') === -1) { - return this.jsonEditingService.write(resource, { key: 'settings', value: {} }, true).then(void 0, () => { }); + return this.jsonEditingService.write(resource, { key: 'settings', value: {} }, true).then(undefined, () => { }); } return null; }); @@ -529,9 +529,9 @@ export class PreferencesService extends Disposable implements IPreferencesServic } private createIfNotExists(resource: URI, contents: string): Promise { - return this.fileService.resolveContent(resource, { acceptTextOnly: true }).then(void 0, error => { + return this.fileService.resolveContent(resource, { acceptTextOnly: true }).then(undefined, error => { if ((error).fileOperationResult === FileOperationResult.FILE_NOT_FOUND) { - return this.fileService.updateContent(resource, contents).then(void 0, error => { + return this.fileService.updateContent(resource, contents).then(undefined, error => { return Promise.reject(new Error(nls.localize('fail.createSettings', "Unable to create '{0}' ({1}).", this.labelService.getUriLabel(resource, { relative: true }), error))); }); } diff --git a/src/vs/workbench/services/preferences/test/common/keybindingsEditorModel.test.ts b/src/vs/workbench/services/preferences/test/common/keybindingsEditorModel.test.ts index cf17bb6de9b96..85a11654b2090 100644 --- a/src/vs/workbench/services/preferences/test/common/keybindingsEditorModel.test.ts +++ b/src/vs/workbench/services/preferences/test/common/keybindingsEditorModel.test.ts @@ -611,7 +611,7 @@ suite('KeybindingsEditorModel test', () => { return new SimpleKeybinding(ctrlKey!, shiftKey!, altKey!, metaKey!, part.keyCode); }; const keybinding = firstPart ? chordPart ? new ChordKeybinding(aSimpleKeybinding(firstPart), aSimpleKeybinding(chordPart)) : aSimpleKeybinding(firstPart) : null; - return new ResolvedKeybindingItem(keybinding ? new USLayoutResolvedKeybinding(keybinding, OS) : null, command || 'some command', null, when ? ContextKeyExpr.deserialize(when) : null, isDefault === void 0 ? true : isDefault); + return new ResolvedKeybindingItem(keybinding ? new USLayoutResolvedKeybinding(keybinding, OS) : null, command || 'some command', null, when ? ContextKeyExpr.deserialize(when) : null, isDefault === undefined ? true : isDefault); } function asResolvedKeybindingItems(keybindingEntries: IKeybindingItemEntry[], keepUnassigned: boolean = false): ResolvedKeybindingItem[] { diff --git a/src/vs/workbench/services/progress/browser/progressService.ts b/src/vs/workbench/services/progress/browser/progressService.ts index e4b63c6f079be..6c4970821d6e3 100644 --- a/src/vs/workbench/services/progress/browser/progressService.ts +++ b/src/vs/workbench/services/progress/browser/progressService.ts @@ -116,13 +116,13 @@ export class ScopedProgressService extends ScopedService implements IProgressSer } private clearProgressState(): void { - this.progressState.infinite = void 0; - this.progressState.done = void 0; - this.progressState.worked = void 0; - this.progressState.total = void 0; - this.progressState.whilePromise = void 0; - this.progressState.whileStart = void 0; - this.progressState.whileDelay = void 0; + this.progressState.infinite = undefined; + this.progressState.done = undefined; + this.progressState.worked = undefined; + this.progressState.total = undefined; + this.progressState.whilePromise = undefined; + this.progressState.whileStart = undefined; + this.progressState.whileDelay = undefined; } show(infinite: boolean, delay?: number): IProgressRunner; @@ -188,8 +188,8 @@ export class ScopedProgressService extends ScopedService implements IProgressSer // Otherwise the progress bar does not support worked(), we fallback to infinite() progress else { this.progressState.infinite = true; - this.progressState.worked = void 0; - this.progressState.total = void 0; + this.progressState.worked = undefined; + this.progressState.total = undefined; this.progressbar.infinite().show(); } }, diff --git a/src/vs/workbench/services/progress/browser/progressService2.ts b/src/vs/workbench/services/progress/browser/progressService2.ts index 7a5b5a94d0825..5b10a77f060e1 100644 --- a/src/vs/workbench/services/progress/browser/progressService2.ts +++ b/src/vs/workbench/services/progress/browser/progressService2.ts @@ -148,7 +148,7 @@ export class ProgressService2 implements IProgressService2 { onDidCancel(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } }; toDispose.push(cancelAction); diff --git a/src/vs/workbench/services/search/node/legacy/textSearch.ts b/src/vs/workbench/services/search/node/legacy/textSearch.ts index 115e631459c7c..0c8fa95a22493 100644 --- a/src/vs/workbench/services/search/node/legacy/textSearch.ts +++ b/src/vs/workbench/services/search/node/legacy/textSearch.ts @@ -48,14 +48,14 @@ export class Engine implements ISearchEngine { this.workers.forEach(w => { w.cancel() - .then(void 0, onUnexpectedError); + .then(undefined, onUnexpectedError); }); } initializeWorkers(): void { this.workers.forEach(w => { w.initialize() - .then(void 0, onUnexpectedError); + .then(undefined, onUnexpectedError); }); } diff --git a/src/vs/workbench/services/search/node/legacy/worker/searchWorker.ts b/src/vs/workbench/services/search/node/legacy/worker/searchWorker.ts index bee58fbf41803..129931f9a5466 100644 --- a/src/vs/workbench/services/search/node/legacy/worker/searchWorker.ts +++ b/src/vs/workbench/services/search/node/legacy/worker/searchWorker.ts @@ -42,7 +42,7 @@ export class SearchWorker implements ISearchWorker { this.currentSearchEngine.cancel(); } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } search(args: ISearchWorkerSearchArgs): Promise { @@ -157,7 +157,7 @@ export class SearchWorkerEngine { return new Promise((resolve, reject) => { fs.open(filename, 'r', null, (error: Error, fd: number) => { if (error) { - return resolve(void 0); + return resolve(undefined); } const buffer = Buffer.allocUnsafe(options.bufferLength); @@ -274,7 +274,7 @@ export class SearchWorkerEngine { readFile(/*isFirstRead=*/true, (error: Error) => { if (error) { - return resolve(void 0); + return resolve(undefined); } if (line.length) { @@ -282,7 +282,7 @@ export class SearchWorkerEngine { } fs.close(fd, (error: Error) => { - resolve(void 0); + resolve(undefined); }); }); }); diff --git a/src/vs/workbench/services/search/test/node/fixtures/examples/NullPoinderException.js b/src/vs/workbench/services/search/test/node/fixtures/examples/NullPoinderException.js index b4905089c2355..110f60aa08339 100644 --- a/src/vs/workbench/services/search/test/node/fixtures/examples/NullPoinderException.js +++ b/src/vs/workbench/services/search/test/node/fixtures/examples/NullPoinderException.js @@ -8,9 +8,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() { diff --git a/src/vs/workbench/services/search/test/node/fixtures/examples/company.js b/src/vs/workbench/services/search/test/node/fixtures/examples/company.js index ca4a62bf248b6..b65b52ade6906 100644 --- a/src/vs/workbench/services/search/test/node/fixtures/examples/company.js +++ b/src/vs/workbench/services/search/test/node/fixtures/examples/company.js @@ -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(); { diff --git a/src/vs/workbench/services/search/test/node/fixtures/examples/small.js b/src/vs/workbench/services/search/test/node/fixtures/examples/small.js index 5e57b4c9439a3..2fb478319a52c 100644 --- a/src/vs/workbench/services/search/test/node/fixtures/examples/small.js +++ b/src/vs/workbench/services/search/test/node/fixtures/examples/small.js @@ -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) { diff --git a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts index a08c73886107d..522436d3dedc7 100644 --- a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts +++ b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts @@ -186,7 +186,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil const autoSaveAfterMilliesEnabled = (typeof config.autoSaveDelay === 'number') && config.autoSaveDelay > 0; this.autoSaveAfterMilliesEnabled = autoSaveAfterMilliesEnabled; - this.autoSaveAfterMillies = autoSaveAfterMilliesEnabled ? config.autoSaveDelay : void 0; + this.autoSaveAfterMillies = autoSaveAfterMilliesEnabled ? config.autoSaveDelay : undefined; } private onFilesAssociationChange(): void { @@ -195,7 +195,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil } const firstLineText = this.getFirstLineText(this.textEditorModel); - const languageSelection = this.getOrCreateMode(this.modeService, void 0, firstLineText); + const languageSelection = this.getOrCreateMode(this.modeService, undefined, firstLineText); this.modelService.setMode(this.textEditorModel, languageSelection); } @@ -206,7 +206,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil revert(soft?: boolean): Promise { if (!this.isResolved()) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } // Cancel any running auto-save @@ -270,7 +270,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil resource: this.resource, name: path.basename(this.resource.fsPath), mtime: Date.now(), - etag: void 0, + etag: undefined, value: createTextBufferFactory(''), /* will be filled later from backup */ encoding: this.fileService.encoding.getWriteEncoding(this.resource, this.preferredEncoding), isReadonly: false @@ -291,7 +291,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil // Decide on etag let etag: string; if (forceReadFromDisk) { - etag = void 0; // reset ETag if we enforce to read from disk + etag = undefined; // reset ETag if we enforce to read from disk } else if (this.lastResolvedDiskStat) { etag = this.lastResolvedDiskStat.etag; // otherwise respect etag to support caching } @@ -384,7 +384,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil etag: content.etag, isDirectory: false, isSymbolicLink: false, - children: void 0, + children: undefined, isReadonly: content.isReadonly } as IFileStat); @@ -577,13 +577,13 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil private cancelPendingAutoSave(): void { if (this.autoSaveDisposable) { this.autoSaveDisposable.dispose(); - this.autoSaveDisposable = void 0; + this.autoSaveDisposable = undefined; } } save(options: ISaveOptions = Object.create(null)): Promise { if (!this.isResolved()) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } this.logService.trace('save() - enter', this.resource); @@ -622,7 +622,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil if ((!options.force && !this.dirty) || versionId !== this.versionId) { this.logService.trace(`doSave(${versionId}) - exit - because not dirty and/or versionId is different (this.isDirty: ${this.dirty}, this.versionId: ${this.versionId})`, this.resource); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } // Return if currently saving by storing this save request as the next save that should happen. @@ -672,7 +672,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil // saving contents to disk that are stale (see https://github.com/Microsoft/vscode/issues/50942). // To fix this issue, we will not store the contents to disk when we got disposed. if (this.disposed) { - return void 0; + return undefined; } // Under certain conditions we do a short-cut of flushing contents to disk when we can assume that @@ -1062,7 +1062,7 @@ export class SaveSequentializer { } get pendingSave(): Promise { - return this._pendingSave ? this._pendingSave.promise : void 0; + return this._pendingSave ? this._pendingSave.promise : undefined; } setPending(versionId: number, promise: Promise): Promise { @@ -1077,7 +1077,7 @@ export class SaveSequentializer { if (this._pendingSave && versionId === this._pendingSave.versionId) { // only set pending to done if the promise finished that is associated with that versionId - this._pendingSave = void 0; + this._pendingSave = undefined; // schedule the next save now that we are free if we have any this.triggerNextSave(); @@ -1087,7 +1087,7 @@ export class SaveSequentializer { private triggerNextSave(): void { if (this._nextSave) { const saveOperation = this._nextSave; - this._nextSave = void 0; + this._nextSave = undefined; // Run next save and complete on the associated promise saveOperation.run().then(saveOperation.promiseResolve, saveOperation.promiseReject); diff --git a/src/vs/workbench/services/textfile/common/textFileEditorModelManager.ts b/src/vs/workbench/services/textfile/common/textFileEditorModelManager.ts index 1ae42707919af..0359fe991ffd3 100644 --- a/src/vs/workbench/services/textfile/common/textFileEditorModelManager.ts +++ b/src/vs/workbench/services/textfile/common/textFileEditorModelManager.ts @@ -153,7 +153,7 @@ export class TextFileEditorModelManager extends Disposable implements ITextFileE // Model does not exist else { - model = this.instantiationService.createInstance(TextFileEditorModel, resource, options ? options.encoding : void 0); + model = this.instantiationService.createInstance(TextFileEditorModel, resource, options ? options.encoding : undefined); modelPromise = model.load(options); // Install state change listener diff --git a/src/vs/workbench/services/textfile/common/textFileService.ts b/src/vs/workbench/services/textfile/common/textFileService.ts index 7519e50143aaa..14be68080f9be 100644 --- a/src/vs/workbench/services/textfile/common/textFileService.ts +++ b/src/vs/workbench/services/textfile/common/textFileService.ts @@ -133,7 +133,7 @@ export abstract class TextFileService extends Disposable implements ITextFileSer return this.handleDirtyBeforeShutdown(remainingDirty, reason); } - return void 0; + return undefined; }); } @@ -245,7 +245,7 @@ export abstract class TextFileService extends Disposable implements ITextFileSer return this.backupFileService.backupResource(model.getResource(), model.createSnapshot(), model.getVersionId()); }); - return Promise.all(untitledBackupPromises).then(() => void 0); + return Promise.all(untitledBackupPromises).then(() => undefined); }); }); } @@ -279,7 +279,7 @@ export abstract class TextFileService extends Disposable implements ITextFileSer return true; // veto } - return void 0; + return undefined; }); } @@ -297,7 +297,7 @@ export abstract class TextFileService extends Disposable implements ITextFileSer protected cleanupBackupsBeforeShutdown(): Promise { if (this.environmentService.isExtensionDevelopment) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } return this.backupFileService.discardAllWorkspaceBackups(); @@ -316,19 +316,19 @@ export abstract class TextFileService extends Disposable implements ITextFileSer break; case AutoSaveConfiguration.ON_FOCUS_CHANGE: - this.configuredAutoSaveDelay = void 0; + this.configuredAutoSaveDelay = undefined; this.configuredAutoSaveOnFocusChange = true; this.configuredAutoSaveOnWindowChange = false; break; case AutoSaveConfiguration.ON_WINDOW_CHANGE: - this.configuredAutoSaveDelay = void 0; + this.configuredAutoSaveDelay = undefined; this.configuredAutoSaveOnFocusChange = false; this.configuredAutoSaveOnWindowChange = true; break; default: - this.configuredAutoSaveDelay = void 0; + this.configuredAutoSaveDelay = undefined; this.configuredAutoSaveOnFocusChange = false; this.configuredAutoSaveOnWindowChange = false; break; @@ -477,7 +477,7 @@ export abstract class TextFileService extends Disposable implements ITextFileSer } private doSaveAllFiles(resources?: URI[], options: ISaveOptions = Object.create(null)): Promise { - const dirtyFileModels = this.getDirtyFileModels(Array.isArray(resources) ? resources : void 0 /* Save All */) + const dirtyFileModels = this.getDirtyFileModels(Array.isArray(resources) ? resources : undefined /* Save All */) .filter(model => { if ((model.hasState(ModelState.CONFLICT) || model.hasState(ModelState.ERROR)) && (options.reason === SaveReason.AUTO || options.reason === SaveReason.FOCUS_CHANGE || options.reason === SaveReason.WINDOW_CHANGE)) { return false; // if model is in save conflict or error, do not save unless save reason is explicit or not provided at all @@ -681,7 +681,7 @@ export abstract class TextFileService extends Disposable implements ITextFileSer return Promise.reject(error); } - return void 0; + return undefined; }); })).then(r => ({ results: mapResourceToResult.values() })); } @@ -699,7 +699,7 @@ export abstract class TextFileService extends Disposable implements ITextFileSer return existingModel.revert(); } - return void 0; + return undefined; }); } @@ -717,7 +717,7 @@ export abstract class TextFileService extends Disposable implements ITextFileSer oldResource: source, newResource: target, waitUntil(promise: Promise) { - waitForPromises.push(promise.then(void 0, errors.onUnexpectedError)); + waitForPromises.push(promise.then(undefined, errors.onUnexpectedError)); } }); @@ -774,7 +774,7 @@ export abstract class TextFileService extends Disposable implements ITextFileSer return this.fileService.moveFile(source, target, overwrite).then(() => { // Load models that were dirty before - return Promise.all(dirtyTargetModels.map(dirtyTargetModel => this.models.loadOrCreate(dirtyTargetModel))).then(() => void 0); + return Promise.all(dirtyTargetModels.map(dirtyTargetModel => this.models.loadOrCreate(dirtyTargetModel))).then(() => undefined); }, error => { // In case of an error, discard any dirty target backups that were made @@ -805,7 +805,7 @@ export abstract class TextFileService extends Disposable implements ITextFileSer getAutoSaveConfiguration(): IAutoSaveConfiguration { return { - autoSaveDelay: this.configuredAutoSaveDelay && this.configuredAutoSaveDelay > 0 ? this.configuredAutoSaveDelay : void 0, + autoSaveDelay: this.configuredAutoSaveDelay && this.configuredAutoSaveDelay > 0 ? this.configuredAutoSaveDelay : undefined, autoSaveFocusChange: this.configuredAutoSaveOnFocusChange, autoSaveApplicationChange: this.configuredAutoSaveOnWindowChange }; diff --git a/src/vs/workbench/services/textfile/electron-browser/textFileService.ts b/src/vs/workbench/services/textfile/electron-browser/textFileService.ts index 070eaa3c3ba53..8482e1bbdad53 100644 --- a/src/vs/workbench/services/textfile/electron-browser/textFileService.ts +++ b/src/vs/workbench/services/textfile/electron-browser/textFileService.ts @@ -125,7 +125,7 @@ export class TextFileService extends AbstractTextFileService { interface IFilter { name: string; extensions: string[]; } // Build the file filter by using our known languages - const ext: string = defaultUri ? paths.extname(defaultUri.path) : void 0; + const ext: string = defaultUri ? paths.extname(defaultUri.path) : undefined; let matchingFilter: IFilter; const filters: IFilter[] = coalesce(this.modeService.getRegisteredLanguageNames().map(languageName => { const extensions = this.modeService.getExtensions(languageName); diff --git a/src/vs/workbench/services/textfile/test/textFileService.test.ts b/src/vs/workbench/services/textfile/test/textFileService.test.ts index f5222c90e32ad..7c75c57e3ead7 100644 --- a/src/vs/workbench/services/textfile/test/textFileService.test.ts +++ b/src/vs/workbench/services/textfile/test/textFileService.test.ts @@ -121,7 +121,7 @@ suite('Files - TextFileService', () => { assert.ok(service.cleanupBackupsBeforeShutdownCalled); assert.ok(!veto); - return void 0; + return undefined; } else { return veto.then(veto => { assert.ok(service.cleanupBackupsBeforeShutdownCalled); diff --git a/src/vs/workbench/services/textmodelResolver/test/textModelResolverService.test.ts b/src/vs/workbench/services/textmodelResolver/test/textModelResolverService.test.ts index 81e418976591f..1184718000562 100644 --- a/src/vs/workbench/services/textmodelResolver/test/textModelResolverService.test.ts +++ b/src/vs/workbench/services/textmodelResolver/test/textModelResolverService.test.ts @@ -47,7 +47,7 @@ suite('Workbench - TextModelResolverService', () => { teardown(() => { if (model) { model.dispose(); - model = (void 0)!; + model = (undefined)!; } (accessor.textFileService.models).clear(); (accessor.textFileService.models).dispose(); diff --git a/src/vs/workbench/services/themes/electron-browser/colorThemeData.ts b/src/vs/workbench/services/themes/electron-browser/colorThemeData.ts index f7605112a6412..59ee56d0eddd3 100644 --- a/src/vs/workbench/services/themes/electron-browser/colorThemeData.ts +++ b/src/vs/workbench/services/themes/electron-browser/colorThemeData.ts @@ -143,7 +143,7 @@ export class ColorThemeData implements IColorTheme { }); } } - return Promise.resolve(void 0); + return Promise.resolve(undefined); } /** diff --git a/src/vs/workbench/services/themes/electron-browser/colorThemeStore.ts b/src/vs/workbench/services/themes/electron-browser/colorThemeStore.ts index d9a95109accff..5f93469dc1b22 100644 --- a/src/vs/workbench/services/themes/electron-browser/colorThemeStore.ts +++ b/src/vs/workbench/services/themes/electron-browser/colorThemeStore.ts @@ -110,7 +110,7 @@ export class ColorThemeStore { public findThemeData(themeId: string, defaultId?: string): Promise { return this.getColorThemes().then(allThemes => { - let defaultTheme: ColorThemeData = void 0; + let defaultTheme: ColorThemeData = undefined; for (let t of allThemes) { if (t.id === themeId) { return t; @@ -125,7 +125,7 @@ export class ColorThemeStore { public findThemeDataBySettingsId(settingsId: string, defaultId: string): Promise { return this.getColorThemes().then(allThemes => { - let defaultTheme: ColorThemeData = void 0; + let defaultTheme: ColorThemeData = undefined; for (let t of allThemes) { if (t.settingsId === settingsId) { return t; diff --git a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts index 985f2617f2138..90c579d0d7354 100644 --- a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts +++ b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts @@ -145,7 +145,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { } } - this.initialize().then(void 0, errors.onUnexpectedError).then(_ => { + this.initialize().then(undefined, errors.onUnexpectedError).then(_ => { this.installConfigurationListener(); }); @@ -500,16 +500,16 @@ class ConfigurationWriter { let settings = this.configurationService.inspect(key); if (settingsTarget === ConfigurationTarget.USER) { if (value === settings.user) { - return Promise.resolve(void 0); // nothing to do + return Promise.resolve(undefined); // nothing to do } else if (value === settings.default) { if (types.isUndefined(settings.user)) { - return Promise.resolve(void 0); // nothing to do + return Promise.resolve(undefined); // nothing to do } - value = void 0; // remove configuration from user settings + value = undefined; // remove configuration from user settings } } else if (settingsTarget === ConfigurationTarget.WORKSPACE) { if (value === settings.value) { - return Promise.resolve(void 0); // nothing to do + return Promise.resolve(undefined); // nothing to do } } return this.configurationService.updateValue(key, value, settingsTarget); diff --git a/src/vs/workbench/services/untitled/common/untitledEditorService.ts b/src/vs/workbench/services/untitled/common/untitledEditorService.ts index 6790f90a21efb..922df53de25b1 100644 --- a/src/vs/workbench/services/untitled/common/untitledEditorService.ts +++ b/src/vs/workbench/services/untitled/common/untitledEditorService.ts @@ -268,12 +268,12 @@ export class UntitledEditorService extends Disposable implements IUntitledEditor suggestFileName(resource: URI): string { const input = this.get(resource); - return input ? input.suggestFileName() : void 0; + return input ? input.suggestFileName() : undefined; } getEncoding(resource: URI): string { const input = this.get(resource); - return input ? input.getEncoding() : void 0; + return input ? input.getEncoding() : undefined; } } diff --git a/src/vs/workbench/services/workspace/node/workspaceEditingService.ts b/src/vs/workbench/services/workspace/node/workspaceEditingService.ts index c3d3505300459..50839759ebde2 100644 --- a/src/vs/workbench/services/workspace/node/workspaceEditingService.ts +++ b/src/vs/workbench/services/workspace/node/workspaceEditingService.ts @@ -93,7 +93,7 @@ export class WorkspaceEditingService implements IWorkspaceEditingService { } addFolders(foldersToAdd: IWorkspaceFolderCreationData[], donotNotifyError: boolean = false): Promise { - return this.doAddFolders(foldersToAdd, void 0, donotNotifyError); + return this.doAddFolders(foldersToAdd, undefined, donotNotifyError); } private doAddFolders(foldersToAdd: IWorkspaceFolderCreationData[], index?: number, donotNotifyError: boolean = false): Promise { @@ -214,7 +214,7 @@ export class WorkspaceEditingService implements IWorkspaceEditingService { } return Promise.resolve(); - }).then(void 0, error => { + }).then(undefined, error => { if (!extensionHostStarted) { startExtensionHost(); // start the extension host if not started } @@ -233,7 +233,7 @@ export class WorkspaceEditingService implements IWorkspaceEditingService { return this.migrateWorkspaceSettings(toWorkspace); } - return void 0; + return undefined; }); } diff --git a/src/vs/workbench/test/browser/quickopen.test.ts b/src/vs/workbench/test/browser/quickopen.test.ts index 30b61a2633c88..1adbabeb09c92 100644 --- a/src/vs/workbench/test/browser/quickopen.test.ts +++ b/src/vs/workbench/test/browser/quickopen.test.ts @@ -71,7 +71,7 @@ suite('QuickOpen', () => { }); test('QuickOpen Action', () => { - let defaultAction = new QuickOpenAction('id', 'label', (void 0)!, new TestQuickOpenService((prefix: string) => assert(!prefix))); + let defaultAction = new QuickOpenAction('id', 'label', (undefined)!, new TestQuickOpenService((prefix: string) => assert(!prefix))); let prefixAction = new QuickOpenAction('id', 'label', ',', new TestQuickOpenService((prefix: string) => assert(!!prefix))); defaultAction.run(); diff --git a/src/vs/workbench/test/common/editor/dataUriEditorInput.test.ts b/src/vs/workbench/test/common/editor/dataUriEditorInput.test.ts index 0ea1a0f58edd6..ade72e9f942d1 100644 --- a/src/vs/workbench/test/common/editor/dataUriEditorInput.test.ts +++ b/src/vs/workbench/test/common/editor/dataUriEditorInput.test.ts @@ -20,7 +20,7 @@ suite('DataUriEditorInput', () => { test('simple', () => { const resource = URI.parse('data:image/png;label:SomeLabel;description:SomeDescription;size:1024;base64,77+9UE5'); - const input: DataUriEditorInput = instantiationService.createInstance(DataUriEditorInput, void 0, void 0, resource); + const input: DataUriEditorInput = instantiationService.createInstance(DataUriEditorInput, undefined, undefined, resource); assert.equal(input.getName(), 'SomeLabel'); assert.equal(input.getDescription(), 'SomeDescription'); diff --git a/src/vs/workbench/test/common/editor/editorGroups.test.ts b/src/vs/workbench/test/common/editor/editorGroups.test.ts index 8ddb989641f40..b173955c393a3 100644 --- a/src/vs/workbench/test/common/editor/editorGroups.test.ts +++ b/src/vs/workbench/test/common/editor/editorGroups.test.ts @@ -262,7 +262,7 @@ suite('Workbench editor groups', () => { assert.equal(index, 0); assert.equal(group.count, 0); assert.equal(group.getEditors(true).length, 0); - assert.equal(group.activeEditor, void 0); + assert.equal(group.activeEditor, undefined); assert.equal(events.closed[0].editor, input1); assert.equal(events.closed[0].index, 0); assert.equal(events.closed[0].replaced, false); @@ -285,7 +285,7 @@ suite('Workbench editor groups', () => { group.closeEditor(input2); assert.equal(group.count, 0); assert.equal(group.getEditors(true).length, 0); - assert.equal(group.activeEditor, void 0); + assert.equal(group.activeEditor, undefined); assert.equal(events.closed[1].editor, input2); assert.equal(events.closed[1].index, 0); assert.equal(events.closed[1].replaced, false); @@ -294,7 +294,7 @@ suite('Workbench editor groups', () => { assert.ok(typeof index !== 'number'); assert.equal(group.count, 0); assert.equal(group.getEditors(true).length, 0); - assert.equal(group.activeEditor, void 0); + assert.equal(group.activeEditor, undefined); assert.equal(events.closed[1].editor, input2); // Nonactive && Pinned => gets active because its first editor @@ -315,7 +315,7 @@ suite('Workbench editor groups', () => { group.closeEditor(input3); assert.equal(group.count, 0); assert.equal(group.getEditors(true).length, 0); - assert.equal(group.activeEditor, void 0); + assert.equal(group.activeEditor, undefined); assert.equal(events.closed[2].editor, input3); assert.equal(events.opened[2], input3); @@ -324,7 +324,7 @@ suite('Workbench editor groups', () => { group.closeEditor(input3); assert.equal(group.count, 0); assert.equal(group.getEditors(true).length, 0); - assert.equal(group.activeEditor, void 0); + assert.equal(group.activeEditor, undefined); assert.equal(events.closed[2].editor, input3); // Nonactive && Preview => gets active because its first editor @@ -345,7 +345,7 @@ suite('Workbench editor groups', () => { group.closeEditor(input4); assert.equal(group.count, 0); assert.equal(group.getEditors(true).length, 0); - assert.equal(group.activeEditor, void 0); + assert.equal(group.activeEditor, undefined); assert.equal(events.closed[3].editor, input4); }); @@ -420,7 +420,7 @@ suite('Workbench editor groups', () => { inst.stub(IConfigurationService, config); config.setUserConfiguration('workbench', { editor: { openPositioning: 'left' } }); - const group: EditorGroup = inst.createInstance(EditorGroup, void 0); + const group: EditorGroup = inst.createInstance(EditorGroup, undefined); const events = groupListener(group); @@ -1122,7 +1122,7 @@ suite('Workbench editor groups', () => { const input1Resource = URI.file('/hello/world.txt'); const input1ResourceUpper = URI.file('/hello/WORLD.txt'); - const input1 = input(void 0, false, input1Resource); + const input1 = input(undefined, false, input1Resource); group1.openEditor(input1); assert.ok(group1.contains(input1Resource)); @@ -1141,7 +1141,7 @@ suite('Workbench editor groups', () => { assert.equal(group2.getEditor(input1Resource), input1); const input1ResourceClone = URI.file('/hello/world.txt'); - const input1Clone = input(void 0, false, input1ResourceClone); + const input1Clone = input(undefined, false, input1ResourceClone); group1.openEditor(input1Clone); assert.ok(group1.contains(input1Resource)); diff --git a/src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts b/src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts index 6f1e04113c8e7..0b0da26473746 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts @@ -23,7 +23,7 @@ suite('ExtHostConfiguration', function () { lastArgs: [ConfigurationTarget, string, any]; $updateConfigurationOption(target: ConfigurationTarget, key: string, value: any): Promise { this.lastArgs = [target, key, value]; - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } diff --git a/src/vs/workbench/test/electron-browser/api/extHostDocumentSaveParticipant.test.ts b/src/vs/workbench/test/electron-browser/api/extHostDocumentSaveParticipant.test.ts index e631e129ef56f..a9a7b013354c8 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostDocumentSaveParticipant.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostDocumentSaveParticipant.test.ts @@ -213,7 +213,7 @@ suite('ExtHostDocumentSaveParticipant', () => { setTimeout(() => { try { assert.throws(() => event.waitUntil(timeout(10))); - resolve(void 0); + resolve(undefined); } catch (e) { reject(e); } diff --git a/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts b/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts index e403ec1ebe91f..ebe4694146a1f 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts @@ -25,7 +25,7 @@ const emptyCommandService: ICommandService = { _serviceBrand: undefined, onWillExecuteCommand: () => ({ dispose: () => { } }), executeCommand: (commandId: string, ...args: any[]): Promise => { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } }; diff --git a/src/vs/workbench/test/electron-browser/api/extHostTextEditor.test.ts b/src/vs/workbench/test/electron-browser/api/extHostTextEditor.test.ts index a8f269a3dad23..87f42a87e0206 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostTextEditor.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostTextEditor.test.ts @@ -70,7 +70,7 @@ suite('ExtHostTextEditorOptions', () => { $trySetOptions: (id: string, options: ITextEditorConfigurationUpdate) => { assert.equal(id, '1'); calls.push(options); - return Promise.resolve(void 0); + return Promise.resolve(undefined); }, $tryShowTextDocument: undefined!, $registerTextEditorDecorationType: undefined!, diff --git a/src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts b/src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts index ea19754849100..b2ac27c3bc88b 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts @@ -219,7 +219,7 @@ suite('ExtHostTreeView', function () { label: { label: 'b' }, collapsibleState: TreeItemCollapsibleState.Collapsed }); - c(void 0); + c(undefined); }); onDidChangeTreeNode.fire(getNode('b')); }); @@ -596,7 +596,7 @@ suite('ExtHostTreeView', function () { if (typeof obj === 'object') { const result = {}; for (const key of Object.keys(obj)) { - if (obj[key] !== void 0) { + if (obj[key] !== undefined) { result[key] = removeUnsetKeys(obj[key]); } } @@ -627,7 +627,7 @@ suite('ExtHostTreeView', function () { }, getParent: ({ key }: { key: string }): { key: string } => { const parentKey = key.substring(0, key.length - 1); - return parentKey ? new Key(parentKey) : void 0; + return parentKey ? new Key(parentKey) : undefined; }, onDidChangeTreeData: onDidChangeTreeNode.event }; diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadEditors.test.ts b/src/vs/workbench/test/electron-browser/api/mainThreadEditors.test.ts index 4ec159ed8f32a..f0e87f04c6941 100644 --- a/src/vs/workbench/test/electron-browser/api/mainThreadEditors.test.ts +++ b/src/vs/workbench/test/electron-browser/api/mainThreadEditors.test.ts @@ -54,15 +54,15 @@ suite('MainThreadEditors', () => { isDirty() { return false; } create(uri: URI, contents?: string, options?: any) { createdResources.add(uri); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } delete(resource: URI) { deletedResources.add(resource); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } move(source: URI, target: URI) { movedResources.set(source, target); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } models = { onModelSaved: Event.None, diff --git a/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts b/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts index 9b3374803baa6..53897a88dfae4 100644 --- a/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts +++ b/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts @@ -56,7 +56,7 @@ suite.skip('QuickOpen performance (integration)', () => { test('Measure', () => { if (process.env['VSCODE_PID']) { - return void 0; // TODO@Christoph find out why test fails when run from within VS Code + return undefined; // TODO@Christoph find out why test fails when run from within VS Code } const n = 3; @@ -166,7 +166,7 @@ class TestTelemetryService implements ITelemetryService { public publicLog(eventName: string, data?: any): Promise { this.events.push({ name: eventName, data: data }); - return Promise.resolve(void 0); + return Promise.resolve(undefined); } public getTelemetryInfo(): Promise { diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index 5c5404d6e1507..60c36782db400 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -81,7 +81,7 @@ import { isLinux, isMacintosh } from 'vs/base/common/platform'; import { CanonicalExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; export function createFileInput(instantiationService: IInstantiationService, resource: URI): FileEditorInput { - return instantiationService.createInstance(FileEditorInput, resource, void 0); + return instantiationService.createInstance(FileEditorInput, resource, undefined); } export const TestEnvironmentService = new EnvironmentService(parseArgs(process.argv), process.execPath); @@ -302,7 +302,7 @@ export class TestDecorationsService implements IDecorationsService { _serviceBrand: any; onDidChangeDecorations: Event = Event.None; registerDecorationsProvider(_provider: IDecorationsProvider): IDisposable { return Disposable.None; } - getDecoration(_uri: URI, _includeChildren: boolean, _overwrite?: IDecorationData): IDecoration { return void 0; } + getDecoration(_uri: URI, _includeChildren: boolean, _overwrite?: IDecorationData): IDecoration { return undefined; } } export class TestExtensionService implements IExtensionService { @@ -311,7 +311,7 @@ export class TestExtensionService implements IExtensionService { onDidChangeExtensionsStatus: Event = Event.None; onWillActivateByEvent: Event = Event.None; onDidChangeResponsiveChange: Event = Event.None; - activateByEvent(_activationEvent: string): Promise { return Promise.resolve(void 0); } + activateByEvent(_activationEvent: string): Promise { return Promise.resolve(undefined); } whenInstalledExtensionsRegistered(): Promise { return Promise.resolve(true); } getExtensions(): Promise { return Promise.resolve([]); } getExtension() { return Promise.resolve(undefined); } @@ -332,7 +332,7 @@ export class TestMenuService implements IMenuService { createMenu(_id: MenuId, _scopedKeybindingService: IContextKeyService): IMenu { return { onDidChange: Event.None, - dispose: () => void 0, + dispose: () => undefined, getActions: () => [] }; } @@ -375,7 +375,7 @@ export class TestHistoryService implements IHistoryService { } public getLastActiveFile(_schemeFilter: string): URI { - return void 0; + return undefined; } public openLastEditLocation(): void { @@ -400,13 +400,13 @@ export class TestFileDialogService implements IFileDialogService { public _serviceBrand: any; public defaultFilePath(_schemeFilter: string): URI { - return void 0; + return undefined; } public defaultFolderPath(_schemeFilter: string): URI { - return void 0; + return undefined; } public defaultWorkspacePath(_schemeFilter: string): URI { - return void 0; + return undefined; } public pickFileFolderAndOpen(_options: IPickAndOpenOptions): Promise { return Promise.resolve(0); @@ -518,7 +518,7 @@ export class TestPartService implements IPartService { public addClass(_clazz: string): void { } public removeClass(_clazz: string): void { } - public getWorkbenchElement(): HTMLElement { return void 0; } + public getWorkbenchElement(): HTMLElement { return undefined; } public toggleZenMode(): void { } @@ -542,7 +542,7 @@ export class TestEditorGroupsService implements EditorGroupsServiceImpl { onDidMoveGroup: Event = Event.None; orientation: any; - whenRestored: Promise = Promise.resolve(void 0); + whenRestored: Promise = Promise.resolve(undefined); get activeGroup(): IEditorGroup { return this.groups[0]; @@ -563,7 +563,7 @@ export class TestEditorGroupsService implements EditorGroupsServiceImpl { } } - return void 0; + return undefined; } getLabel(_identifier: number): string { @@ -613,7 +613,7 @@ export class TestEditorGroup implements IEditorGroupView { constructor(public id: number) { } - group: EditorGroup = void 0; + group: EditorGroup = undefined; activeControl: IEditor; activeEditor: IEditorInput; previewEditor: IEditorInput; @@ -621,7 +621,7 @@ export class TestEditorGroup implements IEditorGroupView { disposed: boolean; editors: ReadonlyArray = []; label: string; - whenRestored: Promise = Promise.resolve(void 0); + whenRestored: Promise = Promise.resolve(undefined); element: HTMLElement; minimumWidth: number; maximumWidth: number; @@ -724,7 +724,7 @@ export class TestEditorService implements EditorServiceImpl { visibleEditors: ReadonlyArray = []; overrideOpenEditor(_handler: IOpenEditorOverrideHandler): IDisposable { - return toDisposable(() => void 0); + return toDisposable(() => undefined); } openEditor(_editor: any, _options?: any, _group?: any) { @@ -740,11 +740,11 @@ export class TestEditorService implements EditorServiceImpl { } getOpened(_editor: IEditorInput | IResourceInput | IUntitledResourceInput): IEditorInput { - return void 0; + return undefined; } replaceEditors(_editors: any, _group: any) { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } invokeWithinEditorContext(fn: (accessor: ServicesAccessor) => T): T { @@ -926,7 +926,7 @@ export class TestBackupFileService implements IBackupFileService { return this.toBackupResource(resource); } - return void 0; + return undefined; }); } @@ -1117,11 +1117,11 @@ export class TestWindowService implements IWindowService { } showSaveDialog(_options: Electron.SaveDialogOptions): Promise { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } showOpenDialog(_options: Electron.OpenDialogOptions): Promise { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } updateTouchBar(_items: ISerializableCommandAction[][]): Promise { @@ -1129,7 +1129,7 @@ export class TestWindowService implements IWindowService { } resolveProxy(url: string): Promise { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -1394,7 +1394,7 @@ export class TestWindowsService implements IWindowsService { } resolveProxy(windowId: number, url: string): Promise { - return Promise.resolve(void 0); + return Promise.resolve(undefined); } } @@ -1411,7 +1411,7 @@ export class TestTextResourceConfigurationService implements ITextResourceConfig getValue(resource: URI, arg2?: any, arg3?: any): T { const position: IPosition = EditorPosition.isIPosition(arg2) ? arg2 : null; - const section: string = position ? (typeof arg3 === 'string' ? arg3 : void 0) : (typeof arg2 === 'string' ? arg2 : void 0); + const section: string = position ? (typeof arg3 === 'string' ? arg3 : undefined) : (typeof arg2 === 'string' ? arg2 : undefined); return this.configurationService.getValue(section, { resource }); } } diff --git a/test/assert.js b/test/assert.js index d588745a28bf7..85e2008597c45 100644 --- a/test/assert.js +++ b/test/assert.js @@ -79,7 +79,7 @@ var util = { return typeof arg === 'symbol'; }, isUndefined: function(arg) { - return arg === void 0; + return arg === undefined; }, isRegExp: function(re) { return util.isObject(re) && util.objectToString(re) === '[object RegExp]'; diff --git a/test/smoke/src/areas/editor/peek.ts b/test/smoke/src/areas/editor/peek.ts index d8b52a47d444c..be1dcfe5b7e7d 100644 --- a/test/smoke/src/areas/editor/peek.ts +++ b/test/smoke/src/areas/editor/peek.ts @@ -19,7 +19,7 @@ export class References { } async waitForReferencesCountInTitle(count: number): Promise { - await this.code.waitForTextContent(References.REFERENCES_TITLE_COUNT, void 0, titleCount => { + await this.code.waitForTextContent(References.REFERENCES_TITLE_COUNT, undefined, titleCount => { const matches = titleCount.match(/\d+/); return matches ? parseInt(matches[0]) === count : false; }); diff --git a/test/smoke/src/vscode/code.ts b/test/smoke/src/vscode/code.ts index 18b5a85dd51e2..03540524bffdf 100644 --- a/test/smoke/src/vscode/code.ts +++ b/test/smoke/src/vscode/code.ts @@ -232,7 +232,7 @@ export class Code { async waitForTextContent(selector: string, textContent?: string, accept?: (result: string) => boolean): Promise { const windowId = await this.getActiveWindowId(); - accept = accept || (result => textContent !== void 0 ? textContent === result : !!result); + accept = accept || (result => textContent !== undefined ? textContent === result : !!result); return await poll( () => this.driver.getElements(windowId, selector).then(els => els.length > 0 ? Promise.resolve(els[0].textContent) : Promise.reject(new Error('Element not found for textContent'))),