@codingame/monaco-vscode-api 1.79.1 → 1.79.2-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/dist/api.js +10 -8
- package/dist/composite.d.ts +65 -0
- package/dist/configurationRegistry.d.ts +212 -0
- package/dist/contextkey.d.ts +1 -1
- package/dist/default-extensions/json.js +1 -0
- package/dist/default-extensions/theme-defaults.js +2 -2
- package/dist/editorBrowser.d.ts +272 -3
- package/dist/event.d.ts +6 -1
- package/dist/{extension-tools-0c4c1ad7.js → extension-tools-3c2bf0a4.js} +698 -507
- package/dist/extensions.d.ts +3 -2
- package/dist/extensions.d2.ts +6 -17
- package/dist/extensionsRegistry.d.ts +15 -9
- package/dist/files.d.ts +71 -7
- package/dist/jsonSchema.d.ts +1 -1
- package/dist/keybinding.d.ts +2 -2
- package/dist/languageFeatures.d.ts +703 -61
- package/dist/monaco.d.ts +5 -4
- package/dist/override/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +2 -0
- package/dist/override/vs/workbench/contrib/notebook/browser/notebookEditor.js +2 -0
- package/dist/override/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +2 -0
- package/dist/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +2 -1
- package/dist/platform.d.ts +11 -0
- package/dist/rollup-extension-directory-plugin.js +1 -1
- package/dist/rollup-vsix-plugin.js +2 -2
- package/dist/service-override/configuration.d.ts +5 -206
- package/dist/service-override/dialogs.js +16 -1
- package/dist/service-override/files.d.ts +2 -2
- package/dist/service-override/files.js +1 -1
- package/dist/service-override/markers.d.ts +7 -0
- package/dist/service-override/markers.js +6 -0
- package/dist/service-override/output.d.ts +7 -0
- package/dist/service-override/output.js +22 -0
- package/dist/service-override/preferences.js +7 -1
- package/dist/service-override/quickaccess.js +0 -9
- package/dist/service-override/search.d.ts +7 -0
- package/dist/service-override/search.js +19 -0
- package/dist/service-override/terminal.d.ts +607 -0
- package/dist/service-override/terminal.js +98 -0
- package/dist/service-override/tools/editor.js +1 -1
- package/dist/service-override/views.d.ts +561 -335
- package/dist/service-override/views.js +51 -11
- package/dist/services.d.ts +2627 -108
- package/dist/services.js +3 -0
- package/dist/severity.d.ts +16 -0
- package/dist/uri.d.ts +22 -11
- package/dist/views.d.ts +270 -0
- package/dist/vscode/vs/base/common/processes.js +24 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/decorations.js +20 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/delegatingEditorImpl.js +106 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/diffEditorSash.js +59 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.contribution.js +41 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.js +369 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/diffModel.js +247 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/lineAlignment.js +179 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/overviewRulerPart.js +121 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/style.css.js +4 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/unchangedRanges.js +184 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/utils.js +88 -0
- package/dist/vscode/vs/platform/extensionManagement/common/extensionManagement.js +38 -1
- package/dist/vscode/vs/platform/extensionManagement/common/extensionManagementUtil.js +5 -1
- package/dist/vscode/vs/platform/extensionResourceLoader/common/extensionResourceLoader.js +13 -5
- package/dist/vscode/vs/platform/files/common/fileService.js +43 -5
- package/dist/vscode/vs/platform/files/common/files.js +3 -1
- package/dist/vscode/vs/platform/languagePacks/common/languagePacks.js +4 -1
- package/dist/vscode/vs/platform/log/common/bufferLog.js +34 -0
- package/dist/vscode/vs/platform/log/common/fileLog.js +105 -0
- package/dist/vscode/vs/platform/quickinput/browser/quickPickPin.js +1 -1
- package/dist/vscode/vs/platform/remote/common/remoteAuthorityResolver.js +20 -1
- package/dist/vscode/vs/platform/request/browser/requestService.js +1 -1
- package/dist/vscode/vs/platform/request/common/request.js +3 -3
- package/dist/vscode/vs/platform/storage/common/storage.js +3 -0
- package/dist/vscode/vs/platform/terminal/common/capabilities/bufferMarkCapability.js +39 -0
- package/dist/vscode/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +565 -0
- package/dist/vscode/vs/platform/terminal/common/capabilities/cwdDetectionCapability.js +27 -0
- package/dist/vscode/vs/platform/terminal/common/capabilities/naiveCwdDetectionCapability.js +22 -0
- package/dist/vscode/vs/platform/terminal/common/capabilities/partialCommandDetectionCapability.js +46 -0
- package/dist/vscode/vs/platform/terminal/common/capabilities/terminalCapabilityStore.js +80 -0
- package/dist/vscode/vs/platform/terminal/common/environmentVariable.js +7 -0
- package/dist/vscode/vs/platform/terminal/common/environmentVariableCollection.js +196 -0
- package/dist/vscode/vs/platform/terminal/common/environmentVariableShared.js +23 -0
- package/dist/vscode/vs/platform/terminal/common/terminal.js +21 -1
- package/dist/vscode/vs/platform/terminal/common/terminalDataBuffering.js +45 -0
- package/dist/vscode/vs/platform/terminal/common/terminalEnvironment.js +37 -0
- package/dist/vscode/vs/platform/terminal/common/terminalPlatformConfiguration.js +622 -0
- package/dist/vscode/vs/platform/terminal/common/terminalProfiles.js +107 -0
- package/dist/vscode/vs/platform/terminal/common/terminalRecorder.js +66 -0
- package/dist/vscode/vs/platform/terminal/common/terminalStrings.js +16 -0
- package/dist/vscode/vs/platform/terminal/common/xterm/shellIntegrationAddon.js +321 -0
- package/dist/vscode/vs/platform/userDataSync/common/settingsMerge.js +39 -1
- package/dist/vscode/vs/platform/userDataSync/common/userDataSync.js +19 -0
- package/dist/vscode/vs/platform/window/common/window.js +7 -1
- package/dist/vscode/vs/platform/workspace/common/canonicalUri.js +3 -0
- package/dist/vscode/vs/platform/workspace/common/virtualWorkspace.js +4 -1
- package/dist/vscode/vs/platform/workspaces/common/workspaces.js +2 -2
- package/dist/vscode/vs/workbench/api/browser/mainThreadCommands.js +2 -3
- package/dist/vscode/vs/workbench/api/browser/mainThreadEditorTabs.js +473 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadLanguageFeatures.js +45 -38
- package/dist/vscode/vs/workbench/api/browser/mainThreadSearch.js +146 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadStatusBar.js +33 -52
- package/dist/vscode/vs/workbench/api/browser/mainThreadTerminalService.js +395 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadTheming.js +22 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadTreeViews.js +10 -5
- package/dist/vscode/vs/workbench/api/browser/mainThreadWindow.js +11 -4
- package/dist/vscode/vs/workbench/api/browser/mainThreadWorkspace.js +34 -11
- package/dist/vscode/vs/workbench/api/browser/statusBarExtensionPoint.js +81 -0
- package/dist/vscode/vs/workbench/api/common/extHost.protocol.js +7 -2
- package/dist/vscode/vs/workbench/api/common/extHostDebugService.js +4 -13
- package/dist/vscode/vs/workbench/api/common/extHostExtensionService.js +30 -15
- package/dist/vscode/vs/workbench/api/common/extHostFileSystemConsumer.js +20 -6
- package/dist/vscode/vs/workbench/api/common/extHostLanguageFeatures.js +41 -8
- package/dist/vscode/vs/workbench/api/common/extHostManagedSockets.js +3 -0
- package/dist/vscode/vs/workbench/api/common/extHostSearch.js +109 -0
- package/dist/vscode/vs/workbench/api/common/extHostStatusBar.js +33 -6
- package/dist/vscode/vs/workbench/api/common/extHostTerminalService.js +879 -1
- package/dist/vscode/vs/workbench/api/common/extHostTheming.js +38 -0
- package/dist/vscode/vs/workbench/api/common/extHostTreeViews.js +8 -5
- package/dist/vscode/vs/workbench/api/common/extHostTypeConverters.js +15 -17
- package/dist/vscode/vs/workbench/api/common/extHostTypes.js +117 -4
- package/dist/vscode/vs/workbench/api/common/extHostWindow.js +28 -6
- package/dist/vscode/vs/workbench/api/common/extHostWorkspace.js +28 -0
- package/dist/vscode/vs/workbench/api/common/shared/dataTransferCache.js +11 -14
- package/dist/vscode/vs/workbench/api/node/extHostTerminalService.js +22 -0
- package/dist/vscode/vs/workbench/browser/actions/layoutActions.js +2 -1
- package/dist/vscode/vs/workbench/browser/actions/windowActions.js +2 -2
- package/dist/vscode/vs/workbench/browser/dnd.js +56 -2
- package/dist/vscode/vs/workbench/browser/parts/compositePart.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/dialogs/dialogHandler.js +2 -2
- package/dist/vscode/vs/workbench/browser/parts/editor/editor.contribution.js +1 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editor.js +1 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorCommands.js +9 -10
- package/dist/vscode/vs/workbench/browser/parts/editor/editorGroupView.js +15 -9
- package/dist/vscode/vs/workbench/browser/parts/editor/editorGroupWatermark.js +13 -17
- package/dist/vscode/vs/workbench/browser/parts/editor/editorStatus.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/editor/editorsObserver.js +2 -2
- package/dist/vscode/vs/workbench/browser/parts/editor/media/editorgroupview.css.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/editor/media/tabstitlecontrol.css.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/editor/noTabsTitleControl.js +3 -1
- package/dist/vscode/vs/workbench/browser/parts/editor/tabsTitleControl.js +60 -11
- package/dist/vscode/vs/workbench/browser/parts/editor/textDiffEditor.js +16 -10
- package/dist/vscode/vs/workbench/browser/parts/editor/textResourceEditor.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/statusbar/media/statusbarpart.css.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/views/checkbox.js +10 -0
- package/dist/vscode/vs/workbench/browser/parts/views/treeView.js +78 -14
- package/dist/vscode/vs/workbench/browser/parts/views/viewPaneContainer.js +1 -1
- package/dist/vscode/vs/workbench/browser/workbench.contribution.js +65 -6
- package/dist/vscode/vs/workbench/common/configuration.js +8 -1
- package/dist/vscode/vs/workbench/common/contextkeys.js +9 -1
- package/dist/vscode/vs/workbench/common/editor/editorGroupModel.js +5 -1
- package/dist/vscode/vs/workbench/common/editor/resourceEditorInput.js +6 -3
- package/dist/vscode/vs/workbench/common/editor/textResourceEditorInput.js +9 -6
- package/dist/vscode/vs/workbench/common/editor.js +1 -5
- package/dist/vscode/vs/workbench/common/resources.js +111 -34
- package/dist/vscode/vs/workbench/contrib/bulkEdit/browser/bulkEditService.js +1 -1
- package/dist/vscode/vs/workbench/contrib/bulkEdit/browser/bulkTextEdits.js +1 -1
- package/dist/vscode/vs/workbench/contrib/chat/browser/chat.js +3 -0
- package/dist/vscode/vs/workbench/contrib/chat/common/chatService.js +3 -0
- package/dist/vscode/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.js +6 -4
- package/dist/vscode/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.js +250 -0
- package/dist/vscode/vs/workbench/contrib/customEditor/browser/customEditorInput.js +290 -0
- package/dist/vscode/vs/workbench/contrib/customEditor/common/customEditor.js +3 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugActionViewItems.js +1 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugCommands.js +2 -1
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +20 -20
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugEditorActions.js +5 -3
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugEditorContribution.js +5 -2
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugHover.js +33 -6
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugSession.js +1 -1
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugTaskRunner.js +1 -1
- package/dist/vscode/vs/workbench/contrib/debug/browser/repl.js +3 -3
- package/dist/vscode/vs/workbench/contrib/debug/common/debugModel.js +29 -17
- package/dist/vscode/vs/workbench/contrib/debug/common/debugStorage.js +11 -10
- package/dist/vscode/vs/workbench/contrib/debug/common/debugger.js +10 -6
- package/dist/vscode/vs/workbench/contrib/extensions/browser/extensionsActions.js +2514 -0
- package/dist/vscode/vs/workbench/contrib/extensions/browser/extensionsIcons.js +82 -0
- package/dist/vscode/vs/workbench/contrib/extensions/browser/media/extensionActions.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/extensions/common/extensions.js +6 -1
- package/dist/vscode/vs/workbench/contrib/extensions/common/extensionsFileTemplate.js +16 -0
- package/dist/vscode/vs/workbench/contrib/files/browser/editors/fileEditorInput.js +2 -3
- package/dist/vscode/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +2 -0
- package/dist/vscode/vs/workbench/contrib/files/browser/explorerService.js +10 -6
- package/dist/vscode/vs/workbench/contrib/files/browser/explorerViewlet.js +3 -18
- package/dist/vscode/vs/workbench/contrib/files/browser/fileActions.contribution.js +37 -2
- package/dist/vscode/vs/workbench/contrib/files/browser/fileActions.js +65 -3
- package/dist/vscode/vs/workbench/contrib/files/browser/fileCommands.js +3 -3
- package/dist/vscode/vs/workbench/contrib/files/browser/fileConstants.js +3 -1
- package/dist/vscode/vs/workbench/contrib/files/browser/files.contribution.js +41 -6
- package/dist/vscode/vs/workbench/contrib/files/browser/files.js +1 -0
- package/dist/vscode/vs/workbench/contrib/files/browser/views/explorerView.js +3 -3
- package/dist/vscode/vs/workbench/contrib/files/browser/views/explorerViewer.js +6 -2
- package/dist/vscode/vs/workbench/contrib/files/common/explorerModel.js +16 -9
- package/dist/vscode/vs/workbench/contrib/files/common/files.js +1 -6
- package/dist/vscode/vs/workbench/contrib/interactive/browser/interactiveDocumentService.js +3 -0
- package/dist/vscode/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +200 -0
- package/dist/vscode/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js +3 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markers.contribution.js +586 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markersFilterOptions.js +75 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markersModel.js +201 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markersTable.js +451 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markersTreeViewer.js +670 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markersView.js +857 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markersViewActions.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markersViewActions.js +132 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/media/markers.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/messages.js +171 -0
- package/dist/vscode/vs/workbench/contrib/markers/common/markers.js +15 -1
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +135 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +421 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +5 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +55 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/editing.js +54 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +108 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +334 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +606 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +307 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/rangeUtils.js +36 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +165 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/telemetry.js +78 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/utils.js +68 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +2 -0
- package/dist/vscode/vs/workbench/contrib/notebook/browser/contrib/find/findFilters.js +70 -0
- package/dist/vscode/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +158 -0
- package/dist/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser.js +6 -1
- package/dist/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService.js +3 -0
- package/dist/vscode/vs/workbench/contrib/notebook/common/notebookCommon.js +16 -1
- package/dist/vscode/vs/workbench/contrib/notebook/common/notebookService.js +3 -0
- package/dist/vscode/vs/workbench/contrib/output/browser/logViewer.js +64 -0
- package/dist/vscode/vs/workbench/contrib/output/browser/output.contribution.js +378 -0
- package/dist/vscode/vs/workbench/contrib/output/browser/outputServices.js +39 -3
- package/dist/vscode/vs/workbench/contrib/output/browser/outputView.js +220 -0
- package/dist/vscode/vs/workbench/contrib/output/common/outputChannelModel.js +12 -3
- package/dist/vscode/vs/workbench/contrib/output/common/outputLinkComputer.js +129 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/keybindingWidgets.js +270 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/keybindingsEditor.js +1080 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/media/keybindings.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/media/keybindingsEditor.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/media/preferences.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/media/settingsEditor2.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/media/settingsWidgets.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/preferences.contribution.js +1154 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesActions.js +94 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesEditor.js +47 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesIcons.js +37 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesRenderers.js +731 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesSearch.js +271 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesWidgets.js +479 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsEditor2.js +1465 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsEditorSettingIndicators.js +506 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsLayout.js +296 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsSearchMenu.js +79 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsTree.js +1984 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsTreeModels.js +759 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsWidgets.js +1008 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/tocTree.js +196 -0
- package/dist/vscode/vs/workbench/contrib/preferences/common/preferences.js +68 -0
- package/dist/vscode/vs/workbench/contrib/preferences/common/preferencesContribution.js +157 -0
- package/dist/vscode/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry.js +67 -0
- package/dist/vscode/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +16 -16
- package/dist/vscode/vs/workbench/contrib/quickaccess/browser/quickAccess.contribution.js +1 -2
- package/dist/vscode/vs/workbench/contrib/remote/browser/remoteExplorer.js +23 -2
- package/dist/vscode/vs/workbench/contrib/remote/browser/tunnelView.js +5 -5
- package/dist/vscode/vs/workbench/contrib/search/browser/media/searchview.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/patternInputWidget.js +217 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/replace.js +3 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/replaceContributions.js +7 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/replaceService.js +222 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/search.contribution.js +54 -15
- package/dist/vscode/vs/workbench/contrib/search/browser/searchActionsBase.js +17 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchFindInput.js +41 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchIcons.js +35 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchMessage.js +58 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchModel.js +1842 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchNotebookHelpers.js +49 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchResultsView.js +379 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchView.js +1867 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchWidget.js +628 -0
- package/dist/vscode/vs/workbench/contrib/search/common/constants.js +30 -1
- package/dist/vscode/vs/workbench/contrib/search/common/search.js +9 -1
- package/dist/vscode/vs/workbench/contrib/search/common/searchHistoryService.js +42 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/constants.js +11 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/media/searchEditor.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.js +477 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditor.js +697 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditorActions.js +188 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditorInput.js +295 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditorModel.js +135 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditorSerialization.js +268 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/tabCompletion.js +2 -2
- package/dist/vscode/vs/workbench/contrib/tasks/common/taskService.js +16 -1
- package/dist/vscode/vs/workbench/contrib/terminal/browser/environmentVariableInfo.js +119 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/media/scrollbar.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/media/terminal.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/media/widgets.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/media/xterm.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminal.contribution.js +238 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminal.js +4 -1
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalActions.js +1930 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalCommands.js +22 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalConfigHelper.js +213 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalContextMenu.js +17 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalEditor.js +186 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalEditorInput.js +199 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalEditorService.js +239 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalExtensions.js +22 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalGroup.js +482 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalGroupService.js +372 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalIcon.js +60 -1
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalIcons.js +37 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalInstance.js +2123 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalInstanceService.js +79 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalMainContribution.js +82 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalMenus.js +850 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +142 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalProcessManager.js +618 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalProfileQuickpick.js +278 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalProfileResolverService.js +417 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalProfileService.js +213 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalQuickAccess.js +144 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalRunRecentQuickPick.js +267 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalService.js +1063 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalStatusList.js +108 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalTabbedView.js +417 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalTabsList.js +680 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalTooltip.js +72 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalUri.js +39 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalView.js +535 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/widgets/widgetManager.js +36 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.js +469 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.js +97 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/lineDataEventAddon.js +56 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.js +416 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/suggestAddon.js +390 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +587 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/environmentVariable.js +3 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/environmentVariableService.js +94 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/history.js +356 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/terminal.js +266 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/terminalColorRegistry.js +23 -16
- package/dist/vscode/vs/workbench/contrib/terminal/common/terminalConfiguration.js +965 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/terminalContextKey.js +157 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/terminalEnvironment.js +272 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/terminalExtensionPoints.js +27 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/terminalStrings.js +86 -0
- package/dist/vscode/vs/workbench/contrib/terminal/electron-sandbox/terminalProfileResolverService.js +46 -0
- package/dist/vscode/vs/workbench/contrib/terminalContrib/links/browser/links.js +3 -0
- package/dist/vscode/vs/workbench/contrib/terminalContrib/links/browser/terminalLinkProviderService.js +26 -0
- package/dist/vscode/vs/workbench/contrib/terminalContrib/quickFix/browser/quickFix.js +3 -0
- package/dist/vscode/vs/workbench/contrib/terminalContrib/quickFix/browser/terminalQuickFixService.js +143 -0
- package/dist/vscode/vs/workbench/contrib/webviewPanel/browser/webviewEditorInput.js +85 -0
- package/dist/vscode/vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService.js +52 -0
- package/dist/vscode/vs/workbench/services/actions/common/menusExtensionPoint.js +14 -6
- package/dist/vscode/vs/workbench/services/assignment/common/assignmentService.js +3 -0
- package/dist/vscode/vs/workbench/services/configuration/browser/configurationService.js +13 -13
- package/dist/vscode/vs/workbench/services/configuration/common/configuration.js +2 -1
- package/dist/vscode/vs/workbench/services/configuration/common/configurationEditing.js +2 -2
- package/dist/vscode/vs/workbench/services/configuration/common/jsonEditingService.js +2 -2
- package/dist/vscode/vs/workbench/services/dialogs/browser/abstractFileDialogService.js +302 -0
- package/dist/vscode/vs/workbench/services/dialogs/browser/simpleFileDialog.js +971 -0
- package/dist/vscode/vs/workbench/services/extensionManagement/common/extensionManagement.js +3 -2
- package/dist/vscode/vs/workbench/services/extensionRecommendations/common/extensionRecommendations.js +4 -0
- package/dist/vscode/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.js +2 -0
- package/dist/vscode/vs/workbench/services/extensions/common/extensionManifestPropertiesService.js +3 -0
- package/dist/vscode/vs/workbench/services/extensions/common/extensions.js +14 -2
- package/dist/vscode/vs/workbench/services/extensions/common/extensionsApiProposals.js +10 -1
- package/dist/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +70 -3
- package/dist/vscode/vs/workbench/services/hover/browser/hoverService.js +1 -1
- package/dist/vscode/vs/workbench/services/hover/browser/hoverWidget.js +2 -1
- package/dist/vscode/vs/workbench/services/hover/browser/media/hover.css.js +1 -1
- package/dist/vscode/vs/workbench/services/keybinding/common/keybindingEditing.js +275 -0
- package/dist/vscode/vs/workbench/services/localization/common/locale.js +3 -0
- package/dist/vscode/vs/workbench/services/log/common/logConstants.js +2 -0
- package/dist/vscode/vs/workbench/services/output/common/output.js +4 -1
- package/dist/vscode/vs/workbench/services/preferences/common/preferences.js +22 -1
- package/dist/vscode/vs/workbench/services/preferences/common/preferencesModels.js +6 -0
- package/dist/vscode/vs/workbench/services/preferences/common/preferencesValidation.js +37 -1
- package/dist/vscode/vs/workbench/services/remote/common/remoteAgentService.js +69 -0
- package/dist/vscode/vs/workbench/services/remote/common/remoteExplorerService.js +66 -27
- package/dist/vscode/vs/workbench/services/search/common/fileSearchManager.js +265 -0
- package/dist/vscode/vs/workbench/services/search/common/queryBuilder.js +6 -0
- package/dist/vscode/vs/workbench/services/search/common/replace.js +203 -0
- package/dist/vscode/vs/workbench/services/search/common/search.js +227 -1
- package/dist/vscode/vs/workbench/services/search/common/searchExtTypes.js +6 -0
- package/dist/vscode/vs/workbench/services/search/common/searchHelpers.js +72 -0
- package/dist/vscode/vs/workbench/services/search/common/searchService.js +355 -0
- package/dist/vscode/vs/workbench/services/search/common/textSearchManager.js +309 -0
- package/dist/vscode/vs/workbench/services/suggest/browser/media/suggest.css.js +4 -0
- package/dist/vscode/vs/workbench/services/suggest/browser/simpleCompletionItem.js +10 -0
- package/dist/vscode/vs/workbench/services/suggest/browser/simpleCompletionModel.js +98 -0
- package/dist/vscode/vs/workbench/services/suggest/browser/simpleSuggestWidget.js +399 -0
- package/dist/vscode/vs/workbench/services/suggest/browser/simpleSuggestWidgetRenderer.js +83 -0
- package/dist/vscode/vs/workbench/services/terminal/common/embedderTerminalService.js +3 -0
- package/dist/vscode/vs/workbench/services/textfile/browser/textFileService.js +1 -1
- package/dist/vscode/vs/workbench/services/textfile/common/textFileEditorModel.js +10 -3
- package/dist/vscode/vs/workbench/services/themes/browser/fileIconThemeData.js +3 -3
- package/dist/vscode/vs/workbench/services/themes/browser/productIconThemeData.js +3 -3
- package/dist/vscode/vs/workbench/services/themes/common/colorThemeData.js +3 -3
- package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorInput.js +6 -4
- package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorModel.js +3 -0
- package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorService.js +4 -0
- package/dist/vscode/vs/workbench/services/userActivity/common/userActivityRegistry.js +15 -0
- package/dist/vscode/vs/workbench/services/userActivity/common/userActivityService.js +37 -0
- package/dist/vscode/vs/workbench/services/userDataSync/common/userDataSync.js +7 -0
- package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyEditorService.js +40 -0
- package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyService.js +12 -0
- package/dist/vscode/vs/workbench/services/workspaces/common/canonicalUriService.js +19 -0
- package/dist/vscode-default-extensions/css/syntaxes/css.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/json/package.json.js +1 -1
- package/dist/vscode-default-extensions/json/syntaxes/JSONC.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/json/syntaxes/JSONL.tmLanguage.json.extensionResource.js +2 -0
- package/dist/vscode-default-extensions/latex/syntaxes/Bibtex.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/latex/syntaxes/LaTeX.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/latex/syntaxes/TeX.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/latex/syntaxes/cpp-grammar-bailout.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/latex/syntaxes/markdown-latex-combined.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/lua/syntaxes/lua.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/perl/package.json.js +1 -1
- package/dist/vscode-default-extensions/php/snippets/php.code-snippets.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/sql/language-configuration.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-abyss/themes/abyss-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-defaults/package.json.js +1 -1
- package/dist/vscode-default-extensions/theme-defaults/themes/dark_modern.json.extensionResource.js +2 -0
- package/dist/vscode-default-extensions/theme-defaults/themes/dark_vs.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-defaults/themes/hc_black.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-defaults/themes/hc_light.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-defaults/themes/light_modern.json.extensionResource.js +2 -0
- package/dist/vscode-default-extensions/theme-defaults/themes/light_vs.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-monokai/themes/monokai-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-quietlight/themes/quietlight-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-red/themes/Red-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-seti/icons/vs-seti-icon-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-solarized-light/themes/solarized-light-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/vb/language-configuration.json.extensionResource.js +1 -1
- package/dist/vscode-services/env.js +4 -2
- package/dist/vscode-services/extHost.js +32 -48
- package/dist/vscode-services/missing-services.js +407 -29
- package/dist/vscode-services/window.js +59 -65
- package/dist/vscode-services/workspace.js +19 -5
- package/dist/workers/outputLinkComputer.worker.d.ts +2 -0
- package/dist/workers/outputLinkComputer.worker.js +3 -0
- package/dist/workspace.d.ts +1 -1
- package/monaco-editor-treemending.patch +1305 -1184
- package/package.json +65 -19
- package/dist/activity.d.ts +0 -2802
- package/dist/collections.d.ts +0 -7
- package/dist/colorRegistry.d.ts +0 -710
- package/dist/vscode/vs/platform/product/common/product.js +0 -48
- package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/interactiveSessionFollowups.js +0 -30
- package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/interactiveSessionInputPart.js +0 -196
- package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/interactiveSessionListRenderer.js +0 -622
- package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/interactiveSessionOptions.js +0 -77
- package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/interactiveSessionWidget.js +0 -311
- package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/media/interactiveSession.css.js +0 -4
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionContextKeys.js +0 -56
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionModel.js +0 -305
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionService.js +0 -13
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionServiceImpl.js +0 -379
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionViewModel.js +0 -207
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionWidgetHistoryService.js +0 -3
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionWordCounter.js +0 -25
- package/dist/vscode-default-extensions/theme-defaults/themes/dark_plus_experimental.json.extensionResource.js +0 -2
- package/dist/vscode-default-extensions/theme-defaults/themes/light_plus_experimental.json.extensionResource.js +0 -2
|
@@ -0,0 +1,971 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
+
import * as resources from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
4
|
+
import * as objects from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
5
|
+
import { FileKind, IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
6
|
+
import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
|
|
7
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
8
|
+
import { isWindows } from 'monaco-editor/esm/vs/base/common/platform.js';
|
|
9
|
+
import { IFileDialogService } from 'monaco-editor/esm/vs/platform/dialogs/common/dialogs.js';
|
|
10
|
+
import { ILabelService } from 'monaco-editor/esm/vs/platform/label/common/label.js';
|
|
11
|
+
import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
|
|
12
|
+
import { INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
|
|
13
|
+
import { IModelService } from 'monaco-editor/esm/vs/editor/common/services/model.js';
|
|
14
|
+
import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js';
|
|
15
|
+
import { getIconClasses } from 'monaco-editor/esm/vs/editor/common/services/getIconClasses.js';
|
|
16
|
+
import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
17
|
+
import { IWorkbenchEnvironmentService } from '../../environment/common/environmentService.js';
|
|
18
|
+
import { IRemoteAgentService } from '../../remote/common/remoteAgentService.js';
|
|
19
|
+
import { IContextKeyService, RawContextKey } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
20
|
+
import { format, equalsIgnoreCase, startsWithIgnoreCase } from 'monaco-editor/esm/vs/base/common/strings.js';
|
|
21
|
+
import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
|
|
22
|
+
import { isValidBasename } from 'monaco-editor/esm/vs/base/common/extpath.js';
|
|
23
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
24
|
+
import { dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
25
|
+
import { createCancelablePromise } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
26
|
+
import { IEditorService } from '../../editor/common/editorService.js';
|
|
27
|
+
import { normalizeDriveLetter } from 'monaco-editor/esm/vs/base/common/labels.js';
|
|
28
|
+
import { IPathService } from '../../path/common/pathService.js';
|
|
29
|
+
import { IAccessibilityService } from 'monaco-editor/esm/vs/platform/accessibility/common/accessibility.js';
|
|
30
|
+
var OpenLocalFileCommand;
|
|
31
|
+
( (function(OpenLocalFileCommand) {
|
|
32
|
+
OpenLocalFileCommand.ID = 'workbench.action.files.openLocalFile';
|
|
33
|
+
OpenLocalFileCommand.LABEL = ( nls.localize('openLocalFile', "Open Local File..."));
|
|
34
|
+
function handler() {
|
|
35
|
+
return accessor => {
|
|
36
|
+
const dialogService = accessor.get(IFileDialogService);
|
|
37
|
+
return dialogService.pickFileAndOpen({ forceNewWindow: false, availableFileSystems: [Schemas.file] });
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
OpenLocalFileCommand.handler = handler;
|
|
41
|
+
})(OpenLocalFileCommand || (OpenLocalFileCommand = {})));
|
|
42
|
+
var SaveLocalFileCommand;
|
|
43
|
+
( (function(SaveLocalFileCommand) {
|
|
44
|
+
SaveLocalFileCommand.ID = 'workbench.action.files.saveLocalFile';
|
|
45
|
+
SaveLocalFileCommand.LABEL = ( nls.localize('saveLocalFile', "Save Local File..."));
|
|
46
|
+
function handler() {
|
|
47
|
+
return accessor => {
|
|
48
|
+
const editorService = accessor.get(IEditorService);
|
|
49
|
+
const activeEditorPane = editorService.activeEditorPane;
|
|
50
|
+
if (activeEditorPane) {
|
|
51
|
+
return editorService.save({ groupId: activeEditorPane.group.id, editor: activeEditorPane.input }, { saveAs: true, availableFileSystems: [Schemas.file], reason: 1 });
|
|
52
|
+
}
|
|
53
|
+
return Promise.resolve(undefined);
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
SaveLocalFileCommand.handler = handler;
|
|
57
|
+
})(SaveLocalFileCommand || (SaveLocalFileCommand = {})));
|
|
58
|
+
var OpenLocalFolderCommand;
|
|
59
|
+
( (function(OpenLocalFolderCommand) {
|
|
60
|
+
OpenLocalFolderCommand.ID = 'workbench.action.files.openLocalFolder';
|
|
61
|
+
OpenLocalFolderCommand.LABEL = ( nls.localize('openLocalFolder', "Open Local Folder..."));
|
|
62
|
+
function handler() {
|
|
63
|
+
return accessor => {
|
|
64
|
+
const dialogService = accessor.get(IFileDialogService);
|
|
65
|
+
return dialogService.pickFolderAndOpen({ forceNewWindow: false, availableFileSystems: [Schemas.file] });
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
OpenLocalFolderCommand.handler = handler;
|
|
69
|
+
})(OpenLocalFolderCommand || (OpenLocalFolderCommand = {})));
|
|
70
|
+
var OpenLocalFileFolderCommand;
|
|
71
|
+
( (function(OpenLocalFileFolderCommand) {
|
|
72
|
+
OpenLocalFileFolderCommand.ID = 'workbench.action.files.openLocalFileFolder';
|
|
73
|
+
OpenLocalFileFolderCommand.LABEL = ( nls.localize('openLocalFileFolder', "Open Local..."));
|
|
74
|
+
function handler() {
|
|
75
|
+
return accessor => {
|
|
76
|
+
const dialogService = accessor.get(IFileDialogService);
|
|
77
|
+
return dialogService.pickFileFolderAndOpen({ forceNewWindow: false, availableFileSystems: [Schemas.file] });
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
OpenLocalFileFolderCommand.handler = handler;
|
|
81
|
+
})(OpenLocalFileFolderCommand || (OpenLocalFileFolderCommand = {})));
|
|
82
|
+
var UpdateResult;
|
|
83
|
+
( (function(UpdateResult) {
|
|
84
|
+
UpdateResult[UpdateResult["Updated"] = 0] = "Updated";
|
|
85
|
+
UpdateResult[UpdateResult["UpdatedWithTrailing"] = 1] = "UpdatedWithTrailing";
|
|
86
|
+
UpdateResult[UpdateResult["Updating"] = 2] = "Updating";
|
|
87
|
+
UpdateResult[UpdateResult["NotUpdated"] = 3] = "NotUpdated";
|
|
88
|
+
UpdateResult[UpdateResult["InvalidPath"] = 4] = "InvalidPath";
|
|
89
|
+
})(UpdateResult || (UpdateResult = {})));
|
|
90
|
+
const RemoteFileDialogContext = ( new RawContextKey('remoteFileDialogVisible', false));
|
|
91
|
+
let SimpleFileDialog = class SimpleFileDialog {
|
|
92
|
+
constructor(fileService, quickInputService, labelService, workspaceContextService, notificationService, fileDialogService, modelService, languageService, environmentService, remoteAgentService, pathService, keybindingService, contextKeyService, accessibilityService) {
|
|
93
|
+
this.fileService = fileService;
|
|
94
|
+
this.quickInputService = quickInputService;
|
|
95
|
+
this.labelService = labelService;
|
|
96
|
+
this.workspaceContextService = workspaceContextService;
|
|
97
|
+
this.notificationService = notificationService;
|
|
98
|
+
this.fileDialogService = fileDialogService;
|
|
99
|
+
this.modelService = modelService;
|
|
100
|
+
this.languageService = languageService;
|
|
101
|
+
this.environmentService = environmentService;
|
|
102
|
+
this.remoteAgentService = remoteAgentService;
|
|
103
|
+
this.pathService = pathService;
|
|
104
|
+
this.keybindingService = keybindingService;
|
|
105
|
+
this.accessibilityService = accessibilityService;
|
|
106
|
+
this.hidden = false;
|
|
107
|
+
this.allowFileSelection = true;
|
|
108
|
+
this.allowFolderSelection = false;
|
|
109
|
+
this.requiresTrailing = false;
|
|
110
|
+
this.userEnteredPathSegment = '';
|
|
111
|
+
this.autoCompletePathSegment = '';
|
|
112
|
+
this.isWindows = false;
|
|
113
|
+
this.separator = '/';
|
|
114
|
+
this.onBusyChangeEmitter = ( new Emitter());
|
|
115
|
+
this.disposables = [
|
|
116
|
+
this.onBusyChangeEmitter
|
|
117
|
+
];
|
|
118
|
+
this.remoteAuthority = this.environmentService.remoteAuthority;
|
|
119
|
+
this.contextKey = RemoteFileDialogContext.bindTo(contextKeyService);
|
|
120
|
+
this.scheme = this.pathService.defaultUriScheme;
|
|
121
|
+
}
|
|
122
|
+
set busy(busy) {
|
|
123
|
+
if (this.filePickBox.busy !== busy) {
|
|
124
|
+
this.filePickBox.busy = busy;
|
|
125
|
+
this.onBusyChangeEmitter.fire(busy);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
get busy() {
|
|
129
|
+
return this.filePickBox.busy;
|
|
130
|
+
}
|
|
131
|
+
async showOpenDialog(options = {}) {
|
|
132
|
+
this.scheme = this.getScheme(options.availableFileSystems, options.defaultUri);
|
|
133
|
+
this.userHome = await this.getUserHome();
|
|
134
|
+
const newOptions = this.getOptions(options);
|
|
135
|
+
if (!newOptions) {
|
|
136
|
+
return Promise.resolve(undefined);
|
|
137
|
+
}
|
|
138
|
+
this.options = newOptions;
|
|
139
|
+
return this.pickResource();
|
|
140
|
+
}
|
|
141
|
+
async showSaveDialog(options) {
|
|
142
|
+
this.scheme = this.getScheme(options.availableFileSystems, options.defaultUri);
|
|
143
|
+
this.userHome = await this.getUserHome();
|
|
144
|
+
this.requiresTrailing = true;
|
|
145
|
+
const newOptions = this.getOptions(options, true);
|
|
146
|
+
if (!newOptions) {
|
|
147
|
+
return Promise.resolve(undefined);
|
|
148
|
+
}
|
|
149
|
+
this.options = newOptions;
|
|
150
|
+
this.options.canSelectFolders = true;
|
|
151
|
+
this.options.canSelectFiles = true;
|
|
152
|
+
return ( new Promise((resolve) => {
|
|
153
|
+
this.pickResource(true).then(folderUri => {
|
|
154
|
+
resolve(folderUri);
|
|
155
|
+
});
|
|
156
|
+
}));
|
|
157
|
+
}
|
|
158
|
+
getOptions(options, isSave = false) {
|
|
159
|
+
let defaultUri = undefined;
|
|
160
|
+
let filename = undefined;
|
|
161
|
+
if (options.defaultUri) {
|
|
162
|
+
defaultUri = (this.scheme === options.defaultUri.scheme) ? options.defaultUri : undefined;
|
|
163
|
+
filename = isSave ? resources.basename(options.defaultUri) : undefined;
|
|
164
|
+
}
|
|
165
|
+
if (!defaultUri) {
|
|
166
|
+
defaultUri = this.userHome;
|
|
167
|
+
if (filename) {
|
|
168
|
+
defaultUri = resources.joinPath(defaultUri, filename);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if ((this.scheme !== Schemas.file) && !this.fileService.hasProvider(defaultUri)) {
|
|
172
|
+
this.notificationService.info(( nls.localize(
|
|
173
|
+
'remoteFileDialog.notConnectedToRemote',
|
|
174
|
+
'File system provider for {0} is not available.',
|
|
175
|
+
( defaultUri.toString())
|
|
176
|
+
)));
|
|
177
|
+
return undefined;
|
|
178
|
+
}
|
|
179
|
+
const newOptions = objects.deepClone(options);
|
|
180
|
+
newOptions.defaultUri = defaultUri;
|
|
181
|
+
return newOptions;
|
|
182
|
+
}
|
|
183
|
+
remoteUriFrom(path, hintUri) {
|
|
184
|
+
if (!path.startsWith('\\\\')) {
|
|
185
|
+
path = path.replace(/\\/g, '/');
|
|
186
|
+
}
|
|
187
|
+
const uri = this.scheme === Schemas.file ? URI.file(path) : ( URI.from(
|
|
188
|
+
{ scheme: this.scheme, path, query: hintUri?.query, fragment: hintUri?.fragment }
|
|
189
|
+
));
|
|
190
|
+
const authority = (uri.scheme === Schemas.file) ? undefined : (this.remoteAuthority ?? hintUri?.authority);
|
|
191
|
+
return resources.toLocalResource(uri, authority,
|
|
192
|
+
authority ? this.pathService.defaultUriScheme : uri.scheme);
|
|
193
|
+
}
|
|
194
|
+
getScheme(available, defaultUri) {
|
|
195
|
+
if (available && available.length > 0) {
|
|
196
|
+
if (defaultUri && (available.indexOf(defaultUri.scheme) >= 0)) {
|
|
197
|
+
return defaultUri.scheme;
|
|
198
|
+
}
|
|
199
|
+
return available[0];
|
|
200
|
+
}
|
|
201
|
+
else if (defaultUri) {
|
|
202
|
+
return defaultUri.scheme;
|
|
203
|
+
}
|
|
204
|
+
return Schemas.file;
|
|
205
|
+
}
|
|
206
|
+
async getRemoteAgentEnvironment() {
|
|
207
|
+
if (this.remoteAgentEnvironment === undefined) {
|
|
208
|
+
this.remoteAgentEnvironment = await this.remoteAgentService.getEnvironment();
|
|
209
|
+
}
|
|
210
|
+
return this.remoteAgentEnvironment;
|
|
211
|
+
}
|
|
212
|
+
getUserHome() {
|
|
213
|
+
return this.pathService.userHome({ preferLocal: this.scheme === Schemas.file });
|
|
214
|
+
}
|
|
215
|
+
async pickResource(isSave = false) {
|
|
216
|
+
this.allowFolderSelection = !!this.options.canSelectFolders;
|
|
217
|
+
this.allowFileSelection = !!this.options.canSelectFiles;
|
|
218
|
+
this.separator = this.labelService.getSeparator(this.scheme, this.remoteAuthority);
|
|
219
|
+
this.hidden = false;
|
|
220
|
+
this.isWindows = await this.checkIsWindowsOS();
|
|
221
|
+
let homedir = this.options.defaultUri ? this.options.defaultUri : this.workspaceContextService.getWorkspace().folders[0].uri;
|
|
222
|
+
let stat;
|
|
223
|
+
const ext = resources.extname(homedir);
|
|
224
|
+
if (this.options.defaultUri) {
|
|
225
|
+
try {
|
|
226
|
+
stat = await this.fileService.stat(this.options.defaultUri);
|
|
227
|
+
}
|
|
228
|
+
catch (e) {
|
|
229
|
+
}
|
|
230
|
+
if (!stat || !stat.isDirectory) {
|
|
231
|
+
homedir = resources.dirname(this.options.defaultUri);
|
|
232
|
+
this.trailing = resources.basename(this.options.defaultUri);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return ( new Promise((resolve) => {
|
|
236
|
+
this.filePickBox = this.quickInputService.createQuickPick();
|
|
237
|
+
this.busy = true;
|
|
238
|
+
this.filePickBox.matchOnLabel = false;
|
|
239
|
+
this.filePickBox.sortByLabel = false;
|
|
240
|
+
this.filePickBox.autoFocusOnList = false;
|
|
241
|
+
this.filePickBox.ignoreFocusOut = true;
|
|
242
|
+
this.filePickBox.ok = true;
|
|
243
|
+
if ((this.scheme !== Schemas.file) && this.options && this.options.availableFileSystems && (this.options.availableFileSystems.length > 1) && (this.options.availableFileSystems.indexOf(Schemas.file) > -1)) {
|
|
244
|
+
this.filePickBox.customButton = true;
|
|
245
|
+
this.filePickBox.customLabel = ( nls.localize('remoteFileDialog.local', 'Show Local'));
|
|
246
|
+
let action;
|
|
247
|
+
if (isSave) {
|
|
248
|
+
action = SaveLocalFileCommand;
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
action = this.allowFileSelection ? (this.allowFolderSelection ? OpenLocalFileFolderCommand : OpenLocalFileCommand) : OpenLocalFolderCommand;
|
|
252
|
+
}
|
|
253
|
+
const keybinding = this.keybindingService.lookupKeybinding(action.ID);
|
|
254
|
+
if (keybinding) {
|
|
255
|
+
const label = keybinding.getLabel();
|
|
256
|
+
if (label) {
|
|
257
|
+
this.filePickBox.customHover = format('{0} ({1})', action.LABEL, label);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
let isResolving = 0;
|
|
262
|
+
let isAcceptHandled = false;
|
|
263
|
+
this.currentFolder = resources.dirname(homedir);
|
|
264
|
+
this.userEnteredPathSegment = '';
|
|
265
|
+
this.autoCompletePathSegment = '';
|
|
266
|
+
this.filePickBox.title = this.options.title;
|
|
267
|
+
this.filePickBox.value = this.pathFromUri(this.currentFolder, true);
|
|
268
|
+
this.filePickBox.valueSelection = [this.filePickBox.value.length, this.filePickBox.value.length];
|
|
269
|
+
this.filePickBox.items = [];
|
|
270
|
+
function doResolve(dialog, uri) {
|
|
271
|
+
if (uri) {
|
|
272
|
+
uri = resources.addTrailingPathSeparator(uri, dialog.separator);
|
|
273
|
+
uri = resources.removeTrailingPathSeparator(uri);
|
|
274
|
+
}
|
|
275
|
+
resolve(uri);
|
|
276
|
+
dialog.contextKey.set(false);
|
|
277
|
+
dialog.filePickBox.dispose();
|
|
278
|
+
dispose(dialog.disposables);
|
|
279
|
+
}
|
|
280
|
+
this.filePickBox.onDidCustom(() => {
|
|
281
|
+
if (isAcceptHandled || this.busy) {
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
isAcceptHandled = true;
|
|
285
|
+
isResolving++;
|
|
286
|
+
if (this.options.availableFileSystems && (this.options.availableFileSystems.length > 1)) {
|
|
287
|
+
this.options.availableFileSystems = this.options.availableFileSystems.slice(1);
|
|
288
|
+
}
|
|
289
|
+
this.filePickBox.hide();
|
|
290
|
+
if (isSave) {
|
|
291
|
+
return this.fileDialogService.showSaveDialog(this.options).then(result => {
|
|
292
|
+
doResolve(this, result);
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
return this.fileDialogService.showOpenDialog(this.options).then(result => {
|
|
297
|
+
doResolve(this, result ? result[0] : undefined);
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
function handleAccept(dialog) {
|
|
302
|
+
if (dialog.busy) {
|
|
303
|
+
dialog.onBusyChangeEmitter.event((busy) => {
|
|
304
|
+
if (!busy) {
|
|
305
|
+
handleAccept(dialog);
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
else if (isAcceptHandled) {
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
isAcceptHandled = true;
|
|
314
|
+
isResolving++;
|
|
315
|
+
dialog.onDidAccept().then(resolveValue => {
|
|
316
|
+
if (resolveValue) {
|
|
317
|
+
dialog.filePickBox.hide();
|
|
318
|
+
doResolve(dialog, resolveValue);
|
|
319
|
+
}
|
|
320
|
+
else if (dialog.hidden) {
|
|
321
|
+
doResolve(dialog, undefined);
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
isResolving--;
|
|
325
|
+
isAcceptHandled = false;
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
this.filePickBox.onDidAccept(_ => {
|
|
330
|
+
handleAccept(this);
|
|
331
|
+
});
|
|
332
|
+
this.filePickBox.onDidChangeActive(i => {
|
|
333
|
+
isAcceptHandled = false;
|
|
334
|
+
if ((i.length === 1) && this.isSelectionChangeFromUser()) {
|
|
335
|
+
this.filePickBox.validationMessage = undefined;
|
|
336
|
+
const userPath = this.constructFullUserPath();
|
|
337
|
+
if (!equalsIgnoreCase(this.filePickBox.value.substring(0, userPath.length), userPath)) {
|
|
338
|
+
this.filePickBox.valueSelection = [0, this.filePickBox.value.length];
|
|
339
|
+
this.insertText(userPath, userPath);
|
|
340
|
+
}
|
|
341
|
+
this.setAutoComplete(userPath, this.userEnteredPathSegment, i[0], true);
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
this.filePickBox.onDidChangeValue(async (value) => {
|
|
345
|
+
return this.handleValueChange(value);
|
|
346
|
+
});
|
|
347
|
+
this.filePickBox.onDidHide(() => {
|
|
348
|
+
this.hidden = true;
|
|
349
|
+
if (isResolving === 0) {
|
|
350
|
+
doResolve(this, undefined);
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
this.filePickBox.show();
|
|
354
|
+
this.contextKey.set(true);
|
|
355
|
+
this.updateItems(homedir, true, this.trailing).then(() => {
|
|
356
|
+
if (this.trailing) {
|
|
357
|
+
this.filePickBox.valueSelection = [this.filePickBox.value.length - this.trailing.length, this.filePickBox.value.length - ext.length];
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
this.filePickBox.valueSelection = [this.filePickBox.value.length, this.filePickBox.value.length];
|
|
361
|
+
}
|
|
362
|
+
this.busy = false;
|
|
363
|
+
});
|
|
364
|
+
}));
|
|
365
|
+
}
|
|
366
|
+
async handleValueChange(value) {
|
|
367
|
+
try {
|
|
368
|
+
if (this.isValueChangeFromUser()) {
|
|
369
|
+
if (!equalsIgnoreCase(value, this.constructFullUserPath()) && !this.isBadSubpath(value)) {
|
|
370
|
+
this.filePickBox.validationMessage = undefined;
|
|
371
|
+
const filePickBoxUri = this.filePickBoxValue();
|
|
372
|
+
let updated = UpdateResult.NotUpdated;
|
|
373
|
+
if (!resources.extUriIgnorePathCase.isEqual(this.currentFolder, filePickBoxUri)) {
|
|
374
|
+
updated = await this.tryUpdateItems(value, filePickBoxUri);
|
|
375
|
+
}
|
|
376
|
+
if ((updated === UpdateResult.NotUpdated) || (updated === UpdateResult.UpdatedWithTrailing)) {
|
|
377
|
+
this.setActiveItems(value);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
this.filePickBox.activeItems = [];
|
|
382
|
+
this.userEnteredPathSegment = '';
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
catch {
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
isBadSubpath(value) {
|
|
390
|
+
return this.badPath && (value.length > this.badPath.length) && equalsIgnoreCase(value.substring(0, this.badPath.length), this.badPath);
|
|
391
|
+
}
|
|
392
|
+
isValueChangeFromUser() {
|
|
393
|
+
if (equalsIgnoreCase(this.filePickBox.value, this.pathAppend(this.currentFolder, this.userEnteredPathSegment + this.autoCompletePathSegment))) {
|
|
394
|
+
return false;
|
|
395
|
+
}
|
|
396
|
+
return true;
|
|
397
|
+
}
|
|
398
|
+
isSelectionChangeFromUser() {
|
|
399
|
+
if (this.activeItem === (this.filePickBox.activeItems ? this.filePickBox.activeItems[0] : undefined)) {
|
|
400
|
+
return false;
|
|
401
|
+
}
|
|
402
|
+
return true;
|
|
403
|
+
}
|
|
404
|
+
constructFullUserPath() {
|
|
405
|
+
const currentFolderPath = this.pathFromUri(this.currentFolder);
|
|
406
|
+
if (equalsIgnoreCase(this.filePickBox.value.substr(0, this.userEnteredPathSegment.length), this.userEnteredPathSegment)) {
|
|
407
|
+
if (equalsIgnoreCase(this.filePickBox.value.substr(0, currentFolderPath.length), currentFolderPath)) {
|
|
408
|
+
return currentFolderPath;
|
|
409
|
+
}
|
|
410
|
+
else {
|
|
411
|
+
return this.userEnteredPathSegment;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
else {
|
|
415
|
+
return this.pathAppend(this.currentFolder, this.userEnteredPathSegment);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
filePickBoxValue() {
|
|
419
|
+
const directUri = this.remoteUriFrom(this.filePickBox.value.trimRight(), this.currentFolder);
|
|
420
|
+
const currentPath = this.pathFromUri(this.currentFolder);
|
|
421
|
+
if (equalsIgnoreCase(this.filePickBox.value, currentPath)) {
|
|
422
|
+
return this.currentFolder;
|
|
423
|
+
}
|
|
424
|
+
const currentDisplayUri = this.remoteUriFrom(currentPath, this.currentFolder);
|
|
425
|
+
const relativePath = resources.relativePath(currentDisplayUri, directUri);
|
|
426
|
+
const isSameRoot = (this.filePickBox.value.length > 1 && currentPath.length > 1) ? equalsIgnoreCase(this.filePickBox.value.substr(0, 2), currentPath.substr(0, 2)) : false;
|
|
427
|
+
if (relativePath && isSameRoot) {
|
|
428
|
+
let path = resources.joinPath(this.currentFolder, relativePath);
|
|
429
|
+
const directBasename = resources.basename(directUri);
|
|
430
|
+
if ((directBasename === '.') || (directBasename === '..')) {
|
|
431
|
+
path = this.remoteUriFrom(this.pathAppend(path, directBasename), this.currentFolder);
|
|
432
|
+
}
|
|
433
|
+
return resources.hasTrailingPathSeparator(directUri) ? resources.addTrailingPathSeparator(path) : path;
|
|
434
|
+
}
|
|
435
|
+
else {
|
|
436
|
+
return directUri;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
async onDidAccept() {
|
|
440
|
+
this.busy = true;
|
|
441
|
+
if (this.filePickBox.activeItems.length === 1) {
|
|
442
|
+
const item = this.filePickBox.selectedItems[0];
|
|
443
|
+
if (item.isFolder) {
|
|
444
|
+
if (this.trailing) {
|
|
445
|
+
await this.updateItems(item.uri, true, this.trailing);
|
|
446
|
+
}
|
|
447
|
+
else {
|
|
448
|
+
const newPath = this.pathFromUri(item.uri);
|
|
449
|
+
if (startsWithIgnoreCase(newPath, this.filePickBox.value) && (equalsIgnoreCase(item.label, resources.basename(item.uri)))) {
|
|
450
|
+
this.filePickBox.valueSelection = [this.pathFromUri(this.currentFolder).length, this.filePickBox.value.length];
|
|
451
|
+
this.insertText(newPath, this.basenameWithTrailingSlash(item.uri));
|
|
452
|
+
}
|
|
453
|
+
else if ((item.label === '..') && startsWithIgnoreCase(this.filePickBox.value, newPath)) {
|
|
454
|
+
this.filePickBox.valueSelection = [newPath.length, this.filePickBox.value.length];
|
|
455
|
+
this.insertText(newPath, '');
|
|
456
|
+
}
|
|
457
|
+
else {
|
|
458
|
+
await this.updateItems(item.uri, true);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
this.filePickBox.busy = false;
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
else {
|
|
466
|
+
if ((await this.tryUpdateItems(this.filePickBox.value, this.filePickBoxValue())) !== UpdateResult.NotUpdated) {
|
|
467
|
+
this.filePickBox.busy = false;
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
let resolveValue;
|
|
472
|
+
if (this.filePickBox.activeItems.length === 0) {
|
|
473
|
+
resolveValue = this.filePickBoxValue();
|
|
474
|
+
}
|
|
475
|
+
else if (this.filePickBox.activeItems.length === 1) {
|
|
476
|
+
resolveValue = this.filePickBox.selectedItems[0].uri;
|
|
477
|
+
}
|
|
478
|
+
if (resolveValue) {
|
|
479
|
+
resolveValue = this.addPostfix(resolveValue);
|
|
480
|
+
}
|
|
481
|
+
if (await this.validate(resolveValue)) {
|
|
482
|
+
this.busy = false;
|
|
483
|
+
return resolveValue;
|
|
484
|
+
}
|
|
485
|
+
this.busy = false;
|
|
486
|
+
return undefined;
|
|
487
|
+
}
|
|
488
|
+
root(value) {
|
|
489
|
+
let lastDir = value;
|
|
490
|
+
let dir = resources.dirname(value);
|
|
491
|
+
while (!resources.isEqual(lastDir, dir)) {
|
|
492
|
+
lastDir = dir;
|
|
493
|
+
dir = resources.dirname(dir);
|
|
494
|
+
}
|
|
495
|
+
return dir;
|
|
496
|
+
}
|
|
497
|
+
tildaReplace(value) {
|
|
498
|
+
const home = this.userHome;
|
|
499
|
+
if ((value.length > 0) && (value[0] === '~')) {
|
|
500
|
+
return resources.joinPath(home, value.substring(1));
|
|
501
|
+
}
|
|
502
|
+
return this.remoteUriFrom(value);
|
|
503
|
+
}
|
|
504
|
+
tryAddTrailingSeparatorToDirectory(uri, stat) {
|
|
505
|
+
if (stat.isDirectory) {
|
|
506
|
+
if (!this.endsWithSlash(uri.path)) {
|
|
507
|
+
return resources.addTrailingPathSeparator(uri);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
return uri;
|
|
511
|
+
}
|
|
512
|
+
async tryUpdateItems(value, valueUri) {
|
|
513
|
+
if ((value.length > 0) && (value[0] === '~')) {
|
|
514
|
+
const newDir = this.tildaReplace(value);
|
|
515
|
+
return (await this.updateItems(newDir, true)) ? UpdateResult.UpdatedWithTrailing : UpdateResult.Updated;
|
|
516
|
+
}
|
|
517
|
+
else if (value === '\\') {
|
|
518
|
+
valueUri = this.root(this.currentFolder);
|
|
519
|
+
value = this.pathFromUri(valueUri);
|
|
520
|
+
return (await this.updateItems(valueUri, true)) ? UpdateResult.UpdatedWithTrailing : UpdateResult.Updated;
|
|
521
|
+
}
|
|
522
|
+
else if (!resources.extUriIgnorePathCase.isEqual(this.currentFolder, valueUri) && (this.endsWithSlash(value) || (!resources.extUriIgnorePathCase.isEqual(this.currentFolder, resources.dirname(valueUri)) && resources.extUriIgnorePathCase.isEqualOrParent(this.currentFolder, resources.dirname(valueUri))))) {
|
|
523
|
+
let stat;
|
|
524
|
+
try {
|
|
525
|
+
stat = await this.fileService.stat(valueUri);
|
|
526
|
+
}
|
|
527
|
+
catch (e) {
|
|
528
|
+
}
|
|
529
|
+
if (stat && stat.isDirectory && (resources.basename(valueUri) !== '.') && this.endsWithSlash(value)) {
|
|
530
|
+
valueUri = this.tryAddTrailingSeparatorToDirectory(valueUri, stat);
|
|
531
|
+
return (await this.updateItems(valueUri)) ? UpdateResult.UpdatedWithTrailing : UpdateResult.Updated;
|
|
532
|
+
}
|
|
533
|
+
else if (this.endsWithSlash(value)) {
|
|
534
|
+
this.filePickBox.validationMessage = ( nls.localize('remoteFileDialog.badPath', 'The path does not exist.'));
|
|
535
|
+
this.badPath = value;
|
|
536
|
+
return UpdateResult.InvalidPath;
|
|
537
|
+
}
|
|
538
|
+
else {
|
|
539
|
+
let inputUriDirname = resources.dirname(valueUri);
|
|
540
|
+
const currentFolderWithoutSep = resources.removeTrailingPathSeparator(resources.addTrailingPathSeparator(this.currentFolder));
|
|
541
|
+
const inputUriDirnameWithoutSep = resources.removeTrailingPathSeparator(resources.addTrailingPathSeparator(inputUriDirname));
|
|
542
|
+
if (!resources.extUriIgnorePathCase.isEqual(currentFolderWithoutSep, inputUriDirnameWithoutSep)
|
|
543
|
+
&& (!/^[a-zA-Z]:$/.test(this.filePickBox.value)
|
|
544
|
+
|| !equalsIgnoreCase(this.pathFromUri(this.currentFolder).substring(0, this.filePickBox.value.length), this.filePickBox.value))) {
|
|
545
|
+
let statWithoutTrailing;
|
|
546
|
+
try {
|
|
547
|
+
statWithoutTrailing = await this.fileService.stat(inputUriDirname);
|
|
548
|
+
}
|
|
549
|
+
catch (e) {
|
|
550
|
+
}
|
|
551
|
+
if (statWithoutTrailing && statWithoutTrailing.isDirectory) {
|
|
552
|
+
this.badPath = undefined;
|
|
553
|
+
inputUriDirname = this.tryAddTrailingSeparatorToDirectory(inputUriDirname, statWithoutTrailing);
|
|
554
|
+
return (await this.updateItems(inputUriDirname, false, resources.basename(valueUri))) ? UpdateResult.UpdatedWithTrailing : UpdateResult.Updated;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
this.badPath = undefined;
|
|
560
|
+
return UpdateResult.NotUpdated;
|
|
561
|
+
}
|
|
562
|
+
tryUpdateTrailing(value) {
|
|
563
|
+
const ext = resources.extname(value);
|
|
564
|
+
if (this.trailing && ext) {
|
|
565
|
+
this.trailing = resources.basename(value);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
setActiveItems(value) {
|
|
569
|
+
value = this.pathFromUri(this.tildaReplace(value));
|
|
570
|
+
const asUri = this.remoteUriFrom(value);
|
|
571
|
+
const inputBasename = resources.basename(asUri);
|
|
572
|
+
const userPath = this.constructFullUserPath();
|
|
573
|
+
const pathsEqual = equalsIgnoreCase(userPath, value.substring(0, userPath.length)) ||
|
|
574
|
+
equalsIgnoreCase(value, userPath.substring(0, value.length));
|
|
575
|
+
if (pathsEqual) {
|
|
576
|
+
let hasMatch = false;
|
|
577
|
+
for (let i = 0; i < this.filePickBox.items.length; i++) {
|
|
578
|
+
const item = this.filePickBox.items[i];
|
|
579
|
+
if (this.setAutoComplete(value, inputBasename, item)) {
|
|
580
|
+
hasMatch = true;
|
|
581
|
+
break;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
if (!hasMatch) {
|
|
585
|
+
const userBasename = inputBasename.length >= 2 ? userPath.substring(userPath.length - inputBasename.length + 2) : '';
|
|
586
|
+
this.userEnteredPathSegment = (userBasename === inputBasename) ? inputBasename : '';
|
|
587
|
+
this.autoCompletePathSegment = '';
|
|
588
|
+
this.filePickBox.activeItems = [];
|
|
589
|
+
this.tryUpdateTrailing(asUri);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
else {
|
|
593
|
+
this.userEnteredPathSegment = inputBasename;
|
|
594
|
+
this.autoCompletePathSegment = '';
|
|
595
|
+
this.filePickBox.activeItems = [];
|
|
596
|
+
this.tryUpdateTrailing(asUri);
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
setAutoComplete(startingValue, startingBasename, quickPickItem, force = false) {
|
|
600
|
+
if (this.busy) {
|
|
601
|
+
this.userEnteredPathSegment = startingBasename;
|
|
602
|
+
this.autoCompletePathSegment = '';
|
|
603
|
+
return false;
|
|
604
|
+
}
|
|
605
|
+
const itemBasename = quickPickItem.label;
|
|
606
|
+
if (itemBasename === '..') {
|
|
607
|
+
this.userEnteredPathSegment = '';
|
|
608
|
+
this.autoCompletePathSegment = '';
|
|
609
|
+
this.activeItem = quickPickItem;
|
|
610
|
+
if (force) {
|
|
611
|
+
document.execCommand('insertText', false, '');
|
|
612
|
+
}
|
|
613
|
+
return false;
|
|
614
|
+
}
|
|
615
|
+
else if (!force && (itemBasename.length >= startingBasename.length) && equalsIgnoreCase(itemBasename.substr(0, startingBasename.length), startingBasename)) {
|
|
616
|
+
this.userEnteredPathSegment = startingBasename;
|
|
617
|
+
this.activeItem = quickPickItem;
|
|
618
|
+
this.autoCompletePathSegment = '';
|
|
619
|
+
if (quickPickItem.isFolder || !this.trailing) {
|
|
620
|
+
this.filePickBox.activeItems = [quickPickItem];
|
|
621
|
+
}
|
|
622
|
+
else {
|
|
623
|
+
this.filePickBox.activeItems = [];
|
|
624
|
+
}
|
|
625
|
+
return true;
|
|
626
|
+
}
|
|
627
|
+
else if (force && (!equalsIgnoreCase(this.basenameWithTrailingSlash(quickPickItem.uri), (this.userEnteredPathSegment + this.autoCompletePathSegment)))) {
|
|
628
|
+
this.userEnteredPathSegment = '';
|
|
629
|
+
if (!this.accessibilityService.isScreenReaderOptimized()) {
|
|
630
|
+
this.autoCompletePathSegment = this.trimTrailingSlash(itemBasename);
|
|
631
|
+
}
|
|
632
|
+
this.activeItem = quickPickItem;
|
|
633
|
+
if (!this.accessibilityService.isScreenReaderOptimized()) {
|
|
634
|
+
this.filePickBox.valueSelection = [this.pathFromUri(this.currentFolder, true).length, this.filePickBox.value.length];
|
|
635
|
+
this.insertText(this.pathAppend(this.currentFolder, this.autoCompletePathSegment), this.autoCompletePathSegment);
|
|
636
|
+
this.filePickBox.valueSelection = [this.filePickBox.value.length - this.autoCompletePathSegment.length, this.filePickBox.value.length];
|
|
637
|
+
}
|
|
638
|
+
return true;
|
|
639
|
+
}
|
|
640
|
+
else {
|
|
641
|
+
this.userEnteredPathSegment = startingBasename;
|
|
642
|
+
this.autoCompletePathSegment = '';
|
|
643
|
+
return false;
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
insertText(wholeValue, insertText) {
|
|
647
|
+
if (this.filePickBox.inputHasFocus()) {
|
|
648
|
+
document.execCommand('insertText', false, insertText);
|
|
649
|
+
if (this.filePickBox.value !== wholeValue) {
|
|
650
|
+
this.filePickBox.value = wholeValue;
|
|
651
|
+
this.handleValueChange(wholeValue);
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
else {
|
|
655
|
+
this.filePickBox.value = wholeValue;
|
|
656
|
+
this.handleValueChange(wholeValue);
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
addPostfix(uri) {
|
|
660
|
+
let result = uri;
|
|
661
|
+
if (this.requiresTrailing && this.options.filters && this.options.filters.length > 0 && !resources.hasTrailingPathSeparator(uri)) {
|
|
662
|
+
let hasExt = false;
|
|
663
|
+
const currentExt = resources.extname(uri).substr(1);
|
|
664
|
+
for (let i = 0; i < this.options.filters.length; i++) {
|
|
665
|
+
for (let j = 0; j < this.options.filters[i].extensions.length; j++) {
|
|
666
|
+
if ((this.options.filters[i].extensions[j] === '*') || (this.options.filters[i].extensions[j] === currentExt)) {
|
|
667
|
+
hasExt = true;
|
|
668
|
+
break;
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
if (hasExt) {
|
|
672
|
+
break;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
if (!hasExt) {
|
|
676
|
+
result = resources.joinPath(resources.dirname(uri), resources.basename(uri) + '.' + this.options.filters[0].extensions[0]);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
return result;
|
|
680
|
+
}
|
|
681
|
+
trimTrailingSlash(path) {
|
|
682
|
+
return ((path.length > 1) && this.endsWithSlash(path)) ? path.substr(0, path.length - 1) : path;
|
|
683
|
+
}
|
|
684
|
+
yesNoPrompt(uri, message) {
|
|
685
|
+
const prompt = this.quickInputService.createQuickPick();
|
|
686
|
+
prompt.title = message;
|
|
687
|
+
prompt.ignoreFocusOut = true;
|
|
688
|
+
prompt.ok = true;
|
|
689
|
+
prompt.customButton = true;
|
|
690
|
+
prompt.customLabel = ( nls.localize('remoteFileDialog.cancel', 'Cancel'));
|
|
691
|
+
prompt.value = this.pathFromUri(uri);
|
|
692
|
+
let isResolving = false;
|
|
693
|
+
return ( new Promise(resolve => {
|
|
694
|
+
prompt.onDidAccept(() => {
|
|
695
|
+
isResolving = true;
|
|
696
|
+
prompt.hide();
|
|
697
|
+
resolve(true);
|
|
698
|
+
});
|
|
699
|
+
prompt.onDidHide(() => {
|
|
700
|
+
if (!isResolving) {
|
|
701
|
+
resolve(false);
|
|
702
|
+
}
|
|
703
|
+
this.filePickBox.show();
|
|
704
|
+
this.hidden = false;
|
|
705
|
+
this.filePickBox.items = this.filePickBox.items;
|
|
706
|
+
prompt.dispose();
|
|
707
|
+
});
|
|
708
|
+
prompt.onDidChangeValue(() => {
|
|
709
|
+
prompt.hide();
|
|
710
|
+
});
|
|
711
|
+
prompt.onDidCustom(() => {
|
|
712
|
+
prompt.hide();
|
|
713
|
+
});
|
|
714
|
+
prompt.show();
|
|
715
|
+
}));
|
|
716
|
+
}
|
|
717
|
+
async validate(uri) {
|
|
718
|
+
if (uri === undefined) {
|
|
719
|
+
this.filePickBox.validationMessage = ( nls.localize('remoteFileDialog.invalidPath', 'Please enter a valid path.'));
|
|
720
|
+
return Promise.resolve(false);
|
|
721
|
+
}
|
|
722
|
+
let stat;
|
|
723
|
+
let statDirname;
|
|
724
|
+
try {
|
|
725
|
+
statDirname = await this.fileService.stat(resources.dirname(uri));
|
|
726
|
+
stat = await this.fileService.stat(uri);
|
|
727
|
+
}
|
|
728
|
+
catch (e) {
|
|
729
|
+
}
|
|
730
|
+
if (this.requiresTrailing) {
|
|
731
|
+
if (stat && stat.isDirectory) {
|
|
732
|
+
this.filePickBox.validationMessage = ( nls.localize(
|
|
733
|
+
'remoteFileDialog.validateFolder',
|
|
734
|
+
'The folder already exists. Please use a new file name.'
|
|
735
|
+
));
|
|
736
|
+
return Promise.resolve(false);
|
|
737
|
+
}
|
|
738
|
+
else if (stat) {
|
|
739
|
+
const message = ( nls.localize(
|
|
740
|
+
'remoteFileDialog.validateExisting',
|
|
741
|
+
'{0} already exists. Are you sure you want to overwrite it?',
|
|
742
|
+
resources.basename(uri)
|
|
743
|
+
));
|
|
744
|
+
return this.yesNoPrompt(uri, message);
|
|
745
|
+
}
|
|
746
|
+
else if (!(isValidBasename(resources.basename(uri), this.isWindows))) {
|
|
747
|
+
this.filePickBox.validationMessage = ( nls.localize('remoteFileDialog.validateBadFilename', 'Please enter a valid file name.'));
|
|
748
|
+
return Promise.resolve(false);
|
|
749
|
+
}
|
|
750
|
+
else if (!statDirname) {
|
|
751
|
+
const message = ( nls.localize(
|
|
752
|
+
'remoteFileDialog.validateCreateDirectory',
|
|
753
|
+
'The folder {0} does not exist. Would you like to create it?',
|
|
754
|
+
resources.basename(resources.dirname(uri))
|
|
755
|
+
));
|
|
756
|
+
return this.yesNoPrompt(uri, message);
|
|
757
|
+
}
|
|
758
|
+
else if (!statDirname.isDirectory) {
|
|
759
|
+
this.filePickBox.validationMessage = ( nls.localize(
|
|
760
|
+
'remoteFileDialog.validateNonexistentDir',
|
|
761
|
+
'Please enter a path that exists.'
|
|
762
|
+
));
|
|
763
|
+
return Promise.resolve(false);
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
else {
|
|
767
|
+
if (!stat) {
|
|
768
|
+
this.filePickBox.validationMessage = ( nls.localize(
|
|
769
|
+
'remoteFileDialog.validateNonexistentDir',
|
|
770
|
+
'Please enter a path that exists.'
|
|
771
|
+
));
|
|
772
|
+
return Promise.resolve(false);
|
|
773
|
+
}
|
|
774
|
+
else if (uri.path === '/' && this.isWindows) {
|
|
775
|
+
this.filePickBox.validationMessage = ( nls.localize(
|
|
776
|
+
'remoteFileDialog.windowsDriveLetter',
|
|
777
|
+
'Please start the path with a drive letter.'
|
|
778
|
+
));
|
|
779
|
+
return Promise.resolve(false);
|
|
780
|
+
}
|
|
781
|
+
else if (stat.isDirectory && !this.allowFolderSelection) {
|
|
782
|
+
this.filePickBox.validationMessage = ( nls.localize('remoteFileDialog.validateFileOnly', 'Please select a file.'));
|
|
783
|
+
return Promise.resolve(false);
|
|
784
|
+
}
|
|
785
|
+
else if (!stat.isDirectory && !this.allowFileSelection) {
|
|
786
|
+
this.filePickBox.validationMessage = ( nls.localize('remoteFileDialog.validateFolderOnly', 'Please select a folder.'));
|
|
787
|
+
return Promise.resolve(false);
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
return Promise.resolve(true);
|
|
791
|
+
}
|
|
792
|
+
async updateItems(newFolder, force = false, trailing) {
|
|
793
|
+
this.busy = true;
|
|
794
|
+
this.autoCompletePathSegment = '';
|
|
795
|
+
const isSave = !!trailing;
|
|
796
|
+
let result = false;
|
|
797
|
+
const updatingPromise = createCancelablePromise(async (token) => {
|
|
798
|
+
let folderStat;
|
|
799
|
+
try {
|
|
800
|
+
folderStat = await this.fileService.resolve(newFolder);
|
|
801
|
+
if (!folderStat.isDirectory) {
|
|
802
|
+
trailing = resources.basename(newFolder);
|
|
803
|
+
newFolder = resources.dirname(newFolder);
|
|
804
|
+
folderStat = undefined;
|
|
805
|
+
result = true;
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
catch (e) {
|
|
809
|
+
}
|
|
810
|
+
const newValue = trailing ? this.pathAppend(newFolder, trailing) : this.pathFromUri(newFolder, true);
|
|
811
|
+
this.currentFolder = this.endsWithSlash(newFolder.path) ? newFolder : resources.addTrailingPathSeparator(newFolder, this.separator);
|
|
812
|
+
this.userEnteredPathSegment = trailing ? trailing : '';
|
|
813
|
+
return this.createItems(folderStat, this.currentFolder, token).then(items => {
|
|
814
|
+
if (token.isCancellationRequested) {
|
|
815
|
+
this.busy = false;
|
|
816
|
+
return false;
|
|
817
|
+
}
|
|
818
|
+
this.filePickBox.items = items;
|
|
819
|
+
this.filePickBox.activeItems = [this.filePickBox.items[0]];
|
|
820
|
+
this.filePickBox.activeItems = [];
|
|
821
|
+
if (!equalsIgnoreCase(this.filePickBox.value, newValue) && force) {
|
|
822
|
+
this.filePickBox.valueSelection = [0, this.filePickBox.value.length];
|
|
823
|
+
this.insertText(newValue, newValue);
|
|
824
|
+
}
|
|
825
|
+
if (force && trailing && isSave) {
|
|
826
|
+
this.filePickBox.valueSelection = [this.filePickBox.value.length - trailing.length, this.filePickBox.value.length - trailing.length];
|
|
827
|
+
}
|
|
828
|
+
else if (!trailing) {
|
|
829
|
+
this.filePickBox.valueSelection = [this.filePickBox.value.length, this.filePickBox.value.length];
|
|
830
|
+
}
|
|
831
|
+
this.busy = false;
|
|
832
|
+
this.updatingPromise = undefined;
|
|
833
|
+
return result;
|
|
834
|
+
});
|
|
835
|
+
});
|
|
836
|
+
if (this.updatingPromise !== undefined) {
|
|
837
|
+
this.updatingPromise.cancel();
|
|
838
|
+
}
|
|
839
|
+
this.updatingPromise = updatingPromise;
|
|
840
|
+
return updatingPromise;
|
|
841
|
+
}
|
|
842
|
+
pathFromUri(uri, endWithSeparator = false) {
|
|
843
|
+
let result = normalizeDriveLetter(uri.fsPath, this.isWindows).replace(/\n/g, '');
|
|
844
|
+
if (this.separator === '/') {
|
|
845
|
+
result = result.replace(/\\/g, this.separator);
|
|
846
|
+
}
|
|
847
|
+
else {
|
|
848
|
+
result = result.replace(/\//g, this.separator);
|
|
849
|
+
}
|
|
850
|
+
if (endWithSeparator && !this.endsWithSlash(result)) {
|
|
851
|
+
result = result + this.separator;
|
|
852
|
+
}
|
|
853
|
+
return result;
|
|
854
|
+
}
|
|
855
|
+
pathAppend(uri, additional) {
|
|
856
|
+
if ((additional === '..') || (additional === '.')) {
|
|
857
|
+
const basePath = this.pathFromUri(uri, true);
|
|
858
|
+
return basePath + additional;
|
|
859
|
+
}
|
|
860
|
+
else {
|
|
861
|
+
return this.pathFromUri(resources.joinPath(uri, additional));
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
async checkIsWindowsOS() {
|
|
865
|
+
let isWindowsOS = isWindows;
|
|
866
|
+
const env = await this.getRemoteAgentEnvironment();
|
|
867
|
+
if (env) {
|
|
868
|
+
isWindowsOS = env.os === 1 ;
|
|
869
|
+
}
|
|
870
|
+
return isWindowsOS;
|
|
871
|
+
}
|
|
872
|
+
endsWithSlash(s) {
|
|
873
|
+
return /[\/\\]$/.test(s);
|
|
874
|
+
}
|
|
875
|
+
basenameWithTrailingSlash(fullPath) {
|
|
876
|
+
const child = this.pathFromUri(fullPath, true);
|
|
877
|
+
const parent = this.pathFromUri(resources.dirname(fullPath), true);
|
|
878
|
+
return child.substring(parent.length);
|
|
879
|
+
}
|
|
880
|
+
async createBackItem(currFolder) {
|
|
881
|
+
const fileRepresentationCurr = this.currentFolder.with({ scheme: Schemas.file, authority: '' });
|
|
882
|
+
const fileRepresentationParent = resources.dirname(fileRepresentationCurr);
|
|
883
|
+
if (!resources.isEqual(fileRepresentationCurr, fileRepresentationParent)) {
|
|
884
|
+
const parentFolder = resources.dirname(currFolder);
|
|
885
|
+
if (await this.fileService.exists(parentFolder)) {
|
|
886
|
+
return { label: '..', uri: resources.addTrailingPathSeparator(parentFolder, this.separator), isFolder: true };
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
return undefined;
|
|
890
|
+
}
|
|
891
|
+
async createItems(folder, currentFolder, token) {
|
|
892
|
+
const result = [];
|
|
893
|
+
const backDir = await this.createBackItem(currentFolder);
|
|
894
|
+
try {
|
|
895
|
+
if (!folder) {
|
|
896
|
+
folder = await this.fileService.resolve(currentFolder);
|
|
897
|
+
}
|
|
898
|
+
const items = folder.children ? await Promise.all(( folder.children.map(child => this.createItem(child, currentFolder, token)))) : [];
|
|
899
|
+
for (const item of items) {
|
|
900
|
+
if (item) {
|
|
901
|
+
result.push(item);
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
catch (e) {
|
|
906
|
+
console.log(e);
|
|
907
|
+
}
|
|
908
|
+
if (token.isCancellationRequested) {
|
|
909
|
+
return [];
|
|
910
|
+
}
|
|
911
|
+
const sorted = result.sort((i1, i2) => {
|
|
912
|
+
if (i1.isFolder !== i2.isFolder) {
|
|
913
|
+
return i1.isFolder ? -1 : 1;
|
|
914
|
+
}
|
|
915
|
+
const trimmed1 = this.endsWithSlash(i1.label) ? i1.label.substr(0, i1.label.length - 1) : i1.label;
|
|
916
|
+
const trimmed2 = this.endsWithSlash(i2.label) ? i2.label.substr(0, i2.label.length - 1) : i2.label;
|
|
917
|
+
return trimmed1.localeCompare(trimmed2);
|
|
918
|
+
});
|
|
919
|
+
if (backDir) {
|
|
920
|
+
sorted.unshift(backDir);
|
|
921
|
+
}
|
|
922
|
+
return sorted;
|
|
923
|
+
}
|
|
924
|
+
filterFile(file) {
|
|
925
|
+
if (this.options.filters) {
|
|
926
|
+
const ext = resources.extname(file);
|
|
927
|
+
for (let i = 0; i < this.options.filters.length; i++) {
|
|
928
|
+
for (let j = 0; j < this.options.filters[i].extensions.length; j++) {
|
|
929
|
+
const testExt = this.options.filters[i].extensions[j];
|
|
930
|
+
if ((testExt === '*') || (ext === ('.' + testExt))) {
|
|
931
|
+
return true;
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
return false;
|
|
936
|
+
}
|
|
937
|
+
return true;
|
|
938
|
+
}
|
|
939
|
+
async createItem(stat, parent, token) {
|
|
940
|
+
if (token.isCancellationRequested) {
|
|
941
|
+
return undefined;
|
|
942
|
+
}
|
|
943
|
+
let fullPath = resources.joinPath(parent, stat.name);
|
|
944
|
+
if (stat.isDirectory) {
|
|
945
|
+
const filename = resources.basename(fullPath);
|
|
946
|
+
fullPath = resources.addTrailingPathSeparator(fullPath, this.separator);
|
|
947
|
+
return { label: filename, uri: fullPath, isFolder: true, iconClasses: getIconClasses(this.modelService, this.languageService, fullPath || undefined, FileKind.FOLDER) };
|
|
948
|
+
}
|
|
949
|
+
else if (!stat.isDirectory && this.allowFileSelection && this.filterFile(fullPath)) {
|
|
950
|
+
return { label: stat.name, uri: fullPath, isFolder: false, iconClasses: getIconClasses(this.modelService, this.languageService, fullPath || undefined) };
|
|
951
|
+
}
|
|
952
|
+
return undefined;
|
|
953
|
+
}
|
|
954
|
+
};
|
|
955
|
+
SimpleFileDialog = ( __decorate([
|
|
956
|
+
( __param(0, IFileService)),
|
|
957
|
+
( __param(1, IQuickInputService)),
|
|
958
|
+
( __param(2, ILabelService)),
|
|
959
|
+
( __param(3, IWorkspaceContextService)),
|
|
960
|
+
( __param(4, INotificationService)),
|
|
961
|
+
( __param(5, IFileDialogService)),
|
|
962
|
+
( __param(6, IModelService)),
|
|
963
|
+
( __param(7, ILanguageService)),
|
|
964
|
+
( __param(8, IWorkbenchEnvironmentService)),
|
|
965
|
+
( __param(9, IRemoteAgentService)),
|
|
966
|
+
( __param(10, IPathService)),
|
|
967
|
+
( __param(11, IKeybindingService)),
|
|
968
|
+
( __param(12, IContextKeyService)),
|
|
969
|
+
( __param(13, IAccessibilityService))
|
|
970
|
+
], SimpleFileDialog));
|
|
971
|
+
export { OpenLocalFileCommand, OpenLocalFileFolderCommand, OpenLocalFolderCommand, RemoteFileDialogContext, SaveLocalFileCommand, SimpleFileDialog };
|