@codingame/monaco-vscode-api 1.78.4 → 1.78.5-next.0
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 +28 -9
- package/dist/api.js +192 -2
- package/dist/assets/breakpointWidget.css +31 -0
- package/dist/assets/callStackEditorContribution.css +12 -0
- package/dist/assets/debug.contribution.css +138 -0
- package/dist/assets/debugHover.css +80 -0
- package/dist/assets/debugToolBar.css +49 -0
- package/dist/assets/editorquickaccess.css +8 -0
- package/dist/assets/editorstatus.css +51 -0
- package/dist/assets/exceptionWidget.css +52 -0
- package/dist/assets/notificationsActions.css +14 -0
- package/dist/assets/notificationsCenter.css +69 -0
- package/dist/assets/notificationsList.css +152 -0
- package/dist/assets/notificationsToasts.css +63 -0
- package/dist/assets/panelpart.css +75 -0
- package/dist/assets/paneview.css +148 -0
- package/dist/assets/paneviewlet.css +79 -0
- package/dist/assets/sidebysideeditor.css +9 -0
- package/dist/assets.js +15 -0
- package/dist/default-extensions/bat.js +6 -6
- package/dist/default-extensions/clojure.js +5 -5
- package/dist/default-extensions/coffeescript.js +6 -6
- package/dist/default-extensions/cpp.js +11 -11
- package/dist/default-extensions/csharp.js +6 -6
- package/dist/default-extensions/css.js +5 -5
- package/dist/default-extensions/dart.js +5 -5
- package/dist/default-extensions/diff.js +5 -5
- package/dist/default-extensions/docker.js +5 -5
- package/dist/default-extensions/fsharp.js +6 -6
- package/dist/default-extensions/go.js +5 -5
- package/dist/default-extensions/groovy.js +6 -6
- package/dist/default-extensions/handlebars.js +5 -5
- package/dist/default-extensions/hlsl.js +5 -5
- package/dist/default-extensions/html.js +7 -7
- package/dist/default-extensions/ini.js +6 -6
- package/dist/default-extensions/java.js +6 -6
- package/dist/default-extensions/javascript.js +9 -9
- package/dist/default-extensions/json.js +6 -6
- package/dist/default-extensions/julia.js +5 -5
- package/dist/default-extensions/latex.js +11 -11
- package/dist/default-extensions/less.js +5 -5
- package/dist/default-extensions/log.js +4 -4
- package/dist/default-extensions/lua.js +5 -5
- package/dist/default-extensions/make.js +5 -5
- package/dist/default-extensions/markdown-basics.js +6 -6
- package/dist/default-extensions/objective-c.js +6 -6
- package/dist/default-extensions/perl.js +7 -7
- package/dist/default-extensions/php.js +7 -7
- package/dist/default-extensions/powershell.js +5 -5
- package/dist/default-extensions/pug.js +5 -5
- package/dist/default-extensions/python.js +6 -6
- package/dist/default-extensions/r.js +5 -5
- package/dist/default-extensions/razor.js +5 -5
- package/dist/default-extensions/ruby.js +5 -5
- package/dist/default-extensions/rust.js +5 -5
- package/dist/default-extensions/scss.js +6 -6
- package/dist/default-extensions/shaderlab.js +5 -5
- package/dist/default-extensions/shellscript.js +5 -5
- package/dist/default-extensions/sql.js +5 -5
- package/dist/default-extensions/swift.js +6 -6
- package/dist/default-extensions/theme-abyss.js +4 -4
- package/dist/default-extensions/theme-defaults.js +12 -12
- package/dist/default-extensions/theme-kimbie-dark.js +4 -4
- package/dist/default-extensions/theme-monokai-dimmed.js +4 -4
- package/dist/default-extensions/theme-monokai.js +4 -4
- package/dist/default-extensions/theme-quietlight.js +4 -4
- package/dist/default-extensions/theme-red.js +4 -4
- package/dist/default-extensions/theme-seti.js +4 -4
- package/dist/default-extensions/theme-solarized-dark.js +4 -4
- package/dist/default-extensions/theme-solarized-light.js +4 -4
- package/dist/default-extensions/theme-tomorrow-night-blue.js +4 -4
- package/dist/default-extensions/typescript-basics.js +9 -9
- package/dist/default-extensions/typescript-language-features.js +3 -3
- package/dist/default-extensions/vb.js +6 -6
- package/dist/default-extensions/xml.js +7 -7
- package/dist/default-extensions/yaml.js +5 -5
- package/dist/{extension-tools-b2d018a3.js → extension-tools-b68a64de.js} +2 -15
- package/dist/extensions.js +150 -4
- package/dist/json.js +92 -0
- package/dist/monaco-treemending.js +882 -0
- package/dist/monaco.js +24 -458
- package/dist/node_modules/tslib/tslib.es6.js +21 -0
- package/dist/override/vs/workbench/browser/parts/editor/textEditor.js +2 -0
- package/dist/rollup-extension-directory-plugin.js +1 -1
- package/dist/rollup-vsix-plugin.js +1 -1
- package/dist/service-override/_46__46__47__46__46__47_vscode_47_vs_47_platform_47_audioCues_47_browser_47_media_47__42__46_mp3.js +11 -0
- package/dist/service-override/audioCue.js +13 -0
- package/dist/service-override/configuration.js +100 -0
- package/dist/service-override/debug.js +23 -0
- package/dist/service-override/dialogs.js +13 -0
- package/dist/service-override/files.js +244 -0
- package/dist/service-override/keybindings.js +100 -0
- package/dist/service-override/languages.js +27 -0
- package/dist/service-override/layout.js +41 -0
- package/dist/service-override/modelEditor.js +128 -0
- package/dist/service-override/notifications.js +34 -0
- package/dist/service-override/preferences.js +10 -0
- package/dist/{snippets.js → service-override/snippets.js} +5 -3
- package/dist/service-override/textmate.js +36 -0
- package/dist/service-override/theme.js +26 -0
- package/dist/services.d.ts +118 -1
- package/dist/services.js +59 -3
- package/dist/tools.js +20 -0
- package/dist/vscode/vs/base/browser/ui/splitview/paneview.js +289 -0
- package/dist/vscode/vs/base/common/console.js +58 -0
- package/dist/vscode/vs/base/common/date.js +204 -0
- package/dist/vscode/vs/base/common/json.js +713 -0
- package/dist/vscode/vs/base/common/jsonEdit.js +164 -0
- package/dist/vscode/vs/base/common/jsonFormatter.js +187 -0
- package/dist/vscode/vs/base/common/keybindingParser.js +87 -0
- package/dist/vscode/vs/base/common/performance.js +18 -0
- package/dist/vscode/vs/base/common/skipList.js +160 -0
- package/dist/vscode/vs/base/common/stream.js +300 -0
- package/dist/vscode/vs/base/common/uriIpc.js +32 -0
- package/dist/vscode/vs/base/parts/ipc/common/ipc.net.js +45 -0
- package/dist/vscode/vs/base/parts/request/browser/request.js +60 -0
- package/dist/vscode/vs/base/parts/request/common/request.js +8 -0
- package/dist/vscode/vs/editor/browser/config/editorConfiguration.js +91 -0
- package/dist/vscode/vs/editor/common/services/languageFeaturesService.js +41 -0
- package/dist/vscode/vs/editor/common/services/modelUndoRedoParticipant.js +56 -0
- package/dist/vscode/vs/editor/common/services/textResourceConfigurationService.js +112 -0
- package/dist/vscode/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem.js +112 -0
- package/dist/vscode/vs/platform/debug/common/extensionHostDebug.js +3 -0
- package/dist/{extensionManagement.js → vscode/vs/platform/extensionManagement/common/extensionManagement.js} +2 -1
- package/dist/vscode/vs/platform/extensionManagement/common/extensionManagementUtil.js +14 -0
- package/dist/vscode/vs/platform/extensionManagement/common/extensionNls.js +66 -0
- package/dist/vscode/vs/platform/extensionManagement/common/implicitActivationEvents.js +53 -0
- package/dist/vscode/vs/platform/extensionResourceLoader/common/extensionResourceLoader.js +69 -0
- package/dist/vscode/vs/platform/externalServices/common/serviceMachineId.js +27 -0
- package/dist/vscode/vs/platform/files/common/fileService.js +920 -0
- package/dist/vscode/vs/platform/files/common/inMemoryFilesystemProvider.js +175 -0
- package/dist/vscode/vs/platform/files/common/io.js +80 -0
- package/dist/vscode/vs/platform/files/common/watcher.js +69 -0
- package/dist/vscode/vs/platform/keyboardLayout/common/keyboardConfig.js +42 -0
- package/dist/vscode/vs/platform/keyboardLayout/common/keyboardLayout.js +12 -0
- package/dist/vscode/vs/platform/keyboardLayout/common/keyboardMapper.js +23 -0
- package/dist/vscode/vs/platform/product/common/productService.js +4 -0
- package/dist/vscode/vs/platform/remote/common/remoteAuthorityResolver.js +17 -0
- package/dist/vscode/vs/platform/remote/common/remoteHosts.js +18 -0
- package/dist/vscode/vs/platform/request/browser/requestService.js +25 -0
- package/dist/vscode/vs/platform/request/common/request.js +50 -0
- package/dist/vscode/vs/platform/telemetry/common/telemetryUtils.js +119 -0
- package/dist/{tokenClassificationRegistry.js → vscode/vs/platform/theme/common/tokenClassificationRegistry.js} +82 -136
- package/dist/vscode/vs/platform/tunnel/common/tunnel.js +3 -0
- package/dist/vscode/vs/platform/uriIdentity/common/uriIdentity.js +3 -0
- package/dist/vscode/vs/platform/uriIdentity/common/uriIdentityService.js +80 -0
- package/dist/vscode/vs/platform/userDataProfile/common/userDataProfile.js +427 -0
- package/dist/vscode/vs/platform/userDataSync/common/content.js +9 -0
- package/dist/vscode/vs/platform/userDataSync/common/settingsMerge.js +299 -0
- package/dist/vscode/vs/platform/workspace/common/editSessions.js +3 -0
- package/dist/vscode/vs/platform/workspace/common/virtualWorkspace.js +17 -0
- package/dist/vscode/vs/platform/workspaces/common/workspaces.js +195 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadBulkEdits.js +49 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadClipboard.js +22 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadCommands.js +93 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadConfiguration.js +78 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadConsole.js +33 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadDebugService.js +347 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadDiagnostics.js +67 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +73 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadDocuments.js +246 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +379 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadEditor.js +410 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadEditors.js +223 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadExtensionService.js +213 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadFileSystem.js +270 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadFileSystemEventService.js +223 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadLanguageFeatures.js +909 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadLanguages.js +76 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadMessageService.js +114 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadOutputService.js +73 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadProgress.js +62 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadQuickOpen.js +183 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadSaveParticipant.js +43 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadTelemetry.js +50 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadWindow.js +48 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadWorkspace.js +227 -0
- package/dist/vscode/vs/workbench/api/common/cache.js +28 -0
- package/dist/vscode/vs/workbench/api/common/configurationExtensionPoint.js +450 -0
- package/dist/vscode/vs/workbench/api/common/extHost.protocol.js +131 -0
- package/dist/vscode/vs/workbench/api/common/extHostApiCommands.js +656 -0
- package/dist/vscode/vs/workbench/api/common/extHostApiDeprecationService.js +35 -0
- package/dist/vscode/vs/workbench/api/common/extHostBulkEdits.js +21 -0
- package/dist/vscode/vs/workbench/api/common/extHostClipboard.js +15 -0
- package/dist/vscode/vs/workbench/api/common/extHostCommands.js +415 -0
- package/dist/vscode/vs/workbench/api/common/extHostConfiguration.js +264 -0
- package/dist/vscode/vs/workbench/api/common/extHostDebugService.js +786 -0
- package/dist/vscode/vs/workbench/api/common/extHostDecorations.js +94 -0
- package/dist/vscode/vs/workbench/api/common/extHostDiagnostics.js +292 -0
- package/dist/vscode/vs/workbench/api/common/extHostDocumentContentProviders.js +65 -0
- package/dist/vscode/vs/workbench/api/common/extHostDocumentData.js +212 -0
- package/dist/vscode/vs/workbench/api/common/extHostDocumentSaveParticipant.js +126 -0
- package/dist/vscode/vs/workbench/api/common/extHostDocuments.js +144 -0
- package/dist/vscode/vs/workbench/api/common/extHostDocumentsAndEditors.js +147 -0
- package/dist/vscode/vs/workbench/api/common/extHostEditorTabs.js +328 -0
- package/dist/vscode/vs/workbench/api/common/extHostExtensionActivator.js +309 -0
- package/dist/vscode/vs/workbench/api/common/extHostExtensionService.js +814 -0
- package/dist/vscode/vs/workbench/api/common/extHostFileSystem.js +272 -0
- package/dist/vscode/vs/workbench/api/common/extHostFileSystemConsumer.js +153 -0
- package/dist/vscode/vs/workbench/api/common/extHostFileSystemEventService.js +193 -0
- package/dist/vscode/vs/workbench/api/common/extHostFileSystemInfo.js +35 -0
- package/dist/vscode/vs/workbench/api/common/extHostInitDataService.js +3 -0
- package/dist/vscode/vs/workbench/api/common/extHostLanguageFeatures.js +2038 -0
- package/dist/vscode/vs/workbench/api/common/extHostLanguages.js +164 -0
- package/dist/vscode/vs/workbench/api/common/extHostLocalizationService.js +85 -0
- package/dist/vscode/vs/workbench/api/common/extHostMemento.js +74 -0
- package/dist/vscode/vs/workbench/api/common/extHostMessageService.js +55 -0
- package/dist/vscode/vs/workbench/api/common/extHostOutput.js +257 -0
- package/dist/vscode/vs/workbench/api/common/extHostProgress.js +80 -0
- package/dist/vscode/vs/workbench/api/common/extHostQuickOpen.js +580 -0
- package/dist/vscode/vs/workbench/api/common/extHostRpcService.js +12 -0
- package/dist/vscode/vs/workbench/api/common/extHostSecretState.js +24 -0
- package/dist/vscode/vs/workbench/api/common/extHostSecrets.js +29 -0
- package/dist/vscode/vs/workbench/api/common/extHostStorage.js +42 -0
- package/dist/vscode/vs/workbench/api/common/extHostStoragePaths.js +64 -0
- package/dist/vscode/vs/workbench/api/common/extHostTelemetry.js +266 -0
- package/dist/vscode/vs/workbench/api/common/extHostTerminalService.js +3 -0
- package/dist/vscode/vs/workbench/api/common/extHostTestItem.js +122 -0
- package/dist/vscode/vs/workbench/api/common/extHostTestingPrivateApi.js +15 -0
- package/dist/vscode/vs/workbench/api/common/extHostTextEditor.js +511 -0
- package/dist/vscode/vs/workbench/api/common/extHostTextEditors.js +128 -0
- package/dist/vscode/vs/workbench/api/common/extHostTunnelService.js +36 -0
- package/dist/vscode/vs/workbench/api/common/extHostTypeConverters.js +1766 -0
- package/dist/vscode/vs/workbench/api/common/extHostTypes.js +2810 -0
- package/dist/vscode/vs/workbench/api/common/extHostUriTransformerService.js +19 -0
- package/dist/vscode/vs/workbench/api/common/extHostVariableResolverService.js +138 -0
- package/dist/vscode/vs/workbench/api/common/extHostWindow.js +59 -0
- package/dist/vscode/vs/workbench/api/common/extHostWorkspace.js +534 -0
- package/dist/vscode/vs/workbench/api/common/jsonValidationExtensionPoint.js +97 -0
- package/dist/vscode/vs/workbench/api/common/shared/dataTransferCache.js +36 -0
- package/dist/vscode/vs/workbench/browser/actions/layoutActions.js +1201 -0
- package/dist/vscode/vs/workbench/browser/actions.js +77 -0
- package/dist/vscode/vs/workbench/browser/codeeditor.js +185 -0
- package/dist/vscode/vs/workbench/browser/composite.js +102 -0
- package/dist/vscode/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.js +146 -0
- package/dist/vscode/vs/workbench/browser/parts/dialogs/dialog.web.contribution.js +68 -0
- package/dist/vscode/vs/workbench/browser/parts/dialogs/dialogHandler.js +124 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editor.contribution.js +876 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editor.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorActions.js +1946 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorAutoSave.js +157 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorCommands.js +1289 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorPane.js +242 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorQuickAccess.js +213 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorStatus.js +460 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorWithViewState.js +139 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/sideBySideEditor.js +387 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/textDiffEditor.js +289 -0
- package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsActions.js +124 -0
- package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsAlerts.js +58 -0
- package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsCenter.js +224 -0
- package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsCommands.js +241 -0
- package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsList.js +185 -0
- package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsTelemetry.js +35 -0
- package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsToasts.js +417 -0
- package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsViewer.js +392 -0
- package/dist/vscode/vs/workbench/browser/parts/panel/panelActions.js +422 -0
- package/dist/vscode/vs/workbench/browser/parts/views/viewPane.js +520 -0
- package/dist/vscode/vs/workbench/browser/quickaccess.js +17 -0
- package/dist/vscode/vs/workbench/common/component.js +23 -0
- package/dist/vscode/vs/workbench/common/configuration.js +8 -0
- package/dist/vscode/vs/workbench/common/contextkeys.js +170 -0
- package/dist/vscode/vs/workbench/common/contributions.js +111 -0
- package/dist/vscode/vs/workbench/common/dialogs.js +31 -0
- package/dist/vscode/vs/workbench/common/editor/binaryEditorModel.js +39 -0
- package/dist/vscode/vs/workbench/common/editor/diffEditorInput.js +164 -0
- package/dist/vscode/vs/workbench/common/editor/diffEditorModel.js +23 -0
- package/dist/vscode/vs/workbench/common/editor/editorInput.js +97 -0
- package/dist/vscode/vs/workbench/common/editor/editorModel.js +26 -0
- package/dist/vscode/vs/workbench/common/editor/editorOptions.js +48 -0
- package/dist/vscode/vs/workbench/common/editor/resourceEditorInput.js +133 -0
- package/dist/vscode/vs/workbench/common/editor/sideBySideEditorInput.js +228 -0
- package/dist/vscode/vs/workbench/common/editor/textDiffEditorModel.js +42 -0
- package/dist/vscode/vs/workbench/common/editor/textEditorModel.js +165 -0
- package/dist/vscode/vs/workbench/common/editor/textResourceEditorInput.js +146 -0
- package/dist/vscode/vs/workbench/common/editor/textResourceEditorModel.js +24 -0
- package/dist/vscode/vs/workbench/common/editor.js +307 -0
- package/dist/{memento.js → vscode/vs/workbench/common/memento.js} +1 -1
- package/dist/vscode/vs/workbench/common/notifications.js +448 -0
- package/dist/vscode/vs/workbench/common/resources.js +86 -0
- package/dist/{theme2.js → vscode/vs/workbench/common/theme.js} +1 -168
- package/dist/vscode/vs/workbench/common/views.js +20 -0
- package/dist/vscode/vs/workbench/contrib/audioCues/browser/audioCueDebuggerContribution.js +45 -0
- package/dist/vscode/vs/workbench/contrib/audioCues/browser/audioCueLineFeatureContribution.js +170 -0
- package/dist/vscode/vs/workbench/contrib/audioCues/browser/audioCues.contribution.js +160 -0
- package/dist/vscode/vs/workbench/contrib/audioCues/browser/commands.js +49 -0
- package/dist/vscode/vs/workbench/contrib/bulkEdit/browser/bulkCellEdits.js +25 -0
- package/dist/vscode/vs/workbench/contrib/callHierarchy/common/callHierarchy.js +126 -0
- package/dist/vscode/vs/workbench/contrib/codeEditor/browser/editorLineNumberMenu.js +100 -0
- package/dist/{languages.js → vscode/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.js} +154 -180
- package/dist/vscode/vs/workbench/contrib/codeEditor/browser/menuPreventer.js +35 -0
- package/dist/vscode/vs/workbench/contrib/codeEditor/browser/selectionClipboard.js +2 -0
- package/dist/vscode/vs/workbench/contrib/codeEditor/browser/simpleEditorOptions.js +50 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/baseDebugView.js +192 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +776 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/breakpointWidget.js +378 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/breakpointsView.js +714 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +172 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debug.contribution.js +451 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugActionViewItems.js +294 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugAdapterManager.js +397 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugColors.js +309 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugCommands.js +749 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +619 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugConsoleQuickAccess.js +58 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugEditorContribution.js +675 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugHover.js +317 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugIcons.js +135 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugMemory.js +204 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugQuickAccess.js +142 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugService.js +1171 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugSession.js +1134 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugSessionPicker.js +104 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugTaskRunner.js +273 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugToolBar.js +312 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/exceptionWidget.js +103 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/linkDetector.js +229 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/rawDebugSession.js +666 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/variablesView.js +287 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/abstractDebugAdapter.js +150 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/breakpoints.js +19 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/debug.js +285 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/debugCompoundRoot.js +15 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/debugContentProvider.js +96 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/debugModel.js +1451 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/debugSchemas.js +344 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/debugSource.js +121 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/debugStorage.js +148 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/debugTelemetry.js +34 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/debugUtils.js +292 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/debugViewModel.js +107 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/debugger.js +254 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/disassemblyViewInput.js +25 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +81 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/replModel.js +230 -0
- package/dist/vscode/vs/workbench/contrib/extensions/common/extensions.js +3 -0
- package/dist/vscode/vs/workbench/contrib/files/browser/editors/fileEditorInput.js +321 -0
- package/dist/vscode/vs/workbench/contrib/files/browser/explorerService.js +398 -0
- package/dist/vscode/vs/workbench/contrib/files/browser/files.contribution.js +389 -0
- package/dist/vscode/vs/workbench/contrib/files/browser/files.js +3 -0
- package/dist/vscode/vs/workbench/contrib/files/common/explorerFileNestingTrie.js +212 -0
- package/dist/vscode/vs/workbench/contrib/files/common/explorerModel.js +369 -0
- package/dist/{files2.js → vscode/vs/workbench/contrib/files/common/files.js} +1 -1
- package/dist/vscode/vs/workbench/contrib/markers/common/markers.js +20 -0
- package/dist/vscode/vs/workbench/contrib/notebook/common/notebookCommon.js +9 -0
- package/dist/vscode/vs/workbench/contrib/output/browser/outputLinkProvider.js +74 -0
- package/dist/vscode/vs/workbench/contrib/output/browser/outputServices.js +166 -0
- package/dist/vscode/vs/workbench/contrib/output/common/outputChannelModel.js +317 -0
- package/dist/vscode/vs/workbench/contrib/output/common/outputChannelModelService.js +31 -0
- package/dist/vscode/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +153 -0
- package/dist/vscode/vs/workbench/contrib/search/common/search.js +27 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/snippetCompletionProvider.js +159 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/snippets.js +3 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/snippetsFile.js +229 -0
- package/dist/{snippetsService.js → vscode/vs/workbench/contrib/snippets/browser/snippetsService.js} +28 -412
- package/dist/vscode/vs/workbench/contrib/snippets/browser/tabCompletion.js +166 -0
- package/dist/vscode/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.js +161 -0
- package/dist/vscode/vs/workbench/contrib/tasks/common/taskService.js +3 -0
- package/dist/vscode/vs/workbench/contrib/testing/common/testId.js +109 -0
- package/dist/vscode/vs/workbench/contrib/testing/common/testItemCollection.js +75 -0
- package/dist/vscode/vs/workbench/contrib/testing/common/testTypes.js +7 -0
- package/dist/vscode/vs/workbench/contrib/typeHierarchy/common/typeHierarchy.js +133 -0
- package/dist/vscode/vs/workbench/services/actions/common/menusExtensionPoint.js +829 -0
- package/dist/vscode/vs/workbench/services/activity/common/activity.js +22 -0
- package/dist/vscode/vs/workbench/services/configuration/browser/configuration.js +847 -0
- package/dist/vscode/vs/workbench/services/configuration/browser/configurationService.js +1104 -0
- package/dist/{configuration2.js → vscode/vs/workbench/services/configuration/common/configuration.js} +1 -1
- package/dist/vscode/vs/workbench/services/configuration/common/configurationCache.js +80 -0
- package/dist/vscode/vs/workbench/services/configuration/common/configurationEditing.js +590 -0
- package/dist/vscode/vs/workbench/services/configuration/common/configurationModels.js +119 -0
- package/dist/vscode/vs/workbench/services/configuration/common/jsonEditing.js +9 -0
- package/dist/vscode/vs/workbench/services/configuration/common/jsonEditingService.js +119 -0
- package/dist/vscode/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +303 -0
- package/dist/vscode/vs/workbench/services/configurationResolver/browser/configurationResolverService.js +26 -0
- package/dist/vscode/vs/workbench/services/configurationResolver/common/configurationResolver.js +36 -0
- package/dist/vscode/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +174 -0
- package/dist/vscode/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +10 -0
- package/dist/vscode/vs/workbench/services/configurationResolver/common/variableResolver.js +299 -0
- package/dist/vscode/vs/workbench/services/decorations/browser/decorationsService.js +312 -0
- package/dist/vscode/vs/workbench/services/decorations/common/decorations.js +3 -0
- package/dist/vscode/vs/workbench/services/dialogs/common/dialogService.js +65 -0
- package/dist/vscode/vs/workbench/services/editor/browser/codeEditorService.js +80 -0
- package/dist/vscode/vs/workbench/services/editor/common/editorGroupColumn.js +23 -0
- package/dist/vscode/vs/workbench/services/editor/common/editorGroupsService.js +14 -0
- package/dist/vscode/vs/workbench/services/editor/common/editorResolverService.js +31 -0
- package/dist/vscode/vs/workbench/services/editor/common/editorService.js +10 -0
- package/dist/vscode/vs/workbench/services/environment/browser/environmentService.js +4 -0
- package/dist/vscode/vs/workbench/services/environment/common/environmentService.js +4 -0
- package/dist/vscode/vs/workbench/services/extensionManagement/common/extensionManagement.js +6 -0
- package/dist/vscode/vs/workbench/services/extensions/common/extHostCustomers.js +40 -0
- package/dist/vscode/vs/workbench/services/extensions/common/extensionDescriptionRegistry.js +189 -0
- package/dist/vscode/vs/workbench/services/extensions/common/extensionDevOptions.js +23 -0
- package/dist/vscode/vs/workbench/services/extensions/common/extensionHostProtocol.js +6 -0
- package/dist/vscode/vs/workbench/services/extensions/common/extensions.js +57 -0
- package/dist/vscode/vs/workbench/services/extensions/common/extensionsApiProposals.js +74 -0
- package/dist/{extensionsRegistry.js → vscode/vs/workbench/services/extensions/common/extensionsRegistry.js} +87 -208
- package/dist/vscode/vs/workbench/services/extensions/common/lazyPromise.js +70 -0
- package/dist/vscode/vs/workbench/services/extensions/common/proxyIdentifier.js +23 -0
- package/dist/vscode/vs/workbench/services/extensions/common/remoteConsoleUtil.js +47 -0
- package/dist/vscode/vs/workbench/services/extensions/common/rpcProtocol.js +762 -0
- package/dist/vscode/vs/workbench/services/extensions/common/workspaceContains.js +92 -0
- package/dist/vscode/vs/workbench/services/files/browser/elevatedFileService.js +9 -0
- package/dist/vscode/vs/workbench/services/files/common/elevatedFileService.js +3 -0
- package/dist/vscode/vs/workbench/services/files/common/files.js +4 -0
- package/dist/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +124 -0
- package/dist/vscode/vs/workbench/services/history/common/history.js +3 -0
- package/dist/vscode/vs/workbench/services/host/browser/host.js +3 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keybindingService.js +855 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayoutService.js +490 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/cz.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/de-swiss.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/de.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/de.linux.js +180 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/de.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/dk.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/dvorak.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-belgian.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-ext.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-in.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-intl.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-intl.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-uk.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-uk.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en.darwin.js +133 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en.linux.js +182 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en.win.js +167 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/es-latin.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/es.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/es.linux.js +180 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/es.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.linux.js +180 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/hu.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/it.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/it.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/jp-roman.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/jp.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/ko.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.darwin.js +17 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.linux.js +6 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.win.js +23 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/no.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/pl.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/pl.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/pt-br.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/pt.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/pt.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.linux.js +180 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/sv.win.js +164 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/thai.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/tr.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/zh-hans.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/common/fallbackKeyboardMapper.js +28 -0
- package/dist/vscode/vs/workbench/services/keybinding/common/keybindingIO.js +72 -0
- package/dist/vscode/vs/workbench/services/keybinding/common/keymapInfo.js +108 -0
- package/dist/vscode/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.js +888 -0
- package/dist/vscode/vs/workbench/services/keybinding/common/windowsKeyboardMapper.js +350 -0
- package/dist/vscode/vs/workbench/services/label/common/labelService.js +302 -0
- package/dist/{languageService.js → vscode/vs/workbench/services/language/common/languageService.js} +8 -163
- package/dist/vscode/vs/workbench/services/languageDetection/common/languageDetectionWorkerService.js +5 -0
- package/dist/vscode/vs/workbench/services/languageStatus/common/languageStatusService.js +3 -0
- package/dist/vscode/vs/workbench/services/layout/browser/layoutService.js +12 -0
- package/dist/vscode/vs/workbench/services/lifecycle/common/lifecycle.js +11 -0
- package/dist/vscode/vs/workbench/services/lifecycle/common/lifecycleService.js +85 -0
- package/dist/vscode/vs/workbench/services/notification/common/notificationService.js +186 -0
- package/dist/vscode/vs/workbench/services/output/common/output.js +51 -0
- package/dist/vscode/vs/workbench/services/panecomposite/browser/panecomposite.js +3 -0
- package/dist/vscode/vs/workbench/services/path/browser/pathService.js +34 -0
- package/dist/vscode/vs/workbench/services/path/common/pathService.js +107 -0
- package/dist/vscode/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +35 -0
- package/dist/vscode/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +555 -0
- package/dist/vscode/vs/workbench/services/preferences/browser/preferencesService.js +547 -0
- package/dist/vscode/vs/workbench/services/preferences/common/preferences.js +20 -0
- package/dist/vscode/vs/workbench/services/preferences/common/preferencesEditorInput.js +37 -0
- package/dist/vscode/vs/workbench/services/preferences/common/preferencesModels.js +1031 -0
- package/dist/vscode/vs/workbench/services/preferences/common/preferencesValidation.js +357 -0
- package/dist/vscode/vs/workbench/services/progress/browser/progressIndicator.js +174 -0
- package/dist/vscode/vs/workbench/services/remote/common/remoteAgentService.js +3 -0
- package/dist/vscode/vs/workbench/services/search/common/queryBuilder.js +428 -0
- package/dist/vscode/vs/workbench/services/search/common/search.js +158 -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/textMate/browser/arrayOperation.js +62 -0
- package/dist/vscode/vs/workbench/services/textMate/browser/textMateTokenizationFeature.js +3 -0
- package/dist/vscode/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.js +422 -0
- package/dist/vscode/vs/workbench/services/textMate/browser/tokenizationSupport/textMateTokenizationSupport.js +60 -0
- package/dist/vscode/vs/workbench/services/textMate/browser/tokenizationSupport/tokenizationSupportWithLineLimit.js +36 -0
- package/dist/vscode/vs/workbench/services/textMate/browser/workerHost/textMateWorkerHost.js +198 -0
- package/dist/vscode/vs/workbench/services/textMate/browser/workerHost/textMateWorkerTokenizerController.js +151 -0
- package/dist/vscode/vs/workbench/services/textMate/common/TMGrammarFactory.js +117 -0
- package/dist/vscode/vs/workbench/services/textMate/common/TMGrammars.js +93 -0
- package/dist/vscode/vs/workbench/services/textMate/common/TMScopeRegistry.js +24 -0
- package/dist/vscode/vs/workbench/services/textfile/browser/browserTextFileService.js +55 -0
- package/dist/vscode/vs/workbench/services/textfile/browser/textFileService.js +578 -0
- package/dist/vscode/vs/workbench/services/textfile/common/encoding.js +493 -0
- package/dist/vscode/vs/workbench/services/textfile/common/textEditorService.js +150 -0
- package/dist/vscode/vs/workbench/services/textfile/common/textFileEditorModel.js +711 -0
- package/dist/vscode/vs/workbench/services/textfile/common/textFileEditorModelManager.js +401 -0
- package/dist/vscode/vs/workbench/services/textfile/common/textFileSaveParticipant.js +54 -0
- package/dist/vscode/vs/workbench/services/textfile/common/textfiles.js +45 -0
- package/dist/vscode/vs/workbench/services/textmodelResolver/common/textModelResolverService.js +187 -0
- package/dist/vscode/vs/workbench/services/themes/browser/browserHostColorSchemeService.js +37 -0
- package/dist/vscode/vs/workbench/services/themes/browser/fileIconThemeData.js +353 -0
- package/dist/vscode/vs/workbench/services/themes/browser/productIconThemeData.js +291 -0
- package/dist/vscode/vs/workbench/services/themes/browser/workbenchThemeService.js +736 -0
- package/dist/vscode/vs/workbench/services/themes/common/colorExtensionPoint.js +171 -0
- package/dist/vscode/vs/workbench/services/themes/common/colorThemeData.js +864 -0
- package/dist/vscode/vs/workbench/services/themes/common/colorThemeSchema.js +265 -0
- package/dist/vscode/vs/workbench/services/themes/common/fileIconThemeSchema.js +303 -0
- package/dist/vscode/vs/workbench/services/themes/common/hostColorSchemeService.js +3 -0
- package/dist/vscode/vs/workbench/services/themes/common/plistParser.js +439 -0
- package/dist/vscode/vs/workbench/services/themes/common/productIconThemeSchema.js +94 -0
- package/dist/vscode/vs/workbench/services/themes/common/textMateScopeMatcher.js +120 -0
- package/dist/vscode/vs/workbench/services/themes/common/themeCompatibility.js +66 -0
- package/dist/vscode/vs/workbench/services/themes/common/themeConfiguration.js +374 -0
- package/dist/vscode/vs/workbench/services/themes/common/themeExtensionPoints.js +258 -0
- package/dist/vscode/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +268 -0
- package/dist/vscode/vs/workbench/services/themes/common/workbenchThemeService.js +46 -0
- package/dist/vscode/vs/workbench/services/timer/browser/timerService.js +3 -0
- package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorInput.js +122 -0
- package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorModel.js +240 -0
- package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorService.js +3 -0
- package/dist/vscode/vs/workbench/services/userData/browser/userDataInit.js +3 -0
- package/dist/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.js +7 -0
- package/dist/vscode/vs/workbench/services/userDataProfile/common/userDataProfileService.js +52 -0
- package/dist/vscode/vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant.js +55 -0
- package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopy.js +2 -0
- package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyBackup.js +3 -0
- package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyBackupService.js +414 -0
- package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyFileOperationParticipant.js +39 -0
- package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService.js +181 -0
- package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyService.js +112 -0
- package/dist/vscode/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.js +325 -0
- package/dist/vscode/vs/workbench/services/workspaces/browser/workspaces.js +11 -0
- package/dist/vscode/vs/workbench/services/workspaces/browser/workspacesService.js +154 -0
- package/dist/vscode/vs/workbench/services/workspaces/common/workspaceEditing.js +3 -0
- package/dist/vscode-default-extensions/bat/package.json.js +2 -0
- package/dist/vscode-default-extensions/clojure/package.json.js +2 -0
- package/dist/vscode-default-extensions/coffeescript/package.json.js +2 -0
- package/dist/vscode-default-extensions/cpp/package.json.js +2 -0
- package/dist/vscode-default-extensions/csharp/package.json.js +2 -0
- package/dist/vscode-default-extensions/css/package.json.js +2 -0
- package/dist/vscode-default-extensions/dart/package.json.js +2 -0
- package/dist/vscode-default-extensions/diff/package.json.js +2 -0
- package/dist/vscode-default-extensions/docker/package.json.js +2 -0
- package/dist/vscode-default-extensions/fsharp/package.json.js +2 -0
- package/dist/vscode-default-extensions/go/package.json.js +2 -0
- package/dist/vscode-default-extensions/groovy/package.json.js +2 -0
- package/dist/vscode-default-extensions/handlebars/package.json.js +2 -0
- package/dist/vscode-default-extensions/hlsl/package.json.js +2 -0
- package/dist/vscode-default-extensions/html/package.json.js +2 -0
- package/dist/vscode-default-extensions/ini/package.json.js +2 -0
- package/dist/vscode-default-extensions/java/package.json.js +2 -0
- package/dist/vscode-default-extensions/javascript/package.json.js +2 -0
- package/dist/vscode-default-extensions/json/package.json.js +2 -0
- package/dist/vscode-default-extensions/julia/package.json.js +2 -0
- package/dist/vscode-default-extensions/latex/package.json.js +2 -0
- package/dist/vscode-default-extensions/less/package.json.js +2 -0
- package/dist/vscode-default-extensions/log/package.json.js +2 -0
- package/dist/vscode-default-extensions/lua/package.json.js +2 -0
- package/dist/vscode-default-extensions/make/package.json.js +2 -0
- package/dist/vscode-default-extensions/markdown-basics/package.json.js +2 -0
- package/dist/vscode-default-extensions/objective-c/package.json.js +2 -0
- package/dist/vscode-default-extensions/perl/package.json.js +2 -0
- package/dist/vscode-default-extensions/php/package.json.js +2 -0
- package/dist/vscode-default-extensions/powershell/package.json.js +2 -0
- package/dist/vscode-default-extensions/pug/package.json.js +2 -0
- package/dist/vscode-default-extensions/python/package.json.js +2 -0
- package/dist/vscode-default-extensions/r/package.json.js +2 -0
- package/dist/vscode-default-extensions/razor/package.json.js +2 -0
- package/dist/vscode-default-extensions/ruby/package.json.js +2 -0
- package/dist/vscode-default-extensions/rust/package.json.js +2 -0
- package/dist/vscode-default-extensions/scss/package.json.js +2 -0
- package/dist/vscode-default-extensions/shaderlab/package.json.js +2 -0
- package/dist/vscode-default-extensions/shellscript/package.json.js +2 -0
- package/dist/vscode-default-extensions/sql/package.json.js +2 -0
- package/dist/vscode-default-extensions/swift/package.json.js +2 -0
- package/dist/vscode-default-extensions/theme-abyss/package.json.js +2 -0
- package/dist/vscode-default-extensions/theme-defaults/package.json.js +2 -0
- package/dist/vscode-default-extensions/theme-kimbie-dark/package.json.js +2 -0
- package/dist/vscode-default-extensions/theme-monokai/package.json.js +2 -0
- package/dist/vscode-default-extensions/theme-monokai-dimmed/package.json.js +2 -0
- package/dist/vscode-default-extensions/theme-quietlight/package.json.js +2 -0
- package/dist/vscode-default-extensions/theme-red/package.json.js +2 -0
- package/dist/vscode-default-extensions/theme-seti/package.json.js +2 -0
- package/dist/vscode-default-extensions/theme-solarized-dark/package.json.js +2 -0
- package/dist/vscode-default-extensions/theme-solarized-light/package.json.js +2 -0
- package/dist/vscode-default-extensions/theme-tomorrow-night-blue/package.json.js +2 -0
- package/dist/vscode-default-extensions/typescript-basics/package.json.js +2 -0
- package/dist/vscode-default-extensions/typescript-language-features/package.json.js +2 -0
- package/dist/vscode-default-extensions/vb/package.json.js +2 -0
- package/dist/vscode-default-extensions/xml/package.json.js +2 -0
- package/dist/vscode-default-extensions/yaml/package.json.js +2 -0
- package/dist/vscode-services/commands.js +37 -0
- package/dist/vscode-services/debug.js +74 -0
- package/dist/vscode-services/env.js +69 -0
- package/dist/vscode-services/extHost.js +385 -0
- package/dist/vscode-services/extensions.js +46 -0
- package/dist/vscode-services/languages.js +203 -0
- package/dist/vscode-services/missing-services.js +959 -0
- package/dist/vscode-services/window.js +189 -0
- package/dist/vscode-services/workspace.js +164 -0
- package/monaco-editor-treemending.patch +23574 -0
- package/monaco-treemending.js +3 -0
- package/package.json +55 -59
- package/dist/api2.js +0 -1294
- package/dist/audioCue.js +0 -805
- package/dist/button.js +0 -352
- package/dist/configuration.js +0 -4438
- package/dist/debug.js +0 -15673
- package/dist/dialogs.js +0 -752
- package/dist/dom.js +0 -101
- package/dist/files.js +0 -3167
- package/dist/keybindings.js +0 -4310
- package/dist/layout.contribution.darwin.js +0 -1994
- package/dist/layout.contribution.linux.js +0 -899
- package/dist/layout.contribution.win.js +0 -3551
- package/dist/modelEditor.js +0 -8893
- package/dist/notifications.js +0 -2302
- package/dist/platform.js +0 -105
- package/dist/polyfill.js +0 -55651
- package/dist/preferences.js +0 -2532
- package/dist/textmate.js +0 -1428
- package/dist/theme.js +0 -4116
- package/dist/utils.js +0 -345
- package/dist/webpack-loader.cjs +0 -18
- package/dist/webpack-loader.d.ts +0 -4
- package/dist/{iconv.js → override/iconv.js} +0 -0
- package/dist/{jschardet.js → override/jschardet.js} +0 -0
- package/dist/{audioCue.d.ts → service-override/audioCue.d.ts} +0 -0
- package/dist/{configuration.d.ts → service-override/configuration.d.ts} +0 -0
- package/dist/{debug.d.ts → service-override/debug.d.ts} +0 -0
- package/dist/{dialogs.d.ts → service-override/dialogs.d.ts} +0 -0
- package/dist/{files.d.ts → service-override/files.d.ts} +0 -0
- package/dist/{keybindings.d.ts → service-override/keybindings.d.ts} +0 -0
- package/dist/{languages.d.ts → service-override/languages.d.ts} +0 -0
- package/dist/{modelEditor.d.ts → service-override/modelEditor.d.ts} +0 -0
- package/dist/{notifications.d.ts → service-override/notifications.d.ts} +0 -0
- package/dist/{preferences.d.ts → service-override/preferences.d.ts} +0 -0
- package/dist/{snippets.d.ts → service-override/snippets.d.ts} +0 -0
- package/dist/{textmate.d.ts → service-override/textmate.d.ts} +0 -0
- package/dist/{theme.d.ts → service-override/theme.d.ts} +0 -0
- package/dist/{injection.js → tools/injection.js} +0 -0
- package/dist/{jsonErrorMessages.js → vscode/vs/base/common/jsonErrorMessages.js} +0 -0
- package/dist/{_.contribution.js → vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/_.contribution.js} +0 -0
- package/dist/{unboundCommands.js → vscode/vs/workbench/services/keybinding/browser/unboundCommands.js} +2 -2
- /package/dist/{language-configuration.js → vscode-default-extensions/bat/language-configuration.json.js} +0 -0
- /package/dist/{batchfile.js → vscode-default-extensions/bat/snippets/batchfile.code-snippets.js} +0 -0
- /package/dist/{batchfile.tmLanguage.js → vscode-default-extensions/bat/syntaxes/batchfile.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration2.js → vscode-default-extensions/clojure/language-configuration.json.js} +0 -0
- /package/dist/{clojure.tmLanguage.js → vscode-default-extensions/clojure/syntaxes/clojure.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration3.js → vscode-default-extensions/coffeescript/language-configuration.json.js} +0 -0
- /package/dist/{coffeescript.js → vscode-default-extensions/coffeescript/snippets/coffeescript.code-snippets.js} +0 -0
- /package/dist/{coffeescript.tmLanguage.js → vscode-default-extensions/coffeescript/syntaxes/coffeescript.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration4.js → vscode-default-extensions/cpp/language-configuration.json.js} +0 -0
- /package/dist/{c.js → vscode-default-extensions/cpp/snippets/c.code-snippets.js} +0 -0
- /package/dist/{cpp.js → vscode-default-extensions/cpp/snippets/cpp.code-snippets.js} +0 -0
- /package/dist/{c.tmLanguage.js → vscode-default-extensions/cpp/syntaxes/c.tmLanguage.json.js} +0 -0
- /package/dist/{cpp.embedded.macro.tmLanguage.js → vscode-default-extensions/cpp/syntaxes/cpp.embedded.macro.tmLanguage.json.js} +0 -0
- /package/dist/{cpp.tmLanguage.js → vscode-default-extensions/cpp/syntaxes/cpp.tmLanguage.json.js} +0 -0
- /package/dist/{cuda-cpp.tmLanguage.js → vscode-default-extensions/cpp/syntaxes/cuda-cpp.tmLanguage.json.js} +0 -0
- /package/dist/{platform.tmLanguage.js → vscode-default-extensions/cpp/syntaxes/platform.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration5.js → vscode-default-extensions/csharp/language-configuration.json.js} +0 -0
- /package/dist/{csharp.js → vscode-default-extensions/csharp/snippets/csharp.code-snippets.js} +0 -0
- /package/dist/{csharp.tmLanguage.js → vscode-default-extensions/csharp/syntaxes/csharp.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration6.js → vscode-default-extensions/css/language-configuration.json.js} +0 -0
- /package/dist/{css.tmLanguage.js → vscode-default-extensions/css/syntaxes/css.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration7.js → vscode-default-extensions/dart/language-configuration.json.js} +0 -0
- /package/dist/{dart.tmLanguage.js → vscode-default-extensions/dart/syntaxes/dart.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration8.js → vscode-default-extensions/diff/language-configuration.json.js} +0 -0
- /package/dist/{diff.tmLanguage.js → vscode-default-extensions/diff/syntaxes/diff.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration9.js → vscode-default-extensions/docker/language-configuration.json.js} +0 -0
- /package/dist/{docker.tmLanguage.js → vscode-default-extensions/docker/syntaxes/docker.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration10.js → vscode-default-extensions/fsharp/language-configuration.json.js} +0 -0
- /package/dist/{fsharp.js → vscode-default-extensions/fsharp/snippets/fsharp.code-snippets.js} +0 -0
- /package/dist/{fsharp.tmLanguage.js → vscode-default-extensions/fsharp/syntaxes/fsharp.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration11.js → vscode-default-extensions/go/language-configuration.json.js} +0 -0
- /package/dist/{go.tmLanguage.js → vscode-default-extensions/go/syntaxes/go.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration12.js → vscode-default-extensions/groovy/language-configuration.json.js} +0 -0
- /package/dist/{groovy.js → vscode-default-extensions/groovy/snippets/groovy.code-snippets.js} +0 -0
- /package/dist/{groovy.tmLanguage.js → vscode-default-extensions/groovy/syntaxes/groovy.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration13.js → vscode-default-extensions/handlebars/language-configuration.json.js} +0 -0
- /package/dist/{Handlebars.tmLanguage.js → vscode-default-extensions/handlebars/syntaxes/Handlebars.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration14.js → vscode-default-extensions/hlsl/language-configuration.json.js} +0 -0
- /package/dist/{hlsl.tmLanguage.js → vscode-default-extensions/hlsl/syntaxes/hlsl.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration15.js → vscode-default-extensions/html/language-configuration.json.js} +0 -0
- /package/dist/{html.js → vscode-default-extensions/html/snippets/html.code-snippets.js} +0 -0
- /package/dist/{html-derivative.tmLanguage.js → vscode-default-extensions/html/syntaxes/html-derivative.tmLanguage.json.js} +0 -0
- /package/dist/{html.tmLanguage.js → vscode-default-extensions/html/syntaxes/html.tmLanguage.json.js} +0 -0
- /package/dist/{ini.language-configuration.js → vscode-default-extensions/ini/ini.language-configuration.json.js} +0 -0
- /package/dist/{properties.language-configuration.js → vscode-default-extensions/ini/properties.language-configuration.json.js} +0 -0
- /package/dist/{ini.tmLanguage.js → vscode-default-extensions/ini/syntaxes/ini.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration16.js → vscode-default-extensions/java/language-configuration.json.js} +0 -0
- /package/dist/{java.js → vscode-default-extensions/java/snippets/java.code-snippets.js} +0 -0
- /package/dist/{java.tmLanguage.js → vscode-default-extensions/java/syntaxes/java.tmLanguage.json.js} +0 -0
- /package/dist/{javascript-language-configuration.js → vscode-default-extensions/javascript/javascript-language-configuration.json.js} +0 -0
- /package/dist/{javascript.js → vscode-default-extensions/javascript/snippets/javascript.code-snippets.js} +0 -0
- /package/dist/{JavaScript.tmLanguage.js → vscode-default-extensions/javascript/syntaxes/JavaScript.tmLanguage.json.js} +0 -0
- /package/dist/{JavaScriptReact.tmLanguage.js → vscode-default-extensions/javascript/syntaxes/JavaScriptReact.tmLanguage.json.js} +0 -0
- /package/dist/{Regular Expressions (JavaScript).js → vscode-default-extensions/javascript/syntaxes/Regular Expressions (JavaScript).tmLanguage.js} +0 -0
- /package/dist/{tags-language-configuration.js → vscode-default-extensions/javascript/tags-language-configuration.json.js} +0 -0
- /package/dist/{language-configuration17.js → vscode-default-extensions/json/language-configuration.json.js} +0 -0
- /package/dist/{JSON.tmLanguage.js → vscode-default-extensions/json/syntaxes/JSON.tmLanguage.json.js} +0 -0
- /package/dist/{JSONC.tmLanguage.js → vscode-default-extensions/json/syntaxes/JSONC.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration18.js → vscode-default-extensions/julia/language-configuration.json.js} +0 -0
- /package/dist/{julia.tmLanguage.js → vscode-default-extensions/julia/syntaxes/julia.tmLanguage.json.js} +0 -0
- /package/dist/{latex-cpp-embedded-language-configuration.js → vscode-default-extensions/latex/latex-cpp-embedded-language-configuration.json.js} +0 -0
- /package/dist/{latex-language-configuration.js → vscode-default-extensions/latex/latex-language-configuration.json.js} +0 -0
- /package/dist/{markdown-latex-combined-language-configuration.js → vscode-default-extensions/latex/markdown-latex-combined-language-configuration.json.js} +0 -0
- /package/dist/{Bibtex.tmLanguage.js → vscode-default-extensions/latex/syntaxes/Bibtex.tmLanguage.json.js} +0 -0
- /package/dist/{LaTeX.tmLanguage.js → vscode-default-extensions/latex/syntaxes/LaTeX.tmLanguage.json.js} +0 -0
- /package/dist/{TeX.tmLanguage.js → vscode-default-extensions/latex/syntaxes/TeX.tmLanguage.json.js} +0 -0
- /package/dist/{cpp-grammar-bailout.tmLanguage.js → vscode-default-extensions/latex/syntaxes/cpp-grammar-bailout.tmLanguage.json.js} +0 -0
- /package/dist/{markdown-latex-combined.tmLanguage.js → vscode-default-extensions/latex/syntaxes/markdown-latex-combined.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration19.js → vscode-default-extensions/less/language-configuration.json.js} +0 -0
- /package/dist/{less.tmLanguage.js → vscode-default-extensions/less/syntaxes/less.tmLanguage.json.js} +0 -0
- /package/dist/{log.tmLanguage.js → vscode-default-extensions/log/syntaxes/log.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration20.js → vscode-default-extensions/lua/language-configuration.json.js} +0 -0
- /package/dist/{lua.tmLanguage.js → vscode-default-extensions/lua/syntaxes/lua.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration21.js → vscode-default-extensions/make/language-configuration.json.js} +0 -0
- /package/dist/{make.tmLanguage.js → vscode-default-extensions/make/syntaxes/make.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration22.js → vscode-default-extensions/markdown-basics/language-configuration.json.js} +0 -0
- /package/dist/{markdown.js → vscode-default-extensions/markdown-basics/snippets/markdown.code-snippets.js} +0 -0
- /package/dist/{markdown.tmLanguage.js → vscode-default-extensions/markdown-basics/syntaxes/markdown.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration23.js → vscode-default-extensions/objective-c/language-configuration.json.js} +0 -0
- /package/dist/{objective-c.tmLanguage.js → vscode-default-extensions/objective-c/syntaxes/objective-c.tmLanguage.json.js} +0 -0
- /package/dist/{objective-c__.tmLanguage.js → vscode-default-extensions/objective-c/syntaxes/objective-c__.tmLanguage.json.js} +0 -0
- /package/dist/{perl.language-configuration.js → vscode-default-extensions/perl/perl.language-configuration.json.js} +0 -0
- /package/dist/{perl6.language-configuration.js → vscode-default-extensions/perl/perl6.language-configuration.json.js} +0 -0
- /package/dist/{perl.tmLanguage.js → vscode-default-extensions/perl/syntaxes/perl.tmLanguage.json.js} +0 -0
- /package/dist/{perl6.tmLanguage.js → vscode-default-extensions/perl/syntaxes/perl6.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration24.js → vscode-default-extensions/php/language-configuration.json.js} +0 -0
- /package/dist/{php.js → vscode-default-extensions/php/snippets/php.code-snippets.js} +0 -0
- /package/dist/{html.tmLanguage2.js → vscode-default-extensions/php/syntaxes/html.tmLanguage.json.js} +0 -0
- /package/dist/{php.tmLanguage.js → vscode-default-extensions/php/syntaxes/php.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration25.js → vscode-default-extensions/powershell/language-configuration.json.js} +0 -0
- /package/dist/{powershell.tmLanguage.js → vscode-default-extensions/powershell/syntaxes/powershell.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration26.js → vscode-default-extensions/pug/language-configuration.json.js} +0 -0
- /package/dist/{pug.tmLanguage.js → vscode-default-extensions/pug/syntaxes/pug.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration27.js → vscode-default-extensions/python/language-configuration.json.js} +0 -0
- /package/dist/{MagicPython.tmLanguage.js → vscode-default-extensions/python/syntaxes/MagicPython.tmLanguage.json.js} +0 -0
- /package/dist/{MagicRegExp.tmLanguage.js → vscode-default-extensions/python/syntaxes/MagicRegExp.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration28.js → vscode-default-extensions/r/language-configuration.json.js} +0 -0
- /package/dist/{r.tmLanguage.js → vscode-default-extensions/r/syntaxes/r.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration29.js → vscode-default-extensions/razor/language-configuration.json.js} +0 -0
- /package/dist/{cshtml.tmLanguage.js → vscode-default-extensions/razor/syntaxes/cshtml.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration30.js → vscode-default-extensions/ruby/language-configuration.json.js} +0 -0
- /package/dist/{ruby.tmLanguage.js → vscode-default-extensions/ruby/syntaxes/ruby.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration31.js → vscode-default-extensions/rust/language-configuration.json.js} +0 -0
- /package/dist/{rust.tmLanguage.js → vscode-default-extensions/rust/syntaxes/rust.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration32.js → vscode-default-extensions/scss/language-configuration.json.js} +0 -0
- /package/dist/{sassdoc.tmLanguage.js → vscode-default-extensions/scss/syntaxes/sassdoc.tmLanguage.json.js} +0 -0
- /package/dist/{scss.tmLanguage.js → vscode-default-extensions/scss/syntaxes/scss.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration33.js → vscode-default-extensions/shaderlab/language-configuration.json.js} +0 -0
- /package/dist/{shaderlab.tmLanguage.js → vscode-default-extensions/shaderlab/syntaxes/shaderlab.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration34.js → vscode-default-extensions/shellscript/language-configuration.json.js} +0 -0
- /package/dist/{shell-unix-bash.tmLanguage.js → vscode-default-extensions/shellscript/syntaxes/shell-unix-bash.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration35.js → vscode-default-extensions/sql/language-configuration.json.js} +0 -0
- /package/dist/{sql.tmLanguage.js → vscode-default-extensions/sql/syntaxes/sql.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration36.js → vscode-default-extensions/swift/language-configuration.json.js} +0 -0
- /package/dist/{swift.js → vscode-default-extensions/swift/snippets/swift.code-snippets.js} +0 -0
- /package/dist/{swift.tmLanguage.js → vscode-default-extensions/swift/syntaxes/swift.tmLanguage.json.js} +0 -0
- /package/dist/{abyss-color-theme.js → vscode-default-extensions/theme-abyss/themes/abyss-color-theme.json.js} +0 -0
- /package/dist/{vs_minimal-icon-theme.js → vscode-default-extensions/theme-defaults/fileicons/vs_minimal-icon-theme.json.js} +0 -0
- /package/dist/{dark_plus.js → vscode-default-extensions/theme-defaults/themes/dark_plus.json.js} +0 -0
- /package/dist/{dark_plus_experimental.js → vscode-default-extensions/theme-defaults/themes/dark_plus_experimental.json.js} +0 -0
- /package/dist/{dark_vs.js → vscode-default-extensions/theme-defaults/themes/dark_vs.json.js} +0 -0
- /package/dist/{hc_black.js → vscode-default-extensions/theme-defaults/themes/hc_black.json.js} +0 -0
- /package/dist/{hc_light.js → vscode-default-extensions/theme-defaults/themes/hc_light.json.js} +0 -0
- /package/dist/{light_plus.js → vscode-default-extensions/theme-defaults/themes/light_plus.json.js} +0 -0
- /package/dist/{light_plus_experimental.js → vscode-default-extensions/theme-defaults/themes/light_plus_experimental.json.js} +0 -0
- /package/dist/{light_vs.js → vscode-default-extensions/theme-defaults/themes/light_vs.json.js} +0 -0
- /package/dist/{kimbie-dark-color-theme.js → vscode-default-extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json.js} +0 -0
- /package/dist/{monokai-color-theme.js → vscode-default-extensions/theme-monokai/themes/monokai-color-theme.json.js} +0 -0
- /package/dist/{dimmed-monokai-color-theme.js → vscode-default-extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json.js} +0 -0
- /package/dist/{quietlight-color-theme.js → vscode-default-extensions/theme-quietlight/themes/quietlight-color-theme.json.js} +0 -0
- /package/dist/{Red-color-theme.js → vscode-default-extensions/theme-red/themes/Red-color-theme.json.js} +0 -0
- /package/dist/{vs-seti-icon-theme.js → vscode-default-extensions/theme-seti/icons/vs-seti-icon-theme.json.js} +0 -0
- /package/dist/{solarized-dark-color-theme.js → vscode-default-extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json.js} +0 -0
- /package/dist/{solarized-light-color-theme.js → vscode-default-extensions/theme-solarized-light/themes/solarized-light-color-theme.json.js} +0 -0
- /package/dist/{tomorrow-night-blue-color-theme.js → vscode-default-extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-color-theme.json.js} +0 -0
- /package/dist/{language-configuration37.js → vscode-default-extensions/typescript-basics/language-configuration.json.js} +0 -0
- /package/dist/{typescript.js → vscode-default-extensions/typescript-basics/snippets/typescript.code-snippets.js} +0 -0
- /package/dist/{TypeScript.tmLanguage.js → vscode-default-extensions/typescript-basics/syntaxes/TypeScript.tmLanguage.json.js} +0 -0
- /package/dist/{TypeScriptReact.tmLanguage.js → vscode-default-extensions/typescript-basics/syntaxes/TypeScriptReact.tmLanguage.json.js} +0 -0
- /package/dist/{jsdoc.js.injection.tmLanguage.js → vscode-default-extensions/typescript-basics/syntaxes/jsdoc.js.injection.tmLanguage.json.js} +0 -0
- /package/dist/{jsdoc.ts.injection.tmLanguage.js → vscode-default-extensions/typescript-basics/syntaxes/jsdoc.ts.injection.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration38.js → vscode-default-extensions/vb/language-configuration.json.js} +0 -0
- /package/dist/{vb.js → vscode-default-extensions/vb/snippets/vb.code-snippets.js} +0 -0
- /package/dist/{asp-vb-net.tmlanguage.js → vscode-default-extensions/vb/syntaxes/asp-vb-net.tmlanguage.json.js} +0 -0
- /package/dist/{xml.tmLanguage.js → vscode-default-extensions/xml/syntaxes/xml.tmLanguage.json.js} +0 -0
- /package/dist/{xsl.tmLanguage.js → vscode-default-extensions/xml/syntaxes/xsl.tmLanguage.json.js} +0 -0
- /package/dist/{xml.language-configuration.js → vscode-default-extensions/xml/xml.language-configuration.json.js} +0 -0
- /package/dist/{xsl.language-configuration.js → vscode-default-extensions/xml/xsl.language-configuration.json.js} +0 -0
- /package/dist/{language-configuration39.js → vscode-default-extensions/yaml/language-configuration.json.js} +0 -0
- /package/dist/{yaml.tmLanguage.js → vscode-default-extensions/yaml/syntaxes/yaml.tmLanguage.json.js} +0 -0
package/dist/files.js
DELETED
|
@@ -1,3167 +0,0 @@
|
|
|
1
|
-
import { __decorate, EditorExtensions, FILES_EXCLUDE_CONFIG, FILES_ASSOCIATIONS_CONFIG, SUPPORTED_ENCODINGS, AutoSaveConfiguration, Emitter, createFileSystemProviderError, AbstractTextResourceEditorInput, DEFAULT_EDITOR_ASSOCIATION, findViewStateForEditor, isResourceEditorInput, __param, HotExitConfiguration, FileType, FileSystemProviderError, FileSystemProviderErrorCode, IFileService, ITextFileService, BrowserTextFileService, EditorModel, getLargeFileConfirmationLimit, ByteSize, IFilesConfigurationService, IEditorService, IPathService, IUriIdentityService, IHostService, ResourceQueue, mark, FileChangesEvent, FileOperationError, hasOpenReadWriteCloseCapability, hasReadWriteCapability, hasFileReadStreamCapability, toFileSystemProviderErrorCode, ensureFileSystemProviderError, FilePermission, etag, FileOperationEvent, isReadableStream, peekStream, peekReadable, bufferToReadable, toFileOperationResult, ETAG_DISABLED, streamToBuffer, hasFileAtomicReadCapability, consumeStream, NotModifiedSinceFileOperationError, TooLargeFileOperationError, transform, hasFileFolderCopyCapability, hasFileCloneCapability, isReadableBufferedStream, listenStream, bufferedStreamToBuffer, readableToBuffer, isEqual as isEqual$1, CancellationTokenSource, newWriteableBufferStream, newWriteableStream } from './polyfill.js';
|
|
2
|
-
export { FileChangeType$1 as FileChangeType, FileSystemProviderCapabilities } from './polyfill.js';
|
|
3
|
-
import { VSBuffer } from 'monaco-editor/esm/vs/base/common/buffer.js';
|
|
4
|
-
import { canceled, ErrorNoTelemetry } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
5
|
-
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
6
|
-
import { Disposable, DisposableStore, dispose, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
7
|
-
import { RunOnceScheduler, Promises } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
8
|
-
import { Iterable } from 'monaco-editor/esm/vs/base/common/iterator.js';
|
|
9
|
-
import { basename, dirname, isEqual, relativePath, joinPath, isAbsolutePath, extUri, extUriIgnorePathCase, basenameOrAuthority, isEqualOrParent } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
10
|
-
import { TernarySearchTree } from 'monaco-editor/esm/vs/base/common/ternarySearchTree.js';
|
|
11
|
-
import { coalesce } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
12
|
-
import { hash } from 'monaco-editor/esm/vs/base/common/hash.js';
|
|
13
|
-
import { CancellationToken } from 'monaco-editor/esm/vs/base/common/cancellation.js';
|
|
14
|
-
import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
15
|
-
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
16
|
-
import { FILE_EDITOR_INPUT_ID, BINARY_TEXT_FILE_MODE, BINARY_FILE_EDITOR_ID, TEXT_FILE_EDITOR_ID } from './files2.js';
|
|
17
|
-
import { Mimes } from 'monaco-editor/esm/vs/base/common/mime.js';
|
|
18
|
-
import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
19
|
-
import { createTextBufferFactory } from 'monaco-editor/esm/vs/editor/common/model/textModel.js';
|
|
20
|
-
import { createDecorator, IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
21
|
-
import { ITextModelService } from 'monaco-editor/esm/vs/editor/common/services/resolverService.js';
|
|
22
|
-
import { ILabelService } from 'monaco-editor/esm/vs/platform/label/common/label.js';
|
|
23
|
-
import { ITextResourceConfigurationService } from 'monaco-editor/esm/vs/editor/common/services/textResourceConfiguration.js';
|
|
24
|
-
import { assertIsDefined } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
25
|
-
import { equalsIgnoreCase, startsWithIgnoreCase, rtrim } from 'monaco-editor/esm/vs/base/common/strings.js';
|
|
26
|
-
import { posix } from 'monaco-editor/esm/vs/base/common/path.js';
|
|
27
|
-
import { memoize } from 'monaco-editor/esm/vs/base/common/decorators.js';
|
|
28
|
-
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
29
|
-
import { ResourceMap } from 'monaco-editor/esm/vs/base/common/map.js';
|
|
30
|
-
import { equals, deepClone } from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
31
|
-
import { parse } from 'monaco-editor/esm/vs/base/common/glob.js';
|
|
32
|
-
import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
|
|
33
|
-
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
34
|
-
import { IUndoRedoService, UndoRedoSource } from 'monaco-editor/esm/vs/platform/undoRedo/common/undoRedo.js';
|
|
35
|
-
import { IClipboardService } from 'monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js';
|
|
36
|
-
import { IBulkEditService } from 'monaco-editor/esm/vs/editor/browser/services/bulkEditService.js';
|
|
37
|
-
import { IProgressService } from 'monaco-editor/esm/vs/platform/progress/common/progress.js';
|
|
38
|
-
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
39
|
-
import { isWeb, isNative } from 'monaco-editor/esm/vs/base/common/platform.js';
|
|
40
|
-
import { editorConfigurationBaseNode } from 'monaco-editor/esm/vs/editor/common/config/editorConfigurationSchema.js';
|
|
41
|
-
import { RedoCommand } from 'monaco-editor/esm/vs/editor/browser/editorExtensions.js';
|
|
42
|
-
import { ModesRegistry } from 'monaco-editor/esm/vs/editor/common/languages/modesRegistry.js';
|
|
43
|
-
import { Extensions } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
|
|
44
|
-
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
45
|
-
async function readFileIntoStream(provider, resource, target, transformer, options, token) {
|
|
46
|
-
let error = undefined;
|
|
47
|
-
try {
|
|
48
|
-
await doReadFileIntoStream(provider, resource, target, transformer, options, token);
|
|
49
|
-
}
|
|
50
|
-
catch (err) {
|
|
51
|
-
error = err;
|
|
52
|
-
}
|
|
53
|
-
finally {
|
|
54
|
-
if (error && options.errorTransformer) {
|
|
55
|
-
error = options.errorTransformer(error);
|
|
56
|
-
}
|
|
57
|
-
if (typeof error !== 'undefined') {
|
|
58
|
-
target.error(error);
|
|
59
|
-
}
|
|
60
|
-
target.end();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
async function doReadFileIntoStream(provider, resource, target, transformer, options, token) {
|
|
64
|
-
throwIfCancelled(token);
|
|
65
|
-
const handle = await provider.open(resource, { create: false });
|
|
66
|
-
try {
|
|
67
|
-
throwIfCancelled(token);
|
|
68
|
-
let totalBytesRead = 0;
|
|
69
|
-
let bytesRead = 0;
|
|
70
|
-
let allowedRemainingBytes = (options && typeof options.length === 'number') ? options.length : undefined;
|
|
71
|
-
let buffer = VSBuffer.alloc(Math.min(options.bufferSize, typeof allowedRemainingBytes === 'number' ? allowedRemainingBytes : options.bufferSize));
|
|
72
|
-
let posInFile = options && typeof options.position === 'number' ? options.position : 0;
|
|
73
|
-
let posInBuffer = 0;
|
|
74
|
-
do {
|
|
75
|
-
bytesRead = await provider.read(handle, posInFile, buffer.buffer, posInBuffer, buffer.byteLength - posInBuffer);
|
|
76
|
-
posInFile += bytesRead;
|
|
77
|
-
posInBuffer += bytesRead;
|
|
78
|
-
totalBytesRead += bytesRead;
|
|
79
|
-
if (typeof allowedRemainingBytes === 'number') {
|
|
80
|
-
allowedRemainingBytes -= bytesRead;
|
|
81
|
-
}
|
|
82
|
-
if (posInBuffer === buffer.byteLength) {
|
|
83
|
-
await target.write(transformer(buffer));
|
|
84
|
-
buffer = VSBuffer.alloc(Math.min(options.bufferSize, typeof allowedRemainingBytes === 'number' ? allowedRemainingBytes : options.bufferSize));
|
|
85
|
-
posInBuffer = 0;
|
|
86
|
-
}
|
|
87
|
-
} while (bytesRead > 0 && (typeof allowedRemainingBytes !== 'number' || allowedRemainingBytes > 0) && throwIfCancelled(token) && throwIfTooLarge(totalBytesRead, options));
|
|
88
|
-
if (posInBuffer > 0) {
|
|
89
|
-
let lastChunkLength = posInBuffer;
|
|
90
|
-
if (typeof allowedRemainingBytes === 'number') {
|
|
91
|
-
lastChunkLength = Math.min(posInBuffer, allowedRemainingBytes);
|
|
92
|
-
}
|
|
93
|
-
target.write(transformer(buffer.slice(0, lastChunkLength)));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
catch (error) {
|
|
97
|
-
throw ensureFileSystemProviderError(error);
|
|
98
|
-
}
|
|
99
|
-
finally {
|
|
100
|
-
await provider.close(handle);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
function throwIfCancelled(token) {
|
|
104
|
-
if (token.isCancellationRequested) {
|
|
105
|
-
throw canceled();
|
|
106
|
-
}
|
|
107
|
-
return true;
|
|
108
|
-
}
|
|
109
|
-
function throwIfTooLarge(totalBytesRead, options) {
|
|
110
|
-
if (options?.limits) {
|
|
111
|
-
if (typeof options.limits.memory === 'number' && totalBytesRead > options.limits.memory) {
|
|
112
|
-
throw createFileSystemProviderError(localize('fileTooLargeForHeapError', "To open a file of this size, you need to restart and allow to use more memory"), FileSystemProviderErrorCode.FileExceedsMemoryLimit);
|
|
113
|
-
}
|
|
114
|
-
if (typeof options.limits.size === 'number' && totalBytesRead > options.limits.size) {
|
|
115
|
-
throw createFileSystemProviderError(localize('fileTooLargeError', "File is too large to open"), FileSystemProviderErrorCode.FileTooLarge);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
return true;
|
|
119
|
-
}
|
|
120
|
-
let FileService = class FileService extends Disposable {
|
|
121
|
-
constructor(logService) {
|
|
122
|
-
super();
|
|
123
|
-
this.logService = logService;
|
|
124
|
-
this.BUFFER_SIZE = 256 * 1024;
|
|
125
|
-
this._onDidChangeFileSystemProviderRegistrations = this._register(( (new Emitter())));
|
|
126
|
-
this.onDidChangeFileSystemProviderRegistrations = this._onDidChangeFileSystemProviderRegistrations.event;
|
|
127
|
-
this._onWillActivateFileSystemProvider = this._register(( (new Emitter())));
|
|
128
|
-
this.onWillActivateFileSystemProvider = this._onWillActivateFileSystemProvider.event;
|
|
129
|
-
this._onDidChangeFileSystemProviderCapabilities = this._register(( (new Emitter())));
|
|
130
|
-
this.onDidChangeFileSystemProviderCapabilities = this._onDidChangeFileSystemProviderCapabilities.event;
|
|
131
|
-
this.provider = ( (new Map()));
|
|
132
|
-
this._onDidRunOperation = this._register(( (new Emitter())));
|
|
133
|
-
this.onDidRunOperation = this._onDidRunOperation.event;
|
|
134
|
-
this._onDidFilesChange = this._register(( (new Emitter())));
|
|
135
|
-
this.onDidFilesChange = this._onDidFilesChange.event;
|
|
136
|
-
this._onDidWatchError = this._register(( (new Emitter())));
|
|
137
|
-
this.onDidWatchError = this._onDidWatchError.event;
|
|
138
|
-
this.activeWatchers = ( (new Map()));
|
|
139
|
-
this.writeQueue = this._register(( (new ResourceQueue())));
|
|
140
|
-
}
|
|
141
|
-
registerProvider(scheme, provider) {
|
|
142
|
-
if (this.provider.has(scheme)) {
|
|
143
|
-
throw new Error(`A filesystem provider for the scheme '${scheme}' is already registered.`);
|
|
144
|
-
}
|
|
145
|
-
mark(`code/registerFilesystem/${scheme}`);
|
|
146
|
-
const providerDisposables = ( (new DisposableStore()));
|
|
147
|
-
this.provider.set(scheme, provider);
|
|
148
|
-
this._onDidChangeFileSystemProviderRegistrations.fire({ added: true, scheme, provider });
|
|
149
|
-
providerDisposables.add(provider.onDidChangeFile(changes => this._onDidFilesChange.fire(( (new FileChangesEvent(changes, !this.isPathCaseSensitive(provider)))))));
|
|
150
|
-
if (typeof provider.onDidWatchError === 'function') {
|
|
151
|
-
providerDisposables.add(provider.onDidWatchError(error => this._onDidWatchError.fire(( (new Error(error))))));
|
|
152
|
-
}
|
|
153
|
-
providerDisposables.add(provider.onDidChangeCapabilities(() => this._onDidChangeFileSystemProviderCapabilities.fire({ provider, scheme })));
|
|
154
|
-
return toDisposable(() => {
|
|
155
|
-
this._onDidChangeFileSystemProviderRegistrations.fire({ added: false, scheme, provider });
|
|
156
|
-
this.provider.delete(scheme);
|
|
157
|
-
dispose(providerDisposables);
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
getProvider(scheme) {
|
|
161
|
-
return this.provider.get(scheme);
|
|
162
|
-
}
|
|
163
|
-
async activateProvider(scheme) {
|
|
164
|
-
const joiners = [];
|
|
165
|
-
this._onWillActivateFileSystemProvider.fire({
|
|
166
|
-
scheme,
|
|
167
|
-
join(promise) {
|
|
168
|
-
joiners.push(promise);
|
|
169
|
-
},
|
|
170
|
-
});
|
|
171
|
-
if (this.provider.has(scheme)) {
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
await Promises.settled(joiners);
|
|
175
|
-
}
|
|
176
|
-
async canHandleResource(resource) {
|
|
177
|
-
await this.activateProvider(resource.scheme);
|
|
178
|
-
return this.hasProvider(resource);
|
|
179
|
-
}
|
|
180
|
-
hasProvider(resource) {
|
|
181
|
-
return this.provider.has(resource.scheme);
|
|
182
|
-
}
|
|
183
|
-
hasCapability(resource, capability) {
|
|
184
|
-
const provider = this.provider.get(resource.scheme);
|
|
185
|
-
return !!(provider && (provider.capabilities & capability));
|
|
186
|
-
}
|
|
187
|
-
listCapabilities() {
|
|
188
|
-
return (
|
|
189
|
-
(Iterable.map(
|
|
190
|
-
this.provider,
|
|
191
|
-
([scheme, provider]) => ({ scheme, capabilities: provider.capabilities })
|
|
192
|
-
))
|
|
193
|
-
);
|
|
194
|
-
}
|
|
195
|
-
async withProvider(resource) {
|
|
196
|
-
if (!isAbsolutePath(resource)) {
|
|
197
|
-
throw new FileOperationError(localize('invalidPath', "Unable to resolve filesystem provider with relative file path '{0}'", this.resourceForError(resource)), 8 );
|
|
198
|
-
}
|
|
199
|
-
await this.activateProvider(resource.scheme);
|
|
200
|
-
const provider = this.provider.get(resource.scheme);
|
|
201
|
-
if (!provider) {
|
|
202
|
-
const error = ( (new ErrorNoTelemetry()));
|
|
203
|
-
error.message = ( (localize(
|
|
204
|
-
'noProviderFound',
|
|
205
|
-
"ENOPRO: No file system provider found for resource '{0}'",
|
|
206
|
-
(resource.toString())
|
|
207
|
-
)));
|
|
208
|
-
throw error;
|
|
209
|
-
}
|
|
210
|
-
return provider;
|
|
211
|
-
}
|
|
212
|
-
async withReadProvider(resource) {
|
|
213
|
-
const provider = await this.withProvider(resource);
|
|
214
|
-
if (hasOpenReadWriteCloseCapability(provider) || hasReadWriteCapability(provider) || hasFileReadStreamCapability(provider)) {
|
|
215
|
-
return provider;
|
|
216
|
-
}
|
|
217
|
-
throw new Error(`Filesystem provider for scheme '${resource.scheme}' neither has FileReadWrite, FileReadStream nor FileOpenReadWriteClose capability which is needed for the read operation.`);
|
|
218
|
-
}
|
|
219
|
-
async withWriteProvider(resource) {
|
|
220
|
-
const provider = await this.withProvider(resource);
|
|
221
|
-
if (hasOpenReadWriteCloseCapability(provider) || hasReadWriteCapability(provider)) {
|
|
222
|
-
return provider;
|
|
223
|
-
}
|
|
224
|
-
throw new Error(`Filesystem provider for scheme '${resource.scheme}' neither has FileReadWrite nor FileOpenReadWriteClose capability which is needed for the write operation.`);
|
|
225
|
-
}
|
|
226
|
-
async resolve(resource, options) {
|
|
227
|
-
try {
|
|
228
|
-
return await this.doResolveFile(resource, options);
|
|
229
|
-
}
|
|
230
|
-
catch (error) {
|
|
231
|
-
if (toFileSystemProviderErrorCode(error) === FileSystemProviderErrorCode.FileNotFound) {
|
|
232
|
-
throw new FileOperationError(localize('fileNotFoundError', "Unable to resolve nonexistent file '{0}'", this.resourceForError(resource)), 1 );
|
|
233
|
-
}
|
|
234
|
-
throw ensureFileSystemProviderError(error);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
async doResolveFile(resource, options) {
|
|
238
|
-
const provider = await this.withProvider(resource);
|
|
239
|
-
const isPathCaseSensitive = this.isPathCaseSensitive(provider);
|
|
240
|
-
const resolveTo = options?.resolveTo;
|
|
241
|
-
const resolveSingleChildDescendants = options?.resolveSingleChildDescendants;
|
|
242
|
-
const resolveMetadata = options?.resolveMetadata;
|
|
243
|
-
const stat = await provider.stat(resource);
|
|
244
|
-
let trie;
|
|
245
|
-
return this.toFileStat(provider, resource, stat, undefined, !!resolveMetadata, (stat, siblings) => {
|
|
246
|
-
if (!trie) {
|
|
247
|
-
trie = TernarySearchTree.forUris(() => !isPathCaseSensitive);
|
|
248
|
-
trie.set(resource, true);
|
|
249
|
-
if (resolveTo) {
|
|
250
|
-
trie.fill(true, resolveTo);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
if (trie.get(stat.resource) || trie.findSuperstr(stat.resource.with({ query: null, fragment: null } ))) {
|
|
254
|
-
return true;
|
|
255
|
-
}
|
|
256
|
-
if (stat.isDirectory && resolveSingleChildDescendants) {
|
|
257
|
-
return siblings === 1;
|
|
258
|
-
}
|
|
259
|
-
return false;
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
async toFileStat(provider, resource, stat, siblings, resolveMetadata, recurse) {
|
|
263
|
-
const { providerExtUri } = this.getExtUri(provider);
|
|
264
|
-
const fileStat = {
|
|
265
|
-
resource,
|
|
266
|
-
name: providerExtUri.basename(resource),
|
|
267
|
-
isFile: (stat.type & FileType.File) !== 0,
|
|
268
|
-
isDirectory: (stat.type & FileType.Directory) !== 0,
|
|
269
|
-
isSymbolicLink: (stat.type & FileType.SymbolicLink) !== 0,
|
|
270
|
-
mtime: stat.mtime,
|
|
271
|
-
ctime: stat.ctime,
|
|
272
|
-
size: stat.size,
|
|
273
|
-
readonly: Boolean((stat.permissions ?? 0) & FilePermission.Readonly) || Boolean(provider.capabilities & 2048 ),
|
|
274
|
-
etag: etag({ mtime: stat.mtime, size: stat.size }),
|
|
275
|
-
children: undefined
|
|
276
|
-
};
|
|
277
|
-
if (fileStat.isDirectory && recurse(fileStat, siblings)) {
|
|
278
|
-
try {
|
|
279
|
-
const entries = await provider.readdir(resource);
|
|
280
|
-
const resolvedEntries = await Promises.settled(( (entries.map(async ([name, type]) => {
|
|
281
|
-
try {
|
|
282
|
-
const childResource = providerExtUri.joinPath(resource, name);
|
|
283
|
-
const childStat = resolveMetadata ? await provider.stat(childResource) : { type };
|
|
284
|
-
return await this.toFileStat(provider, childResource, childStat, entries.length, resolveMetadata, recurse);
|
|
285
|
-
}
|
|
286
|
-
catch (error) {
|
|
287
|
-
this.logService.trace(error);
|
|
288
|
-
return null;
|
|
289
|
-
}
|
|
290
|
-
}))));
|
|
291
|
-
fileStat.children = coalesce(resolvedEntries);
|
|
292
|
-
}
|
|
293
|
-
catch (error) {
|
|
294
|
-
this.logService.trace(error);
|
|
295
|
-
fileStat.children = [];
|
|
296
|
-
}
|
|
297
|
-
return fileStat;
|
|
298
|
-
}
|
|
299
|
-
return fileStat;
|
|
300
|
-
}
|
|
301
|
-
async resolveAll(toResolve) {
|
|
302
|
-
return Promises.settled(( (toResolve.map(async (entry) => {
|
|
303
|
-
try {
|
|
304
|
-
return { stat: await this.doResolveFile(entry.resource, entry.options), success: true };
|
|
305
|
-
}
|
|
306
|
-
catch (error) {
|
|
307
|
-
this.logService.trace(error);
|
|
308
|
-
return { stat: undefined, success: false };
|
|
309
|
-
}
|
|
310
|
-
}))));
|
|
311
|
-
}
|
|
312
|
-
async stat(resource) {
|
|
313
|
-
const provider = await this.withProvider(resource);
|
|
314
|
-
const stat = await provider.stat(resource);
|
|
315
|
-
return this.toFileStat(provider, resource, stat, undefined, true, () => false );
|
|
316
|
-
}
|
|
317
|
-
async exists(resource) {
|
|
318
|
-
const provider = await this.withProvider(resource);
|
|
319
|
-
try {
|
|
320
|
-
const stat = await provider.stat(resource);
|
|
321
|
-
return !!stat;
|
|
322
|
-
}
|
|
323
|
-
catch (error) {
|
|
324
|
-
return false;
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
async canCreateFile(resource, options) {
|
|
328
|
-
try {
|
|
329
|
-
await this.doValidateCreateFile(resource, options);
|
|
330
|
-
}
|
|
331
|
-
catch (error) {
|
|
332
|
-
return error;
|
|
333
|
-
}
|
|
334
|
-
return true;
|
|
335
|
-
}
|
|
336
|
-
async doValidateCreateFile(resource, options) {
|
|
337
|
-
if (!options?.overwrite && (await this.exists(resource))) {
|
|
338
|
-
throw new FileOperationError(localize('fileExists', "Unable to create file '{0}' that already exists when overwrite flag is not set", this.resourceForError(resource)), 3 , options);
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
async createFile(resource, bufferOrReadableOrStream = VSBuffer.fromString(''), options) {
|
|
342
|
-
await this.doValidateCreateFile(resource, options);
|
|
343
|
-
const fileStat = await this.writeFile(resource, bufferOrReadableOrStream);
|
|
344
|
-
this._onDidRunOperation.fire(( (new FileOperationEvent(resource, 0 , fileStat))));
|
|
345
|
-
return fileStat;
|
|
346
|
-
}
|
|
347
|
-
async writeFile(resource, bufferOrReadableOrStream, options) {
|
|
348
|
-
const provider = this.throwIfFileSystemIsReadonly(await this.withWriteProvider(resource), resource);
|
|
349
|
-
const { providerExtUri } = this.getExtUri(provider);
|
|
350
|
-
try {
|
|
351
|
-
const stat = await this.validateWriteFile(provider, resource, options);
|
|
352
|
-
if (!stat) {
|
|
353
|
-
await this.mkdirp(provider, providerExtUri.dirname(resource));
|
|
354
|
-
}
|
|
355
|
-
let bufferOrReadableOrStreamOrBufferedStream;
|
|
356
|
-
if (hasReadWriteCapability(provider) && !(bufferOrReadableOrStream instanceof VSBuffer)) {
|
|
357
|
-
if (isReadableStream(bufferOrReadableOrStream)) {
|
|
358
|
-
const bufferedStream = await peekStream(bufferOrReadableOrStream, 3);
|
|
359
|
-
if (bufferedStream.ended) {
|
|
360
|
-
bufferOrReadableOrStreamOrBufferedStream = VSBuffer.concat(bufferedStream.buffer);
|
|
361
|
-
}
|
|
362
|
-
else {
|
|
363
|
-
bufferOrReadableOrStreamOrBufferedStream = bufferedStream;
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
else {
|
|
367
|
-
bufferOrReadableOrStreamOrBufferedStream = peekReadable(bufferOrReadableOrStream, data => VSBuffer.concat(data), 3);
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
else {
|
|
371
|
-
bufferOrReadableOrStreamOrBufferedStream = bufferOrReadableOrStream;
|
|
372
|
-
}
|
|
373
|
-
if (!hasOpenReadWriteCloseCapability(provider) || (hasReadWriteCapability(provider) && bufferOrReadableOrStreamOrBufferedStream instanceof VSBuffer)) {
|
|
374
|
-
await this.doWriteUnbuffered(provider, resource, options, bufferOrReadableOrStreamOrBufferedStream);
|
|
375
|
-
}
|
|
376
|
-
else {
|
|
377
|
-
await this.doWriteBuffered(provider, resource, options, bufferOrReadableOrStreamOrBufferedStream instanceof VSBuffer ? bufferToReadable(bufferOrReadableOrStreamOrBufferedStream) : bufferOrReadableOrStreamOrBufferedStream);
|
|
378
|
-
}
|
|
379
|
-
this._onDidRunOperation.fire(( (new FileOperationEvent(resource, 4 ))));
|
|
380
|
-
}
|
|
381
|
-
catch (error) {
|
|
382
|
-
throw new FileOperationError(localize('err.write', "Unable to write file '{0}' ({1})", this.resourceForError(resource), ensureFileSystemProviderError(error).toString()), toFileOperationResult(error), options);
|
|
383
|
-
}
|
|
384
|
-
return this.resolve(resource, { resolveMetadata: true });
|
|
385
|
-
}
|
|
386
|
-
async validateWriteFile(provider, resource, options) {
|
|
387
|
-
const unlock = !!options?.unlock;
|
|
388
|
-
if (unlock && !((provider.capabilities & 8192) )) {
|
|
389
|
-
throw new Error(localize('writeFailedUnlockUnsupported', "Unable to unlock file '{0}' because provider does not support it.", this.resourceForError(resource)));
|
|
390
|
-
}
|
|
391
|
-
let stat = undefined;
|
|
392
|
-
try {
|
|
393
|
-
stat = await provider.stat(resource);
|
|
394
|
-
}
|
|
395
|
-
catch (error) {
|
|
396
|
-
return undefined;
|
|
397
|
-
}
|
|
398
|
-
if ((stat.type & FileType.Directory) !== 0) {
|
|
399
|
-
throw new FileOperationError(localize('fileIsDirectoryWriteError', "Unable to write file '{0}' that is actually a directory", this.resourceForError(resource)), 0 , options);
|
|
400
|
-
}
|
|
401
|
-
this.throwIfFileIsReadonly(resource, stat);
|
|
402
|
-
if (typeof options?.mtime === 'number' && typeof options.etag === 'string' && options.etag !== ETAG_DISABLED &&
|
|
403
|
-
typeof stat.mtime === 'number' && typeof stat.size === 'number' &&
|
|
404
|
-
options.mtime < stat.mtime && options.etag !== etag({ mtime: options.mtime , size: stat.size })) {
|
|
405
|
-
throw new FileOperationError(localize('fileModifiedError', "File Modified Since"), 3 , options);
|
|
406
|
-
}
|
|
407
|
-
return stat;
|
|
408
|
-
}
|
|
409
|
-
async readFile(resource, options, token) {
|
|
410
|
-
const provider = await this.withReadProvider(resource);
|
|
411
|
-
if (options?.atomic) {
|
|
412
|
-
return this.doReadFileAtomic(provider, resource, options, token);
|
|
413
|
-
}
|
|
414
|
-
return this.doReadFile(provider, resource, options, token);
|
|
415
|
-
}
|
|
416
|
-
async doReadFileAtomic(provider, resource, options, token) {
|
|
417
|
-
return (
|
|
418
|
-
(new Promise((resolve, reject) => {
|
|
419
|
-
this.writeQueue.queueFor(resource, this.getExtUri(provider).providerExtUri).queue(async () => {
|
|
420
|
-
try {
|
|
421
|
-
const content = await this.doReadFile(provider, resource, options, token);
|
|
422
|
-
resolve(content);
|
|
423
|
-
}
|
|
424
|
-
catch (error) {
|
|
425
|
-
reject(error);
|
|
426
|
-
}
|
|
427
|
-
});
|
|
428
|
-
}))
|
|
429
|
-
);
|
|
430
|
-
}
|
|
431
|
-
async doReadFile(provider, resource, options, token) {
|
|
432
|
-
const stream = await this.doReadFileStream(provider, resource, {
|
|
433
|
-
...options,
|
|
434
|
-
preferUnbuffered: true
|
|
435
|
-
}, token);
|
|
436
|
-
return {
|
|
437
|
-
...stream,
|
|
438
|
-
value: await streamToBuffer(stream.value)
|
|
439
|
-
};
|
|
440
|
-
}
|
|
441
|
-
async readFileStream(resource, options, token) {
|
|
442
|
-
const provider = await this.withReadProvider(resource);
|
|
443
|
-
return this.doReadFileStream(provider, resource, options, token);
|
|
444
|
-
}
|
|
445
|
-
async doReadFileStream(provider, resource, options, token) {
|
|
446
|
-
const cancellableSource = ( (new CancellationTokenSource(token)));
|
|
447
|
-
const statPromise = this.validateReadFile(resource, options).then(stat => stat, error => {
|
|
448
|
-
cancellableSource.cancel();
|
|
449
|
-
throw error;
|
|
450
|
-
});
|
|
451
|
-
let fileStream = undefined;
|
|
452
|
-
try {
|
|
453
|
-
if (typeof options?.etag === 'string' && options.etag !== ETAG_DISABLED) {
|
|
454
|
-
await statPromise;
|
|
455
|
-
}
|
|
456
|
-
if ((options?.atomic && hasFileAtomicReadCapability(provider)) ||
|
|
457
|
-
!(hasOpenReadWriteCloseCapability(provider) || hasFileReadStreamCapability(provider)) ||
|
|
458
|
-
(hasReadWriteCapability(provider) && options?.preferUnbuffered)
|
|
459
|
-
) {
|
|
460
|
-
fileStream = this.readFileUnbuffered(provider, resource, options);
|
|
461
|
-
}
|
|
462
|
-
else if (hasFileReadStreamCapability(provider)) {
|
|
463
|
-
fileStream = this.readFileStreamed(provider, resource, cancellableSource.token, options);
|
|
464
|
-
}
|
|
465
|
-
else {
|
|
466
|
-
fileStream = this.readFileBuffered(provider, resource, cancellableSource.token, options);
|
|
467
|
-
}
|
|
468
|
-
const fileStat = await statPromise;
|
|
469
|
-
return {
|
|
470
|
-
...fileStat,
|
|
471
|
-
value: fileStream
|
|
472
|
-
};
|
|
473
|
-
}
|
|
474
|
-
catch (error) {
|
|
475
|
-
if (fileStream) {
|
|
476
|
-
await consumeStream(fileStream);
|
|
477
|
-
}
|
|
478
|
-
throw this.restoreReadError(error, resource, options);
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
restoreReadError(error, resource, options) {
|
|
482
|
-
const message = ( (localize(
|
|
483
|
-
'err.read',
|
|
484
|
-
"Unable to read file '{0}' ({1})",
|
|
485
|
-
this.resourceForError(resource),
|
|
486
|
-
(ensureFileSystemProviderError(error).toString())
|
|
487
|
-
)));
|
|
488
|
-
if (error instanceof NotModifiedSinceFileOperationError) {
|
|
489
|
-
return (
|
|
490
|
-
(new NotModifiedSinceFileOperationError(message, error.stat, options))
|
|
491
|
-
);
|
|
492
|
-
}
|
|
493
|
-
if (error instanceof TooLargeFileOperationError) {
|
|
494
|
-
return (
|
|
495
|
-
(new TooLargeFileOperationError(message, error.fileOperationResult, error.size, error.options))
|
|
496
|
-
);
|
|
497
|
-
}
|
|
498
|
-
return (
|
|
499
|
-
(new FileOperationError(message, toFileOperationResult(error), options))
|
|
500
|
-
);
|
|
501
|
-
}
|
|
502
|
-
readFileStreamed(provider, resource, token, options = Object.create(null)) {
|
|
503
|
-
const fileStream = provider.readFileStream(resource, options, token);
|
|
504
|
-
return transform(fileStream, {
|
|
505
|
-
data: data => data instanceof VSBuffer ? data : VSBuffer.wrap(data),
|
|
506
|
-
error: error => this.restoreReadError(error, resource, options)
|
|
507
|
-
}, data => VSBuffer.concat(data));
|
|
508
|
-
}
|
|
509
|
-
readFileBuffered(provider, resource, token, options = Object.create(null)) {
|
|
510
|
-
const stream = newWriteableBufferStream();
|
|
511
|
-
readFileIntoStream(provider, resource, stream, data => data, {
|
|
512
|
-
...options,
|
|
513
|
-
bufferSize: this.BUFFER_SIZE,
|
|
514
|
-
errorTransformer: error => this.restoreReadError(error, resource, options)
|
|
515
|
-
}, token);
|
|
516
|
-
return stream;
|
|
517
|
-
}
|
|
518
|
-
readFileUnbuffered(provider, resource, options) {
|
|
519
|
-
const stream = newWriteableStream(data => VSBuffer.concat(data));
|
|
520
|
-
(async () => {
|
|
521
|
-
try {
|
|
522
|
-
let buffer;
|
|
523
|
-
if (options?.atomic && hasFileAtomicReadCapability(provider)) {
|
|
524
|
-
buffer = await provider.readFile(resource, { atomic: true });
|
|
525
|
-
}
|
|
526
|
-
else {
|
|
527
|
-
buffer = await provider.readFile(resource);
|
|
528
|
-
}
|
|
529
|
-
if (typeof options?.position === 'number') {
|
|
530
|
-
buffer = buffer.slice(options.position);
|
|
531
|
-
}
|
|
532
|
-
if (typeof options?.length === 'number') {
|
|
533
|
-
buffer = buffer.slice(0, options.length);
|
|
534
|
-
}
|
|
535
|
-
this.validateReadFileLimits(resource, buffer.byteLength, options);
|
|
536
|
-
stream.end(VSBuffer.wrap(buffer));
|
|
537
|
-
}
|
|
538
|
-
catch (err) {
|
|
539
|
-
stream.error(err);
|
|
540
|
-
stream.end();
|
|
541
|
-
}
|
|
542
|
-
})();
|
|
543
|
-
return stream;
|
|
544
|
-
}
|
|
545
|
-
async validateReadFile(resource, options) {
|
|
546
|
-
const stat = await this.resolve(resource, { resolveMetadata: true });
|
|
547
|
-
if (stat.isDirectory) {
|
|
548
|
-
throw new FileOperationError(localize('fileIsDirectoryReadError', "Unable to read file '{0}' that is actually a directory", this.resourceForError(resource)), 0 , options);
|
|
549
|
-
}
|
|
550
|
-
if (typeof options?.etag === 'string' && options.etag !== ETAG_DISABLED && options.etag === stat.etag) {
|
|
551
|
-
throw new NotModifiedSinceFileOperationError(localize('fileNotModifiedError', "File not modified since"), stat, options);
|
|
552
|
-
}
|
|
553
|
-
this.validateReadFileLimits(resource, stat.size, options);
|
|
554
|
-
return stat;
|
|
555
|
-
}
|
|
556
|
-
validateReadFileLimits(resource, size, options) {
|
|
557
|
-
if (options?.limits) {
|
|
558
|
-
let tooLargeErrorResult = undefined;
|
|
559
|
-
if (typeof options.limits.memory === 'number' && size > options.limits.memory) {
|
|
560
|
-
tooLargeErrorResult = 9 ;
|
|
561
|
-
}
|
|
562
|
-
if (typeof options.limits.size === 'number' && size > options.limits.size) {
|
|
563
|
-
tooLargeErrorResult = 7 ;
|
|
564
|
-
}
|
|
565
|
-
if (typeof tooLargeErrorResult === 'number') {
|
|
566
|
-
throw new TooLargeFileOperationError(localize('fileTooLargeError', "Unable to read file '{0}' that is too large to open", this.resourceForError(resource)), tooLargeErrorResult, size, options);
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
async canMove(source, target, overwrite) {
|
|
571
|
-
return this.doCanMoveCopy(source, target, 'move', overwrite);
|
|
572
|
-
}
|
|
573
|
-
async canCopy(source, target, overwrite) {
|
|
574
|
-
return this.doCanMoveCopy(source, target, 'copy', overwrite);
|
|
575
|
-
}
|
|
576
|
-
async doCanMoveCopy(source, target, mode, overwrite) {
|
|
577
|
-
if (( (source.toString())) !== ( (target.toString()))) {
|
|
578
|
-
try {
|
|
579
|
-
const sourceProvider = mode === 'move' ? this.throwIfFileSystemIsReadonly(await this.withWriteProvider(source), source) : await this.withReadProvider(source);
|
|
580
|
-
const targetProvider = this.throwIfFileSystemIsReadonly(await this.withWriteProvider(target), target);
|
|
581
|
-
await this.doValidateMoveCopy(sourceProvider, source, targetProvider, target, mode, overwrite);
|
|
582
|
-
}
|
|
583
|
-
catch (error) {
|
|
584
|
-
return error;
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
return true;
|
|
588
|
-
}
|
|
589
|
-
async move(source, target, overwrite) {
|
|
590
|
-
const sourceProvider = this.throwIfFileSystemIsReadonly(await this.withWriteProvider(source), source);
|
|
591
|
-
const targetProvider = this.throwIfFileSystemIsReadonly(await this.withWriteProvider(target), target);
|
|
592
|
-
const mode = await this.doMoveCopy(sourceProvider, source, targetProvider, target, 'move', !!overwrite);
|
|
593
|
-
const fileStat = await this.resolve(target, { resolveMetadata: true });
|
|
594
|
-
this._onDidRunOperation.fire(( (new FileOperationEvent(
|
|
595
|
-
source,
|
|
596
|
-
mode === 'move' ? 2 : 3 ,
|
|
597
|
-
fileStat
|
|
598
|
-
))));
|
|
599
|
-
return fileStat;
|
|
600
|
-
}
|
|
601
|
-
async copy(source, target, overwrite) {
|
|
602
|
-
const sourceProvider = await this.withReadProvider(source);
|
|
603
|
-
const targetProvider = this.throwIfFileSystemIsReadonly(await this.withWriteProvider(target), target);
|
|
604
|
-
const mode = await this.doMoveCopy(sourceProvider, source, targetProvider, target, 'copy', !!overwrite);
|
|
605
|
-
const fileStat = await this.resolve(target, { resolveMetadata: true });
|
|
606
|
-
this._onDidRunOperation.fire(( (new FileOperationEvent(
|
|
607
|
-
source,
|
|
608
|
-
mode === 'copy' ? 3 : 2 ,
|
|
609
|
-
fileStat
|
|
610
|
-
))));
|
|
611
|
-
return fileStat;
|
|
612
|
-
}
|
|
613
|
-
async doMoveCopy(sourceProvider, source, targetProvider, target, mode, overwrite) {
|
|
614
|
-
if (( (source.toString())) === ( (target.toString()))) {
|
|
615
|
-
return mode;
|
|
616
|
-
}
|
|
617
|
-
const { exists, isSameResourceWithDifferentPathCase } = await this.doValidateMoveCopy(sourceProvider, source, targetProvider, target, mode, overwrite);
|
|
618
|
-
if (exists && !isSameResourceWithDifferentPathCase && overwrite) {
|
|
619
|
-
await this.del(target, { recursive: true });
|
|
620
|
-
}
|
|
621
|
-
await this.mkdirp(targetProvider, this.getExtUri(targetProvider).providerExtUri.dirname(target));
|
|
622
|
-
if (mode === 'copy') {
|
|
623
|
-
if (sourceProvider === targetProvider && hasFileFolderCopyCapability(sourceProvider)) {
|
|
624
|
-
await sourceProvider.copy(source, target, { overwrite });
|
|
625
|
-
}
|
|
626
|
-
else {
|
|
627
|
-
const sourceFile = await this.resolve(source);
|
|
628
|
-
if (sourceFile.isDirectory) {
|
|
629
|
-
await this.doCopyFolder(sourceProvider, sourceFile, targetProvider, target);
|
|
630
|
-
}
|
|
631
|
-
else {
|
|
632
|
-
await this.doCopyFile(sourceProvider, source, targetProvider, target);
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
return mode;
|
|
636
|
-
}
|
|
637
|
-
else {
|
|
638
|
-
if (sourceProvider === targetProvider) {
|
|
639
|
-
await sourceProvider.rename(source, target, { overwrite });
|
|
640
|
-
return mode;
|
|
641
|
-
}
|
|
642
|
-
else {
|
|
643
|
-
await this.doMoveCopy(sourceProvider, source, targetProvider, target, 'copy', overwrite);
|
|
644
|
-
await this.del(source, { recursive: true });
|
|
645
|
-
return 'copy';
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
async doCopyFile(sourceProvider, source, targetProvider, target) {
|
|
650
|
-
if (hasOpenReadWriteCloseCapability(sourceProvider) && hasOpenReadWriteCloseCapability(targetProvider)) {
|
|
651
|
-
return this.doPipeBuffered(sourceProvider, source, targetProvider, target);
|
|
652
|
-
}
|
|
653
|
-
if (hasOpenReadWriteCloseCapability(sourceProvider) && hasReadWriteCapability(targetProvider)) {
|
|
654
|
-
return this.doPipeBufferedToUnbuffered(sourceProvider, source, targetProvider, target);
|
|
655
|
-
}
|
|
656
|
-
if (hasReadWriteCapability(sourceProvider) && hasOpenReadWriteCloseCapability(targetProvider)) {
|
|
657
|
-
return this.doPipeUnbufferedToBuffered(sourceProvider, source, targetProvider, target);
|
|
658
|
-
}
|
|
659
|
-
if (hasReadWriteCapability(sourceProvider) && hasReadWriteCapability(targetProvider)) {
|
|
660
|
-
return this.doPipeUnbuffered(sourceProvider, source, targetProvider, target);
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
async doCopyFolder(sourceProvider, sourceFolder, targetProvider, targetFolder) {
|
|
664
|
-
await targetProvider.mkdir(targetFolder);
|
|
665
|
-
if (Array.isArray(sourceFolder.children)) {
|
|
666
|
-
await Promises.settled(( (sourceFolder.children.map(async (sourceChild) => {
|
|
667
|
-
const targetChild = this.getExtUri(targetProvider).providerExtUri.joinPath(targetFolder, sourceChild.name);
|
|
668
|
-
if (sourceChild.isDirectory) {
|
|
669
|
-
return this.doCopyFolder(sourceProvider, await this.resolve(sourceChild.resource), targetProvider, targetChild);
|
|
670
|
-
}
|
|
671
|
-
else {
|
|
672
|
-
return this.doCopyFile(sourceProvider, sourceChild.resource, targetProvider, targetChild);
|
|
673
|
-
}
|
|
674
|
-
}))));
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
async doValidateMoveCopy(sourceProvider, source, targetProvider, target, mode, overwrite) {
|
|
678
|
-
let isSameResourceWithDifferentPathCase = false;
|
|
679
|
-
if (sourceProvider === targetProvider) {
|
|
680
|
-
const { providerExtUri, isPathCaseSensitive } = this.getExtUri(sourceProvider);
|
|
681
|
-
if (!isPathCaseSensitive) {
|
|
682
|
-
isSameResourceWithDifferentPathCase = providerExtUri.isEqual(source, target);
|
|
683
|
-
}
|
|
684
|
-
if (isSameResourceWithDifferentPathCase && mode === 'copy') {
|
|
685
|
-
throw new Error(localize('unableToMoveCopyError1', "Unable to copy when source '{0}' is same as target '{1}' with different path case on a case insensitive file system", this.resourceForError(source), this.resourceForError(target)));
|
|
686
|
-
}
|
|
687
|
-
if (!isSameResourceWithDifferentPathCase && providerExtUri.isEqualOrParent(target, source)) {
|
|
688
|
-
throw new Error(localize('unableToMoveCopyError2', "Unable to move/copy when source '{0}' is parent of target '{1}'.", this.resourceForError(source), this.resourceForError(target)));
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
const exists = await this.exists(target);
|
|
692
|
-
if (exists && !isSameResourceWithDifferentPathCase) {
|
|
693
|
-
if (!overwrite) {
|
|
694
|
-
throw new FileOperationError(localize('unableToMoveCopyError3', "Unable to move/copy '{0}' because target '{1}' already exists at destination.", this.resourceForError(source), this.resourceForError(target)), 4 );
|
|
695
|
-
}
|
|
696
|
-
if (sourceProvider === targetProvider) {
|
|
697
|
-
const { providerExtUri } = this.getExtUri(sourceProvider);
|
|
698
|
-
if (providerExtUri.isEqualOrParent(source, target)) {
|
|
699
|
-
throw new Error(localize('unableToMoveCopyError4', "Unable to move/copy '{0}' into '{1}' since a file would replace the folder it is contained in.", this.resourceForError(source), this.resourceForError(target)));
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
return { exists, isSameResourceWithDifferentPathCase };
|
|
704
|
-
}
|
|
705
|
-
getExtUri(provider) {
|
|
706
|
-
const isPathCaseSensitive = this.isPathCaseSensitive(provider);
|
|
707
|
-
return {
|
|
708
|
-
providerExtUri: isPathCaseSensitive ? extUri : extUriIgnorePathCase,
|
|
709
|
-
isPathCaseSensitive
|
|
710
|
-
};
|
|
711
|
-
}
|
|
712
|
-
isPathCaseSensitive(provider) {
|
|
713
|
-
return !!((provider.capabilities & 1024) );
|
|
714
|
-
}
|
|
715
|
-
async createFolder(resource) {
|
|
716
|
-
const provider = this.throwIfFileSystemIsReadonly(await this.withProvider(resource), resource);
|
|
717
|
-
await this.mkdirp(provider, resource);
|
|
718
|
-
const fileStat = await this.resolve(resource, { resolveMetadata: true });
|
|
719
|
-
this._onDidRunOperation.fire(( (new FileOperationEvent(resource, 0 , fileStat))));
|
|
720
|
-
return fileStat;
|
|
721
|
-
}
|
|
722
|
-
async mkdirp(provider, directory) {
|
|
723
|
-
const directoriesToCreate = [];
|
|
724
|
-
const { providerExtUri } = this.getExtUri(provider);
|
|
725
|
-
while (!providerExtUri.isEqual(directory, providerExtUri.dirname(directory))) {
|
|
726
|
-
try {
|
|
727
|
-
const stat = await provider.stat(directory);
|
|
728
|
-
if ((stat.type & FileType.Directory) === 0) {
|
|
729
|
-
throw new Error(localize('mkdirExistsError', "Unable to create folder '{0}' that already exists but is not a directory", this.resourceForError(directory)));
|
|
730
|
-
}
|
|
731
|
-
break;
|
|
732
|
-
}
|
|
733
|
-
catch (error) {
|
|
734
|
-
if (toFileSystemProviderErrorCode(error) !== FileSystemProviderErrorCode.FileNotFound) {
|
|
735
|
-
throw error;
|
|
736
|
-
}
|
|
737
|
-
directoriesToCreate.push(providerExtUri.basename(directory));
|
|
738
|
-
directory = providerExtUri.dirname(directory);
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
for (let i = directoriesToCreate.length - 1; i >= 0; i--) {
|
|
742
|
-
directory = providerExtUri.joinPath(directory, directoriesToCreate[i]);
|
|
743
|
-
try {
|
|
744
|
-
await provider.mkdir(directory);
|
|
745
|
-
}
|
|
746
|
-
catch (error) {
|
|
747
|
-
if (toFileSystemProviderErrorCode(error) !== FileSystemProviderErrorCode.FileExists) {
|
|
748
|
-
throw error;
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
async canDelete(resource, options) {
|
|
754
|
-
try {
|
|
755
|
-
await this.doValidateDelete(resource, options);
|
|
756
|
-
}
|
|
757
|
-
catch (error) {
|
|
758
|
-
return error;
|
|
759
|
-
}
|
|
760
|
-
return true;
|
|
761
|
-
}
|
|
762
|
-
async doValidateDelete(resource, options) {
|
|
763
|
-
const provider = this.throwIfFileSystemIsReadonly(await this.withProvider(resource), resource);
|
|
764
|
-
const useTrash = !!options?.useTrash;
|
|
765
|
-
if (useTrash && !((provider.capabilities & 4096) )) {
|
|
766
|
-
throw new Error(localize('deleteFailedTrashUnsupported', "Unable to delete file '{0}' via trash because provider does not support it.", this.resourceForError(resource)));
|
|
767
|
-
}
|
|
768
|
-
let stat = undefined;
|
|
769
|
-
try {
|
|
770
|
-
stat = await provider.stat(resource);
|
|
771
|
-
}
|
|
772
|
-
catch (error) {
|
|
773
|
-
}
|
|
774
|
-
if (stat) {
|
|
775
|
-
this.throwIfFileIsReadonly(resource, stat);
|
|
776
|
-
}
|
|
777
|
-
else {
|
|
778
|
-
throw new FileOperationError(localize('deleteFailedNotFound', "Unable to delete nonexistent file '{0}'", this.resourceForError(resource)), 1 );
|
|
779
|
-
}
|
|
780
|
-
const recursive = !!options?.recursive;
|
|
781
|
-
if (!recursive) {
|
|
782
|
-
const stat = await this.resolve(resource);
|
|
783
|
-
if (stat.isDirectory && Array.isArray(stat.children) && stat.children.length > 0) {
|
|
784
|
-
throw new Error(localize('deleteFailedNonEmptyFolder', "Unable to delete non-empty folder '{0}'.", this.resourceForError(resource)));
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
return provider;
|
|
788
|
-
}
|
|
789
|
-
async del(resource, options) {
|
|
790
|
-
const provider = await this.doValidateDelete(resource, options);
|
|
791
|
-
const useTrash = !!options?.useTrash;
|
|
792
|
-
const recursive = !!options?.recursive;
|
|
793
|
-
await provider.delete(resource, { recursive, useTrash });
|
|
794
|
-
this._onDidRunOperation.fire(( (new FileOperationEvent(resource, 1 ))));
|
|
795
|
-
}
|
|
796
|
-
async cloneFile(source, target) {
|
|
797
|
-
const sourceProvider = await this.withProvider(source);
|
|
798
|
-
const targetProvider = this.throwIfFileSystemIsReadonly(await this.withWriteProvider(target), target);
|
|
799
|
-
if (sourceProvider === targetProvider && this.getExtUri(sourceProvider).providerExtUri.isEqual(source, target)) {
|
|
800
|
-
return;
|
|
801
|
-
}
|
|
802
|
-
if (sourceProvider === targetProvider && hasFileCloneCapability(sourceProvider)) {
|
|
803
|
-
return sourceProvider.cloneFile(source, target);
|
|
804
|
-
}
|
|
805
|
-
await this.mkdirp(targetProvider, this.getExtUri(targetProvider).providerExtUri.dirname(target));
|
|
806
|
-
const sourceWriteQueue = this.writeQueue.queueFor(source, this.getExtUri(sourceProvider).providerExtUri);
|
|
807
|
-
if (sourceProvider === targetProvider && hasFileFolderCopyCapability(sourceProvider)) {
|
|
808
|
-
return sourceWriteQueue.queue(() => sourceProvider.copy(source, target, { overwrite: true }));
|
|
809
|
-
}
|
|
810
|
-
return sourceWriteQueue.queue(() => this.doCopyFile(sourceProvider, source, targetProvider, target));
|
|
811
|
-
}
|
|
812
|
-
watch(resource, options = { recursive: false, excludes: [] }) {
|
|
813
|
-
const disposables = ( (new DisposableStore()));
|
|
814
|
-
let watchDisposed = false;
|
|
815
|
-
let disposeWatch = () => { watchDisposed = true; };
|
|
816
|
-
disposables.add(toDisposable(() => disposeWatch()));
|
|
817
|
-
(async () => {
|
|
818
|
-
try {
|
|
819
|
-
const disposable = await this.doWatch(resource, options);
|
|
820
|
-
if (watchDisposed) {
|
|
821
|
-
dispose(disposable);
|
|
822
|
-
}
|
|
823
|
-
else {
|
|
824
|
-
disposeWatch = () => dispose(disposable);
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
catch (error) {
|
|
828
|
-
this.logService.error(error);
|
|
829
|
-
}
|
|
830
|
-
})();
|
|
831
|
-
return disposables;
|
|
832
|
-
}
|
|
833
|
-
async doWatch(resource, options) {
|
|
834
|
-
const provider = await this.withProvider(resource);
|
|
835
|
-
const watchHash = hash([this.getExtUri(provider).providerExtUri.getComparisonKey(resource), options]);
|
|
836
|
-
let watcher = this.activeWatchers.get(watchHash);
|
|
837
|
-
if (!watcher) {
|
|
838
|
-
watcher = {
|
|
839
|
-
count: 0,
|
|
840
|
-
disposable: provider.watch(resource, options)
|
|
841
|
-
};
|
|
842
|
-
this.activeWatchers.set(watchHash, watcher);
|
|
843
|
-
}
|
|
844
|
-
watcher.count += 1;
|
|
845
|
-
return toDisposable(() => {
|
|
846
|
-
if (watcher) {
|
|
847
|
-
watcher.count--;
|
|
848
|
-
if (watcher.count === 0) {
|
|
849
|
-
dispose(watcher.disposable);
|
|
850
|
-
this.activeWatchers.delete(watchHash);
|
|
851
|
-
}
|
|
852
|
-
}
|
|
853
|
-
});
|
|
854
|
-
}
|
|
855
|
-
dispose() {
|
|
856
|
-
super.dispose();
|
|
857
|
-
for (const [, watcher] of this.activeWatchers) {
|
|
858
|
-
dispose(watcher.disposable);
|
|
859
|
-
}
|
|
860
|
-
this.activeWatchers.clear();
|
|
861
|
-
}
|
|
862
|
-
async doWriteBuffered(provider, resource, options, readableOrStreamOrBufferedStream) {
|
|
863
|
-
return this.writeQueue.queueFor(resource, this.getExtUri(provider).providerExtUri).queue(async () => {
|
|
864
|
-
const handle = await provider.open(resource, { create: true, unlock: options?.unlock ?? false });
|
|
865
|
-
try {
|
|
866
|
-
if (isReadableStream(readableOrStreamOrBufferedStream) || isReadableBufferedStream(readableOrStreamOrBufferedStream)) {
|
|
867
|
-
await this.doWriteStreamBufferedQueued(provider, handle, readableOrStreamOrBufferedStream);
|
|
868
|
-
}
|
|
869
|
-
else {
|
|
870
|
-
await this.doWriteReadableBufferedQueued(provider, handle, readableOrStreamOrBufferedStream);
|
|
871
|
-
}
|
|
872
|
-
}
|
|
873
|
-
catch (error) {
|
|
874
|
-
throw ensureFileSystemProviderError(error);
|
|
875
|
-
}
|
|
876
|
-
finally {
|
|
877
|
-
await provider.close(handle);
|
|
878
|
-
}
|
|
879
|
-
});
|
|
880
|
-
}
|
|
881
|
-
async doWriteStreamBufferedQueued(provider, handle, streamOrBufferedStream) {
|
|
882
|
-
let posInFile = 0;
|
|
883
|
-
let stream;
|
|
884
|
-
if (isReadableBufferedStream(streamOrBufferedStream)) {
|
|
885
|
-
if (streamOrBufferedStream.buffer.length > 0) {
|
|
886
|
-
const chunk = VSBuffer.concat(streamOrBufferedStream.buffer);
|
|
887
|
-
await this.doWriteBuffer(provider, handle, chunk, chunk.byteLength, posInFile, 0);
|
|
888
|
-
posInFile += chunk.byteLength;
|
|
889
|
-
}
|
|
890
|
-
if (streamOrBufferedStream.ended) {
|
|
891
|
-
return;
|
|
892
|
-
}
|
|
893
|
-
stream = streamOrBufferedStream.stream;
|
|
894
|
-
}
|
|
895
|
-
else {
|
|
896
|
-
stream = streamOrBufferedStream;
|
|
897
|
-
}
|
|
898
|
-
return (
|
|
899
|
-
(new Promise((resolve, reject) => {
|
|
900
|
-
listenStream(stream, {
|
|
901
|
-
onData: async (chunk) => {
|
|
902
|
-
stream.pause();
|
|
903
|
-
try {
|
|
904
|
-
await this.doWriteBuffer(provider, handle, chunk, chunk.byteLength, posInFile, 0);
|
|
905
|
-
}
|
|
906
|
-
catch (error) {
|
|
907
|
-
return reject(error);
|
|
908
|
-
}
|
|
909
|
-
posInFile += chunk.byteLength;
|
|
910
|
-
setTimeout(() => stream.resume());
|
|
911
|
-
},
|
|
912
|
-
onError: error => reject(error),
|
|
913
|
-
onEnd: () => resolve()
|
|
914
|
-
});
|
|
915
|
-
}))
|
|
916
|
-
);
|
|
917
|
-
}
|
|
918
|
-
async doWriteReadableBufferedQueued(provider, handle, readable) {
|
|
919
|
-
let posInFile = 0;
|
|
920
|
-
let chunk;
|
|
921
|
-
while ((chunk = readable.read()) !== null) {
|
|
922
|
-
await this.doWriteBuffer(provider, handle, chunk, chunk.byteLength, posInFile, 0);
|
|
923
|
-
posInFile += chunk.byteLength;
|
|
924
|
-
}
|
|
925
|
-
}
|
|
926
|
-
async doWriteBuffer(provider, handle, buffer, length, posInFile, posInBuffer) {
|
|
927
|
-
let totalBytesWritten = 0;
|
|
928
|
-
while (totalBytesWritten < length) {
|
|
929
|
-
const bytesWritten = await provider.write(handle, posInFile + totalBytesWritten, buffer.buffer, posInBuffer + totalBytesWritten, length - totalBytesWritten);
|
|
930
|
-
totalBytesWritten += bytesWritten;
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
async doWriteUnbuffered(provider, resource, options, bufferOrReadableOrStreamOrBufferedStream) {
|
|
934
|
-
return this.writeQueue.queueFor(resource, this.getExtUri(provider).providerExtUri).queue(() => this.doWriteUnbufferedQueued(provider, resource, options, bufferOrReadableOrStreamOrBufferedStream));
|
|
935
|
-
}
|
|
936
|
-
async doWriteUnbufferedQueued(provider, resource, options, bufferOrReadableOrStreamOrBufferedStream) {
|
|
937
|
-
let buffer;
|
|
938
|
-
if (bufferOrReadableOrStreamOrBufferedStream instanceof VSBuffer) {
|
|
939
|
-
buffer = bufferOrReadableOrStreamOrBufferedStream;
|
|
940
|
-
}
|
|
941
|
-
else if (isReadableStream(bufferOrReadableOrStreamOrBufferedStream)) {
|
|
942
|
-
buffer = await streamToBuffer(bufferOrReadableOrStreamOrBufferedStream);
|
|
943
|
-
}
|
|
944
|
-
else if (isReadableBufferedStream(bufferOrReadableOrStreamOrBufferedStream)) {
|
|
945
|
-
buffer = await bufferedStreamToBuffer(bufferOrReadableOrStreamOrBufferedStream);
|
|
946
|
-
}
|
|
947
|
-
else {
|
|
948
|
-
buffer = readableToBuffer(bufferOrReadableOrStreamOrBufferedStream);
|
|
949
|
-
}
|
|
950
|
-
await provider.writeFile(resource, buffer.buffer, { create: true, overwrite: true, unlock: options?.unlock ?? false });
|
|
951
|
-
}
|
|
952
|
-
async doPipeBuffered(sourceProvider, source, targetProvider, target) {
|
|
953
|
-
return this.writeQueue.queueFor(target, this.getExtUri(targetProvider).providerExtUri).queue(() => this.doPipeBufferedQueued(sourceProvider, source, targetProvider, target));
|
|
954
|
-
}
|
|
955
|
-
async doPipeBufferedQueued(sourceProvider, source, targetProvider, target) {
|
|
956
|
-
let sourceHandle = undefined;
|
|
957
|
-
let targetHandle = undefined;
|
|
958
|
-
try {
|
|
959
|
-
sourceHandle = await sourceProvider.open(source, { create: false });
|
|
960
|
-
targetHandle = await targetProvider.open(target, { create: true, unlock: false });
|
|
961
|
-
const buffer = VSBuffer.alloc(this.BUFFER_SIZE);
|
|
962
|
-
let posInFile = 0;
|
|
963
|
-
let posInBuffer = 0;
|
|
964
|
-
let bytesRead = 0;
|
|
965
|
-
do {
|
|
966
|
-
bytesRead = await sourceProvider.read(sourceHandle, posInFile, buffer.buffer, posInBuffer, buffer.byteLength - posInBuffer);
|
|
967
|
-
await this.doWriteBuffer(targetProvider, targetHandle, buffer, bytesRead, posInFile, posInBuffer);
|
|
968
|
-
posInFile += bytesRead;
|
|
969
|
-
posInBuffer += bytesRead;
|
|
970
|
-
if (posInBuffer === buffer.byteLength) {
|
|
971
|
-
posInBuffer = 0;
|
|
972
|
-
}
|
|
973
|
-
} while (bytesRead > 0);
|
|
974
|
-
}
|
|
975
|
-
catch (error) {
|
|
976
|
-
throw ensureFileSystemProviderError(error);
|
|
977
|
-
}
|
|
978
|
-
finally {
|
|
979
|
-
await Promises.settled([
|
|
980
|
-
typeof sourceHandle === 'number' ? sourceProvider.close(sourceHandle) : Promise.resolve(),
|
|
981
|
-
typeof targetHandle === 'number' ? targetProvider.close(targetHandle) : Promise.resolve(),
|
|
982
|
-
]);
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
async doPipeUnbuffered(sourceProvider, source, targetProvider, target) {
|
|
986
|
-
return this.writeQueue.queueFor(target, this.getExtUri(targetProvider).providerExtUri).queue(() => this.doPipeUnbufferedQueued(sourceProvider, source, targetProvider, target));
|
|
987
|
-
}
|
|
988
|
-
async doPipeUnbufferedQueued(sourceProvider, source, targetProvider, target) {
|
|
989
|
-
return targetProvider.writeFile(target, await sourceProvider.readFile(source), { create: true, overwrite: true, unlock: false });
|
|
990
|
-
}
|
|
991
|
-
async doPipeUnbufferedToBuffered(sourceProvider, source, targetProvider, target) {
|
|
992
|
-
return this.writeQueue.queueFor(target, this.getExtUri(targetProvider).providerExtUri).queue(() => this.doPipeUnbufferedToBufferedQueued(sourceProvider, source, targetProvider, target));
|
|
993
|
-
}
|
|
994
|
-
async doPipeUnbufferedToBufferedQueued(sourceProvider, source, targetProvider, target) {
|
|
995
|
-
const targetHandle = await targetProvider.open(target, { create: true, unlock: false });
|
|
996
|
-
try {
|
|
997
|
-
const buffer = await sourceProvider.readFile(source);
|
|
998
|
-
await this.doWriteBuffer(targetProvider, targetHandle, VSBuffer.wrap(buffer), buffer.byteLength, 0, 0);
|
|
999
|
-
}
|
|
1000
|
-
catch (error) {
|
|
1001
|
-
throw ensureFileSystemProviderError(error);
|
|
1002
|
-
}
|
|
1003
|
-
finally {
|
|
1004
|
-
await targetProvider.close(targetHandle);
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
async doPipeBufferedToUnbuffered(sourceProvider, source, targetProvider, target) {
|
|
1008
|
-
const buffer = await streamToBuffer(this.readFileBuffered(sourceProvider, source, CancellationToken.None));
|
|
1009
|
-
await this.doWriteUnbuffered(targetProvider, target, undefined, buffer);
|
|
1010
|
-
}
|
|
1011
|
-
throwIfFileSystemIsReadonly(provider, resource) {
|
|
1012
|
-
if (provider.capabilities & 2048 ) {
|
|
1013
|
-
throw new FileOperationError(localize('err.readonly', "Unable to modify readonly file '{0}'", this.resourceForError(resource)), 6 );
|
|
1014
|
-
}
|
|
1015
|
-
return provider;
|
|
1016
|
-
}
|
|
1017
|
-
throwIfFileIsReadonly(resource, stat) {
|
|
1018
|
-
if ((stat.permissions ?? 0) & FilePermission.Readonly) {
|
|
1019
|
-
throw new FileOperationError(localize('err.readonly', "Unable to modify readonly file '{0}'", this.resourceForError(resource)), 6 );
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
resourceForError(resource) {
|
|
1023
|
-
if (resource.scheme === Schemas.file) {
|
|
1024
|
-
return resource.fsPath;
|
|
1025
|
-
}
|
|
1026
|
-
return (
|
|
1027
|
-
(resource.toString(true))
|
|
1028
|
-
);
|
|
1029
|
-
}
|
|
1030
|
-
};
|
|
1031
|
-
FileService = ( (__decorate([
|
|
1032
|
-
( (__param(0, ILogService)))
|
|
1033
|
-
], FileService)));
|
|
1034
|
-
let File$1 = class File {
|
|
1035
|
-
constructor(name) {
|
|
1036
|
-
this.type = FileType.File;
|
|
1037
|
-
this.ctime = Date.now();
|
|
1038
|
-
this.mtime = Date.now();
|
|
1039
|
-
this.size = 0;
|
|
1040
|
-
this.name = name;
|
|
1041
|
-
}
|
|
1042
|
-
};
|
|
1043
|
-
class Directory {
|
|
1044
|
-
constructor(name) {
|
|
1045
|
-
this.type = FileType.Directory;
|
|
1046
|
-
this.ctime = Date.now();
|
|
1047
|
-
this.mtime = Date.now();
|
|
1048
|
-
this.size = 0;
|
|
1049
|
-
this.name = name;
|
|
1050
|
-
this.entries = ( (new Map()));
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
class InMemoryFileSystemProvider extends Disposable {
|
|
1054
|
-
constructor() {
|
|
1055
|
-
super(...arguments);
|
|
1056
|
-
this._onDidChangeCapabilities = this._register(( (new Emitter())));
|
|
1057
|
-
this.onDidChangeCapabilities = this._onDidChangeCapabilities.event;
|
|
1058
|
-
this._capabilities = 2 | 1024 ;
|
|
1059
|
-
this.root = ( (new Directory('')));
|
|
1060
|
-
this._onDidChangeFile = this._register(( (new Emitter())));
|
|
1061
|
-
this.onDidChangeFile = this._onDidChangeFile.event;
|
|
1062
|
-
this._bufferedChanges = [];
|
|
1063
|
-
}
|
|
1064
|
-
get capabilities() { return this._capabilities; }
|
|
1065
|
-
setReadOnly(readonly) {
|
|
1066
|
-
const isReadonly = !!((this._capabilities & 2048) );
|
|
1067
|
-
if (readonly !== isReadonly) {
|
|
1068
|
-
this._capabilities = readonly ? 2048 | 1024 | 2
|
|
1069
|
-
: 2 | 1024 ;
|
|
1070
|
-
this._onDidChangeCapabilities.fire();
|
|
1071
|
-
}
|
|
1072
|
-
}
|
|
1073
|
-
async stat(resource) {
|
|
1074
|
-
return this._lookup(resource, false);
|
|
1075
|
-
}
|
|
1076
|
-
async readdir(resource) {
|
|
1077
|
-
const entry = this._lookupAsDirectory(resource, false);
|
|
1078
|
-
const result = [];
|
|
1079
|
-
entry.entries.forEach((child, name) => result.push([name, child.type]));
|
|
1080
|
-
return result;
|
|
1081
|
-
}
|
|
1082
|
-
async readFile(resource) {
|
|
1083
|
-
const data = this._lookupAsFile(resource, false).data;
|
|
1084
|
-
if (data) {
|
|
1085
|
-
return data;
|
|
1086
|
-
}
|
|
1087
|
-
throw createFileSystemProviderError('file not found', FileSystemProviderErrorCode.FileNotFound);
|
|
1088
|
-
}
|
|
1089
|
-
async writeFile(resource, content, opts) {
|
|
1090
|
-
const basename$1 = basename(resource);
|
|
1091
|
-
const parent = this._lookupParentDirectory(resource);
|
|
1092
|
-
let entry = parent.entries.get(basename$1);
|
|
1093
|
-
if (entry instanceof Directory) {
|
|
1094
|
-
throw createFileSystemProviderError('file is directory', FileSystemProviderErrorCode.FileIsADirectory);
|
|
1095
|
-
}
|
|
1096
|
-
if (!entry && !opts.create) {
|
|
1097
|
-
throw createFileSystemProviderError('file not found', FileSystemProviderErrorCode.FileNotFound);
|
|
1098
|
-
}
|
|
1099
|
-
if (entry && opts.create && !opts.overwrite) {
|
|
1100
|
-
throw createFileSystemProviderError('file exists already', FileSystemProviderErrorCode.FileExists);
|
|
1101
|
-
}
|
|
1102
|
-
if (!entry) {
|
|
1103
|
-
entry = ( (new File$1(basename$1)));
|
|
1104
|
-
parent.entries.set(basename$1, entry);
|
|
1105
|
-
this._fireSoon({ type: 1 , resource });
|
|
1106
|
-
}
|
|
1107
|
-
entry.mtime = Date.now();
|
|
1108
|
-
entry.size = content.byteLength;
|
|
1109
|
-
entry.data = content;
|
|
1110
|
-
this._fireSoon({ type: 0 , resource });
|
|
1111
|
-
}
|
|
1112
|
-
async rename(from, to, opts) {
|
|
1113
|
-
if (!opts.overwrite && this._lookup(to, true)) {
|
|
1114
|
-
throw createFileSystemProviderError('file exists already', FileSystemProviderErrorCode.FileExists);
|
|
1115
|
-
}
|
|
1116
|
-
const entry = this._lookup(from, false);
|
|
1117
|
-
const oldParent = this._lookupParentDirectory(from);
|
|
1118
|
-
const newParent = this._lookupParentDirectory(to);
|
|
1119
|
-
const newName = basename(to);
|
|
1120
|
-
oldParent.entries.delete(entry.name);
|
|
1121
|
-
entry.name = newName;
|
|
1122
|
-
newParent.entries.set(newName, entry);
|
|
1123
|
-
this._fireSoon({ type: 2 , resource: from }, { type: 1 , resource: to });
|
|
1124
|
-
}
|
|
1125
|
-
async delete(resource, opts) {
|
|
1126
|
-
const dirname$1 = dirname(resource);
|
|
1127
|
-
const basename$1 = basename(resource);
|
|
1128
|
-
const parent = this._lookupAsDirectory(dirname$1, false);
|
|
1129
|
-
if (parent.entries.has(basename$1)) {
|
|
1130
|
-
parent.entries.delete(basename$1);
|
|
1131
|
-
parent.mtime = Date.now();
|
|
1132
|
-
parent.size -= 1;
|
|
1133
|
-
this._fireSoon({ type: 0 , resource: dirname$1 }, { resource, type: 2 });
|
|
1134
|
-
}
|
|
1135
|
-
}
|
|
1136
|
-
async mkdir(resource) {
|
|
1137
|
-
if (this._lookup(resource, true)) {
|
|
1138
|
-
throw createFileSystemProviderError('file exists already', FileSystemProviderErrorCode.FileExists);
|
|
1139
|
-
}
|
|
1140
|
-
const basename$1 = basename(resource);
|
|
1141
|
-
const dirname$1 = dirname(resource);
|
|
1142
|
-
const parent = this._lookupAsDirectory(dirname$1, false);
|
|
1143
|
-
const entry = ( (new Directory(basename$1)));
|
|
1144
|
-
parent.entries.set(entry.name, entry);
|
|
1145
|
-
parent.mtime = Date.now();
|
|
1146
|
-
parent.size += 1;
|
|
1147
|
-
this._fireSoon({ type: 0 , resource: dirname$1 }, { type: 1 , resource });
|
|
1148
|
-
}
|
|
1149
|
-
_lookup(uri, silent) {
|
|
1150
|
-
const parts = uri.path.split('/');
|
|
1151
|
-
let entry = this.root;
|
|
1152
|
-
for (const part of parts) {
|
|
1153
|
-
if (!part) {
|
|
1154
|
-
continue;
|
|
1155
|
-
}
|
|
1156
|
-
let child;
|
|
1157
|
-
if (entry instanceof Directory) {
|
|
1158
|
-
child = entry.entries.get(part);
|
|
1159
|
-
}
|
|
1160
|
-
if (!child) {
|
|
1161
|
-
if (!silent) {
|
|
1162
|
-
throw createFileSystemProviderError('file not found', FileSystemProviderErrorCode.FileNotFound);
|
|
1163
|
-
}
|
|
1164
|
-
else {
|
|
1165
|
-
return undefined;
|
|
1166
|
-
}
|
|
1167
|
-
}
|
|
1168
|
-
entry = child;
|
|
1169
|
-
}
|
|
1170
|
-
return entry;
|
|
1171
|
-
}
|
|
1172
|
-
_lookupAsDirectory(uri, silent) {
|
|
1173
|
-
const entry = this._lookup(uri, silent);
|
|
1174
|
-
if (entry instanceof Directory) {
|
|
1175
|
-
return entry;
|
|
1176
|
-
}
|
|
1177
|
-
throw createFileSystemProviderError('file not a directory', FileSystemProviderErrorCode.FileNotADirectory);
|
|
1178
|
-
}
|
|
1179
|
-
_lookupAsFile(uri, silent) {
|
|
1180
|
-
const entry = this._lookup(uri, silent);
|
|
1181
|
-
if (entry instanceof File$1) {
|
|
1182
|
-
return entry;
|
|
1183
|
-
}
|
|
1184
|
-
throw createFileSystemProviderError('file is a directory', FileSystemProviderErrorCode.FileIsADirectory);
|
|
1185
|
-
}
|
|
1186
|
-
_lookupParentDirectory(uri) {
|
|
1187
|
-
const dirname$1 = dirname(uri);
|
|
1188
|
-
return this._lookupAsDirectory(dirname$1, false);
|
|
1189
|
-
}
|
|
1190
|
-
watch(resource, opts) {
|
|
1191
|
-
return Disposable.None;
|
|
1192
|
-
}
|
|
1193
|
-
_fireSoon(...changes) {
|
|
1194
|
-
this._bufferedChanges.push(...changes);
|
|
1195
|
-
if (this._fireSoonHandle) {
|
|
1196
|
-
clearTimeout(this._fireSoonHandle);
|
|
1197
|
-
}
|
|
1198
|
-
this._fireSoonHandle = setTimeout(() => {
|
|
1199
|
-
this._onDidChangeFile.fire(this._bufferedChanges);
|
|
1200
|
-
this._bufferedChanges.length = 0;
|
|
1201
|
-
}, 5);
|
|
1202
|
-
}
|
|
1203
|
-
}
|
|
1204
|
-
let BinaryEditorModel = class BinaryEditorModel extends EditorModel {
|
|
1205
|
-
constructor(resource, name, fileService) {
|
|
1206
|
-
super();
|
|
1207
|
-
this.resource = resource;
|
|
1208
|
-
this.name = name;
|
|
1209
|
-
this.fileService = fileService;
|
|
1210
|
-
this.mime = Mimes.binary;
|
|
1211
|
-
}
|
|
1212
|
-
getName() {
|
|
1213
|
-
return this.name;
|
|
1214
|
-
}
|
|
1215
|
-
getSize() {
|
|
1216
|
-
return this.size;
|
|
1217
|
-
}
|
|
1218
|
-
getMime() {
|
|
1219
|
-
return this.mime;
|
|
1220
|
-
}
|
|
1221
|
-
getETag() {
|
|
1222
|
-
return this.etag;
|
|
1223
|
-
}
|
|
1224
|
-
async resolve() {
|
|
1225
|
-
if (this.fileService.hasProvider(this.resource)) {
|
|
1226
|
-
const stat = await this.fileService.stat(this.resource);
|
|
1227
|
-
this.etag = stat.etag;
|
|
1228
|
-
if (typeof stat.size === 'number') {
|
|
1229
|
-
this.size = stat.size;
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
|
-
return super.resolve();
|
|
1233
|
-
}
|
|
1234
|
-
};
|
|
1235
|
-
BinaryEditorModel = ( (__decorate([
|
|
1236
|
-
( (__param(2, IFileService)))
|
|
1237
|
-
], BinaryEditorModel)));
|
|
1238
|
-
let FileEditorInput = class FileEditorInput extends AbstractTextResourceEditorInput {
|
|
1239
|
-
get typeId() {
|
|
1240
|
-
return FILE_EDITOR_INPUT_ID;
|
|
1241
|
-
}
|
|
1242
|
-
get editorId() {
|
|
1243
|
-
return DEFAULT_EDITOR_ASSOCIATION.id;
|
|
1244
|
-
}
|
|
1245
|
-
get capabilities() {
|
|
1246
|
-
let capabilities = 32 ;
|
|
1247
|
-
if (this.model) {
|
|
1248
|
-
if (this.model.isReadonly()) {
|
|
1249
|
-
capabilities |= 2 ;
|
|
1250
|
-
}
|
|
1251
|
-
}
|
|
1252
|
-
else {
|
|
1253
|
-
if (this.fileService.hasProvider(this.resource)) {
|
|
1254
|
-
if (this.fileService.hasCapability(this.resource, 2048 )) {
|
|
1255
|
-
capabilities |= 2 ;
|
|
1256
|
-
}
|
|
1257
|
-
}
|
|
1258
|
-
else {
|
|
1259
|
-
capabilities |= 4 ;
|
|
1260
|
-
}
|
|
1261
|
-
}
|
|
1262
|
-
if (!((capabilities & 2) )) {
|
|
1263
|
-
capabilities |= 128 ;
|
|
1264
|
-
}
|
|
1265
|
-
return capabilities;
|
|
1266
|
-
}
|
|
1267
|
-
constructor(resource, preferredResource, preferredName, preferredDescription, preferredEncoding, preferredLanguageId, preferredContents, instantiationService, textFileService, textModelResolverService, labelService, fileService, filesConfigurationService, editorService, pathService, textResourceConfigurationService) {
|
|
1268
|
-
super(resource, preferredResource, editorService, textFileService, labelService, fileService);
|
|
1269
|
-
this.instantiationService = instantiationService;
|
|
1270
|
-
this.textModelResolverService = textModelResolverService;
|
|
1271
|
-
this.filesConfigurationService = filesConfigurationService;
|
|
1272
|
-
this.pathService = pathService;
|
|
1273
|
-
this.textResourceConfigurationService = textResourceConfigurationService;
|
|
1274
|
-
this.forceOpenAs = 0 ;
|
|
1275
|
-
this.model = undefined;
|
|
1276
|
-
this.cachedTextFileModelReference = undefined;
|
|
1277
|
-
this.modelListeners = this._register(( (new DisposableStore())));
|
|
1278
|
-
this.model = this.textFileService.files.get(resource);
|
|
1279
|
-
if (preferredName) {
|
|
1280
|
-
this.setPreferredName(preferredName);
|
|
1281
|
-
}
|
|
1282
|
-
if (preferredDescription) {
|
|
1283
|
-
this.setPreferredDescription(preferredDescription);
|
|
1284
|
-
}
|
|
1285
|
-
if (preferredEncoding) {
|
|
1286
|
-
this.setPreferredEncoding(preferredEncoding);
|
|
1287
|
-
}
|
|
1288
|
-
if (preferredLanguageId) {
|
|
1289
|
-
this.setPreferredLanguageId(preferredLanguageId);
|
|
1290
|
-
}
|
|
1291
|
-
if (typeof preferredContents === 'string') {
|
|
1292
|
-
this.setPreferredContents(preferredContents);
|
|
1293
|
-
}
|
|
1294
|
-
this._register(this.textFileService.files.onDidCreate(model => this.onDidCreateTextFileModel(model)));
|
|
1295
|
-
if (this.model) {
|
|
1296
|
-
this.registerModelListeners(this.model);
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
|
-
onDidCreateTextFileModel(model) {
|
|
1300
|
-
if (isEqual(model.resource, this.resource)) {
|
|
1301
|
-
this.model = model;
|
|
1302
|
-
this.registerModelListeners(model);
|
|
1303
|
-
}
|
|
1304
|
-
}
|
|
1305
|
-
registerModelListeners(model) {
|
|
1306
|
-
this.modelListeners.clear();
|
|
1307
|
-
this.modelListeners.add(model.onDidChangeDirty(() => this._onDidChangeDirty.fire()));
|
|
1308
|
-
this.modelListeners.add(model.onDidChangeReadonly(() => this._onDidChangeCapabilities.fire()));
|
|
1309
|
-
this.modelListeners.add(model.onDidSaveError(() => this._onDidChangeDirty.fire()));
|
|
1310
|
-
this.modelListeners.add(Event.once(model.onWillDispose)(() => {
|
|
1311
|
-
this.modelListeners.clear();
|
|
1312
|
-
this.model = undefined;
|
|
1313
|
-
}));
|
|
1314
|
-
}
|
|
1315
|
-
getName() {
|
|
1316
|
-
return this.preferredName || super.getName();
|
|
1317
|
-
}
|
|
1318
|
-
setPreferredName(name) {
|
|
1319
|
-
if (!this.allowLabelOverride()) {
|
|
1320
|
-
return;
|
|
1321
|
-
}
|
|
1322
|
-
if (this.preferredName !== name) {
|
|
1323
|
-
this.preferredName = name;
|
|
1324
|
-
this._onDidChangeLabel.fire();
|
|
1325
|
-
}
|
|
1326
|
-
}
|
|
1327
|
-
allowLabelOverride() {
|
|
1328
|
-
return this.resource.scheme !== this.pathService.defaultUriScheme &&
|
|
1329
|
-
this.resource.scheme !== Schemas.vscodeUserData &&
|
|
1330
|
-
this.resource.scheme !== Schemas.file &&
|
|
1331
|
-
this.resource.scheme !== Schemas.vscodeRemote;
|
|
1332
|
-
}
|
|
1333
|
-
getPreferredName() {
|
|
1334
|
-
return this.preferredName;
|
|
1335
|
-
}
|
|
1336
|
-
getDescription(verbosity) {
|
|
1337
|
-
return this.preferredDescription || super.getDescription(verbosity);
|
|
1338
|
-
}
|
|
1339
|
-
setPreferredDescription(description) {
|
|
1340
|
-
if (!this.allowLabelOverride()) {
|
|
1341
|
-
return;
|
|
1342
|
-
}
|
|
1343
|
-
if (this.preferredDescription !== description) {
|
|
1344
|
-
this.preferredDescription = description;
|
|
1345
|
-
this._onDidChangeLabel.fire();
|
|
1346
|
-
}
|
|
1347
|
-
}
|
|
1348
|
-
getPreferredDescription() {
|
|
1349
|
-
return this.preferredDescription;
|
|
1350
|
-
}
|
|
1351
|
-
getEncoding() {
|
|
1352
|
-
if (this.model) {
|
|
1353
|
-
return this.model.getEncoding();
|
|
1354
|
-
}
|
|
1355
|
-
return this.preferredEncoding;
|
|
1356
|
-
}
|
|
1357
|
-
getPreferredEncoding() {
|
|
1358
|
-
return this.preferredEncoding;
|
|
1359
|
-
}
|
|
1360
|
-
async setEncoding(encoding, mode) {
|
|
1361
|
-
this.setPreferredEncoding(encoding);
|
|
1362
|
-
return this.model?.setEncoding(encoding, mode);
|
|
1363
|
-
}
|
|
1364
|
-
setPreferredEncoding(encoding) {
|
|
1365
|
-
this.preferredEncoding = encoding;
|
|
1366
|
-
this.setForceOpenAsText();
|
|
1367
|
-
}
|
|
1368
|
-
getLanguageId() {
|
|
1369
|
-
if (this.model) {
|
|
1370
|
-
return this.model.getLanguageId();
|
|
1371
|
-
}
|
|
1372
|
-
return this.preferredLanguageId;
|
|
1373
|
-
}
|
|
1374
|
-
getPreferredLanguageId() {
|
|
1375
|
-
return this.preferredLanguageId;
|
|
1376
|
-
}
|
|
1377
|
-
setLanguageId(languageId, source) {
|
|
1378
|
-
this.setPreferredLanguageId(languageId);
|
|
1379
|
-
this.model?.setLanguageId(languageId, source);
|
|
1380
|
-
}
|
|
1381
|
-
setPreferredLanguageId(languageId) {
|
|
1382
|
-
this.preferredLanguageId = languageId;
|
|
1383
|
-
this.setForceOpenAsText();
|
|
1384
|
-
}
|
|
1385
|
-
setPreferredContents(contents) {
|
|
1386
|
-
this.preferredContents = contents;
|
|
1387
|
-
this.setForceOpenAsText();
|
|
1388
|
-
}
|
|
1389
|
-
setForceOpenAsText() {
|
|
1390
|
-
this.forceOpenAs = 1 ;
|
|
1391
|
-
}
|
|
1392
|
-
setForceOpenAsBinary() {
|
|
1393
|
-
this.forceOpenAs = 2 ;
|
|
1394
|
-
}
|
|
1395
|
-
isDirty() {
|
|
1396
|
-
return !!(this.model?.isDirty());
|
|
1397
|
-
}
|
|
1398
|
-
isSaving() {
|
|
1399
|
-
if (this.model?.hasState(0 ) || this.model?.hasState(3 ) || this.model?.hasState(5 )) {
|
|
1400
|
-
return false;
|
|
1401
|
-
}
|
|
1402
|
-
if (this.filesConfigurationService.getAutoSaveMode() === 1 ) {
|
|
1403
|
-
return true;
|
|
1404
|
-
}
|
|
1405
|
-
return super.isSaving();
|
|
1406
|
-
}
|
|
1407
|
-
prefersEditorPane(editorPanes) {
|
|
1408
|
-
if (this.forceOpenAs === 2 ) {
|
|
1409
|
-
return editorPanes.find(editorPane => editorPane.typeId === BINARY_FILE_EDITOR_ID);
|
|
1410
|
-
}
|
|
1411
|
-
return editorPanes.find(editorPane => editorPane.typeId === TEXT_FILE_EDITOR_ID);
|
|
1412
|
-
}
|
|
1413
|
-
resolve(options) {
|
|
1414
|
-
if (this.forceOpenAs === 2 ) {
|
|
1415
|
-
return this.doResolveAsBinary();
|
|
1416
|
-
}
|
|
1417
|
-
return this.doResolveAsText(options);
|
|
1418
|
-
}
|
|
1419
|
-
async doResolveAsText(options) {
|
|
1420
|
-
try {
|
|
1421
|
-
const preferredContents = this.preferredContents;
|
|
1422
|
-
this.preferredContents = undefined;
|
|
1423
|
-
await this.textFileService.files.resolve(this.resource, {
|
|
1424
|
-
languageId: this.preferredLanguageId,
|
|
1425
|
-
encoding: this.preferredEncoding,
|
|
1426
|
-
contents: typeof preferredContents === 'string' ? createTextBufferFactory(preferredContents) : undefined,
|
|
1427
|
-
reload: { async: true },
|
|
1428
|
-
allowBinary: this.forceOpenAs === 1 ,
|
|
1429
|
-
reason: 1 ,
|
|
1430
|
-
limits: this.ensureLimits(options)
|
|
1431
|
-
});
|
|
1432
|
-
if (!this.cachedTextFileModelReference) {
|
|
1433
|
-
this.cachedTextFileModelReference = await this.textModelResolverService.createModelReference(this.resource);
|
|
1434
|
-
}
|
|
1435
|
-
const model = this.cachedTextFileModelReference.object;
|
|
1436
|
-
if (this.isDisposed()) {
|
|
1437
|
-
this.disposeModelReference();
|
|
1438
|
-
}
|
|
1439
|
-
return model;
|
|
1440
|
-
}
|
|
1441
|
-
catch (error) {
|
|
1442
|
-
if (error.textFileOperationResult === 0 ) {
|
|
1443
|
-
return this.doResolveAsBinary();
|
|
1444
|
-
}
|
|
1445
|
-
throw error;
|
|
1446
|
-
}
|
|
1447
|
-
}
|
|
1448
|
-
ensureLimits(options) {
|
|
1449
|
-
if (options?.limits) {
|
|
1450
|
-
return options.limits;
|
|
1451
|
-
}
|
|
1452
|
-
const defaultSizeLimit = getLargeFileConfirmationLimit(this.resource);
|
|
1453
|
-
let configuredSizeLimit = undefined;
|
|
1454
|
-
const configuredSizeLimitMb = this.textResourceConfigurationService.getValue(this.resource, 'workbench.editorLargeFileConfirmation');
|
|
1455
|
-
if (typeof configuredSizeLimitMb === 'number') {
|
|
1456
|
-
configuredSizeLimit = configuredSizeLimitMb * ByteSize.MB;
|
|
1457
|
-
}
|
|
1458
|
-
return {
|
|
1459
|
-
size: Math.max(defaultSizeLimit, configuredSizeLimit ?? defaultSizeLimit)
|
|
1460
|
-
};
|
|
1461
|
-
}
|
|
1462
|
-
async doResolveAsBinary() {
|
|
1463
|
-
const model = this.instantiationService.createInstance(BinaryEditorModel, this.preferredResource, this.getName());
|
|
1464
|
-
await model.resolve();
|
|
1465
|
-
return model;
|
|
1466
|
-
}
|
|
1467
|
-
isResolved() {
|
|
1468
|
-
return !!this.model;
|
|
1469
|
-
}
|
|
1470
|
-
async rename(group, target) {
|
|
1471
|
-
return {
|
|
1472
|
-
editor: {
|
|
1473
|
-
resource: target,
|
|
1474
|
-
encoding: this.getEncoding(),
|
|
1475
|
-
options: {
|
|
1476
|
-
viewState: findViewStateForEditor(this, group, this.editorService)
|
|
1477
|
-
}
|
|
1478
|
-
}
|
|
1479
|
-
};
|
|
1480
|
-
}
|
|
1481
|
-
toUntyped(options) {
|
|
1482
|
-
const untypedInput = {
|
|
1483
|
-
resource: this.preferredResource,
|
|
1484
|
-
forceFile: true,
|
|
1485
|
-
options: {
|
|
1486
|
-
override: this.editorId
|
|
1487
|
-
}
|
|
1488
|
-
};
|
|
1489
|
-
if (typeof options?.preserveViewState === 'number') {
|
|
1490
|
-
untypedInput.encoding = this.getEncoding();
|
|
1491
|
-
untypedInput.languageId = this.getLanguageId();
|
|
1492
|
-
untypedInput.contents = (() => {
|
|
1493
|
-
const model = this.textFileService.files.get(this.resource);
|
|
1494
|
-
if (model?.isDirty()) {
|
|
1495
|
-
return model.textEditorModel.getValue();
|
|
1496
|
-
}
|
|
1497
|
-
return undefined;
|
|
1498
|
-
})();
|
|
1499
|
-
untypedInput.options = {
|
|
1500
|
-
...untypedInput.options,
|
|
1501
|
-
viewState: findViewStateForEditor(this, options.preserveViewState, this.editorService)
|
|
1502
|
-
};
|
|
1503
|
-
}
|
|
1504
|
-
return untypedInput;
|
|
1505
|
-
}
|
|
1506
|
-
matches(otherInput) {
|
|
1507
|
-
if (this === otherInput) {
|
|
1508
|
-
return true;
|
|
1509
|
-
}
|
|
1510
|
-
if (otherInput instanceof FileEditorInput) {
|
|
1511
|
-
return isEqual(otherInput.resource, this.resource);
|
|
1512
|
-
}
|
|
1513
|
-
if (isResourceEditorInput(otherInput)) {
|
|
1514
|
-
return super.matches(otherInput);
|
|
1515
|
-
}
|
|
1516
|
-
return false;
|
|
1517
|
-
}
|
|
1518
|
-
dispose() {
|
|
1519
|
-
this.model = undefined;
|
|
1520
|
-
this.disposeModelReference();
|
|
1521
|
-
super.dispose();
|
|
1522
|
-
}
|
|
1523
|
-
disposeModelReference() {
|
|
1524
|
-
dispose(this.cachedTextFileModelReference);
|
|
1525
|
-
this.cachedTextFileModelReference = undefined;
|
|
1526
|
-
}
|
|
1527
|
-
};
|
|
1528
|
-
FileEditorInput = ( (__decorate([
|
|
1529
|
-
( (__param(7, IInstantiationService))),
|
|
1530
|
-
( (__param(8, ITextFileService))),
|
|
1531
|
-
( (__param(9, ITextModelService))),
|
|
1532
|
-
( (__param(10, ILabelService))),
|
|
1533
|
-
( (__param(11, IFileService))),
|
|
1534
|
-
( (__param(12, IFilesConfigurationService))),
|
|
1535
|
-
( (__param(13, IEditorService))),
|
|
1536
|
-
( (__param(14, IPathService))),
|
|
1537
|
-
( (__param(15, ITextResourceConfigurationService)))
|
|
1538
|
-
], FileEditorInput)));
|
|
1539
|
-
class ExplorerFileNestingTrie {
|
|
1540
|
-
constructor(config) {
|
|
1541
|
-
this.root = ( (new PreTrie()));
|
|
1542
|
-
for (const [parentPattern, childPatterns] of config) {
|
|
1543
|
-
for (const childPattern of childPatterns) {
|
|
1544
|
-
this.root.add(parentPattern, childPattern);
|
|
1545
|
-
}
|
|
1546
|
-
}
|
|
1547
|
-
}
|
|
1548
|
-
toString() {
|
|
1549
|
-
return (
|
|
1550
|
-
(this.root.toString())
|
|
1551
|
-
);
|
|
1552
|
-
}
|
|
1553
|
-
getAttributes(filename, dirname) {
|
|
1554
|
-
const lastDot = filename.lastIndexOf('.');
|
|
1555
|
-
if (lastDot < 1) {
|
|
1556
|
-
return {
|
|
1557
|
-
dirname,
|
|
1558
|
-
basename: filename,
|
|
1559
|
-
extname: ''
|
|
1560
|
-
};
|
|
1561
|
-
}
|
|
1562
|
-
else {
|
|
1563
|
-
return {
|
|
1564
|
-
dirname,
|
|
1565
|
-
basename: filename.substring(0, lastDot),
|
|
1566
|
-
extname: filename.substring(lastDot + 1)
|
|
1567
|
-
};
|
|
1568
|
-
}
|
|
1569
|
-
}
|
|
1570
|
-
nest(files, dirname) {
|
|
1571
|
-
const parentFinder = ( (new PreTrie()));
|
|
1572
|
-
for (const potentialParent of files) {
|
|
1573
|
-
const attributes = this.getAttributes(potentialParent, dirname);
|
|
1574
|
-
const children = this.root.get(potentialParent, attributes);
|
|
1575
|
-
for (const child of children) {
|
|
1576
|
-
parentFinder.add(child, potentialParent);
|
|
1577
|
-
}
|
|
1578
|
-
}
|
|
1579
|
-
const findAllRootAncestors = (file, seen = ( (new Set()))) => {
|
|
1580
|
-
if (seen.has(file)) {
|
|
1581
|
-
return [];
|
|
1582
|
-
}
|
|
1583
|
-
seen.add(file);
|
|
1584
|
-
const attributes = this.getAttributes(file, dirname);
|
|
1585
|
-
const ancestors = parentFinder.get(file, attributes);
|
|
1586
|
-
if (ancestors.length === 0) {
|
|
1587
|
-
return [file];
|
|
1588
|
-
}
|
|
1589
|
-
if (ancestors.length === 1 && ancestors[0] === file) {
|
|
1590
|
-
return [file];
|
|
1591
|
-
}
|
|
1592
|
-
return ancestors.flatMap(a => findAllRootAncestors(a, seen));
|
|
1593
|
-
};
|
|
1594
|
-
const result = ( (new Map()));
|
|
1595
|
-
for (const file of files) {
|
|
1596
|
-
let ancestors = findAllRootAncestors(file);
|
|
1597
|
-
if (ancestors.length === 0) {
|
|
1598
|
-
ancestors = [file];
|
|
1599
|
-
}
|
|
1600
|
-
for (const ancestor of ancestors) {
|
|
1601
|
-
let existing = result.get(ancestor);
|
|
1602
|
-
if (!existing) {
|
|
1603
|
-
result.set(ancestor, existing = ( (new Set())));
|
|
1604
|
-
}
|
|
1605
|
-
if (file !== ancestor) {
|
|
1606
|
-
existing.add(file);
|
|
1607
|
-
}
|
|
1608
|
-
}
|
|
1609
|
-
}
|
|
1610
|
-
return result;
|
|
1611
|
-
}
|
|
1612
|
-
}
|
|
1613
|
-
class PreTrie {
|
|
1614
|
-
constructor() {
|
|
1615
|
-
this.value = ( (new SufTrie()));
|
|
1616
|
-
this.map = ( (new Map()));
|
|
1617
|
-
}
|
|
1618
|
-
add(key, value) {
|
|
1619
|
-
if (key === '') {
|
|
1620
|
-
this.value.add(key, value);
|
|
1621
|
-
}
|
|
1622
|
-
else if (key[0] === '*') {
|
|
1623
|
-
this.value.add(key, value);
|
|
1624
|
-
}
|
|
1625
|
-
else {
|
|
1626
|
-
const head = key[0];
|
|
1627
|
-
const rest = key.slice(1);
|
|
1628
|
-
let existing = this.map.get(head);
|
|
1629
|
-
if (!existing) {
|
|
1630
|
-
this.map.set(head, existing = ( (new PreTrie())));
|
|
1631
|
-
}
|
|
1632
|
-
existing.add(rest, value);
|
|
1633
|
-
}
|
|
1634
|
-
}
|
|
1635
|
-
get(key, attributes) {
|
|
1636
|
-
const results = [];
|
|
1637
|
-
results.push(...this.value.get(key, attributes));
|
|
1638
|
-
const head = key[0];
|
|
1639
|
-
const rest = key.slice(1);
|
|
1640
|
-
const existing = this.map.get(head);
|
|
1641
|
-
if (existing) {
|
|
1642
|
-
results.push(...existing.get(rest, attributes));
|
|
1643
|
-
}
|
|
1644
|
-
return results;
|
|
1645
|
-
}
|
|
1646
|
-
toString(indentation = '') {
|
|
1647
|
-
const lines = [];
|
|
1648
|
-
if (this.value.hasItems) {
|
|
1649
|
-
lines.push('* => \n' + ( (this.value.toString(indentation + ' '))));
|
|
1650
|
-
}
|
|
1651
|
-
return ( (lines.map(l => indentation + l))).join('\n');
|
|
1652
|
-
}
|
|
1653
|
-
}
|
|
1654
|
-
class SufTrie {
|
|
1655
|
-
constructor() {
|
|
1656
|
-
this.star = [];
|
|
1657
|
-
this.epsilon = [];
|
|
1658
|
-
this.map = ( (new Map()));
|
|
1659
|
-
this.hasItems = false;
|
|
1660
|
-
}
|
|
1661
|
-
add(key, value) {
|
|
1662
|
-
this.hasItems = true;
|
|
1663
|
-
if (key === '*') {
|
|
1664
|
-
this.star.push(( (new SubstitutionString(value))));
|
|
1665
|
-
}
|
|
1666
|
-
else if (key === '') {
|
|
1667
|
-
this.epsilon.push(( (new SubstitutionString(value))));
|
|
1668
|
-
}
|
|
1669
|
-
else {
|
|
1670
|
-
const tail = key[key.length - 1];
|
|
1671
|
-
const rest = key.slice(0, key.length - 1);
|
|
1672
|
-
if (tail === '*') {
|
|
1673
|
-
throw Error('Unexpected star in SufTrie key: ' + key);
|
|
1674
|
-
}
|
|
1675
|
-
else {
|
|
1676
|
-
let existing = this.map.get(tail);
|
|
1677
|
-
if (!existing) {
|
|
1678
|
-
this.map.set(tail, existing = ( (new SufTrie())));
|
|
1679
|
-
}
|
|
1680
|
-
existing.add(rest, value);
|
|
1681
|
-
}
|
|
1682
|
-
}
|
|
1683
|
-
}
|
|
1684
|
-
get(key, attributes) {
|
|
1685
|
-
const results = [];
|
|
1686
|
-
if (key === '') {
|
|
1687
|
-
results.push(...( (this.epsilon.map(ss => ss.substitute(attributes)))));
|
|
1688
|
-
}
|
|
1689
|
-
if (this.star.length) {
|
|
1690
|
-
results.push(...( (this.star.map(ss => ss.substitute(attributes, key)))));
|
|
1691
|
-
}
|
|
1692
|
-
const tail = key[key.length - 1];
|
|
1693
|
-
const rest = key.slice(0, key.length - 1);
|
|
1694
|
-
const existing = this.map.get(tail);
|
|
1695
|
-
if (existing) {
|
|
1696
|
-
results.push(...existing.get(rest, attributes));
|
|
1697
|
-
}
|
|
1698
|
-
return results;
|
|
1699
|
-
}
|
|
1700
|
-
toString(indentation = '') {
|
|
1701
|
-
const lines = [];
|
|
1702
|
-
if (this.star.length) {
|
|
1703
|
-
lines.push('* => ' + this.star.join('; '));
|
|
1704
|
-
}
|
|
1705
|
-
if (this.epsilon.length) {
|
|
1706
|
-
lines.push('ε => ' + this.epsilon.join('; '));
|
|
1707
|
-
}
|
|
1708
|
-
return ( (lines.map(l => indentation + l))).join('\n');
|
|
1709
|
-
}
|
|
1710
|
-
}
|
|
1711
|
-
const substitutionStringTokenizer = /\$[({](capture|basename|dirname|extname)[)}]/g;
|
|
1712
|
-
class SubstitutionString {
|
|
1713
|
-
constructor(pattern) {
|
|
1714
|
-
this.tokens = [];
|
|
1715
|
-
substitutionStringTokenizer.lastIndex = 0;
|
|
1716
|
-
let token;
|
|
1717
|
-
let lastIndex = 0;
|
|
1718
|
-
while (token = substitutionStringTokenizer.exec(pattern)) {
|
|
1719
|
-
const prefix = pattern.slice(lastIndex, token.index);
|
|
1720
|
-
this.tokens.push(prefix);
|
|
1721
|
-
const type = token[1];
|
|
1722
|
-
switch (type) {
|
|
1723
|
-
case "basename" :
|
|
1724
|
-
case "dirname" :
|
|
1725
|
-
case "extname" :
|
|
1726
|
-
case "capture" :
|
|
1727
|
-
this.tokens.push({ capture: type });
|
|
1728
|
-
break;
|
|
1729
|
-
default: throw Error('unknown substitution type: ' + type);
|
|
1730
|
-
}
|
|
1731
|
-
lastIndex = token.index + token[0].length;
|
|
1732
|
-
}
|
|
1733
|
-
if (lastIndex !== pattern.length) {
|
|
1734
|
-
const suffix = pattern.slice(lastIndex, pattern.length);
|
|
1735
|
-
this.tokens.push(suffix);
|
|
1736
|
-
}
|
|
1737
|
-
}
|
|
1738
|
-
substitute(attributes, capture) {
|
|
1739
|
-
return ( (this.tokens.map(t => {
|
|
1740
|
-
if (typeof t === 'string') {
|
|
1741
|
-
return t;
|
|
1742
|
-
}
|
|
1743
|
-
switch (t.capture) {
|
|
1744
|
-
case "basename" : return attributes.basename;
|
|
1745
|
-
case "dirname" : return attributes.dirname;
|
|
1746
|
-
case "extname" : return attributes.extname;
|
|
1747
|
-
case "capture" : return capture || '';
|
|
1748
|
-
}
|
|
1749
|
-
}))).join('');
|
|
1750
|
-
}
|
|
1751
|
-
}
|
|
1752
|
-
class ExplorerModel {
|
|
1753
|
-
constructor(contextService, uriIdentityService, fileService, configService) {
|
|
1754
|
-
this.contextService = contextService;
|
|
1755
|
-
this.uriIdentityService = uriIdentityService;
|
|
1756
|
-
this._onDidChangeRoots = ( (new Emitter()));
|
|
1757
|
-
const setRoots = () => this._roots = ( (this.contextService.getWorkspace().folders
|
|
1758
|
-
.map(folder => ( (new ExplorerItem(
|
|
1759
|
-
folder.uri,
|
|
1760
|
-
fileService,
|
|
1761
|
-
configService,
|
|
1762
|
-
undefined,
|
|
1763
|
-
true,
|
|
1764
|
-
false,
|
|
1765
|
-
false,
|
|
1766
|
-
folder.name
|
|
1767
|
-
))))));
|
|
1768
|
-
setRoots();
|
|
1769
|
-
this._listener = this.contextService.onDidChangeWorkspaceFolders(() => {
|
|
1770
|
-
setRoots();
|
|
1771
|
-
this._onDidChangeRoots.fire();
|
|
1772
|
-
});
|
|
1773
|
-
}
|
|
1774
|
-
get roots() {
|
|
1775
|
-
return this._roots;
|
|
1776
|
-
}
|
|
1777
|
-
get onDidChangeRoots() {
|
|
1778
|
-
return this._onDidChangeRoots.event;
|
|
1779
|
-
}
|
|
1780
|
-
findAll(resource) {
|
|
1781
|
-
return coalesce(( (this.roots.map(root => root.find(resource)))));
|
|
1782
|
-
}
|
|
1783
|
-
findClosest(resource) {
|
|
1784
|
-
const folder = this.contextService.getWorkspaceFolder(resource);
|
|
1785
|
-
if (folder) {
|
|
1786
|
-
const root = this.roots.find(r => this.uriIdentityService.extUri.isEqual(r.resource, folder.uri));
|
|
1787
|
-
if (root) {
|
|
1788
|
-
return root.find(resource);
|
|
1789
|
-
}
|
|
1790
|
-
}
|
|
1791
|
-
return null;
|
|
1792
|
-
}
|
|
1793
|
-
dispose() {
|
|
1794
|
-
dispose(this._listener);
|
|
1795
|
-
}
|
|
1796
|
-
}
|
|
1797
|
-
class ExplorerItem {
|
|
1798
|
-
constructor(resource, fileService, configService, _parent, _isDirectory, _isSymbolicLink, _readonly, _name = basenameOrAuthority(resource), _mtime, _unknown = false) {
|
|
1799
|
-
this.resource = resource;
|
|
1800
|
-
this.fileService = fileService;
|
|
1801
|
-
this.configService = configService;
|
|
1802
|
-
this._parent = _parent;
|
|
1803
|
-
this._isDirectory = _isDirectory;
|
|
1804
|
-
this._isSymbolicLink = _isSymbolicLink;
|
|
1805
|
-
this._readonly = _readonly;
|
|
1806
|
-
this._name = _name;
|
|
1807
|
-
this._mtime = _mtime;
|
|
1808
|
-
this._unknown = _unknown;
|
|
1809
|
-
this.error = undefined;
|
|
1810
|
-
this._isExcluded = false;
|
|
1811
|
-
this._isDirectoryResolved = false;
|
|
1812
|
-
}
|
|
1813
|
-
get isExcluded() {
|
|
1814
|
-
if (this._isExcluded) {
|
|
1815
|
-
return true;
|
|
1816
|
-
}
|
|
1817
|
-
if (!this._parent) {
|
|
1818
|
-
return false;
|
|
1819
|
-
}
|
|
1820
|
-
return this._parent.isExcluded;
|
|
1821
|
-
}
|
|
1822
|
-
set isExcluded(value) {
|
|
1823
|
-
this._isExcluded = value;
|
|
1824
|
-
}
|
|
1825
|
-
hasChildren(filter) {
|
|
1826
|
-
if (this.hasNests) {
|
|
1827
|
-
return this.nestedChildren?.some(c => filter(c)) ?? false;
|
|
1828
|
-
}
|
|
1829
|
-
else {
|
|
1830
|
-
return this.isDirectory;
|
|
1831
|
-
}
|
|
1832
|
-
}
|
|
1833
|
-
get hasNests() {
|
|
1834
|
-
return !!(this.nestedChildren?.length);
|
|
1835
|
-
}
|
|
1836
|
-
get isDirectoryResolved() {
|
|
1837
|
-
return this._isDirectoryResolved;
|
|
1838
|
-
}
|
|
1839
|
-
get isSymbolicLink() {
|
|
1840
|
-
return !!this._isSymbolicLink;
|
|
1841
|
-
}
|
|
1842
|
-
get isDirectory() {
|
|
1843
|
-
return !!this._isDirectory;
|
|
1844
|
-
}
|
|
1845
|
-
get isReadonly() {
|
|
1846
|
-
return this._readonly || this.fileService.hasCapability(this.resource, 2048 );
|
|
1847
|
-
}
|
|
1848
|
-
get mtime() {
|
|
1849
|
-
return this._mtime;
|
|
1850
|
-
}
|
|
1851
|
-
get name() {
|
|
1852
|
-
return this._name;
|
|
1853
|
-
}
|
|
1854
|
-
get isUnknown() {
|
|
1855
|
-
return this._unknown;
|
|
1856
|
-
}
|
|
1857
|
-
get parent() {
|
|
1858
|
-
return this._parent;
|
|
1859
|
-
}
|
|
1860
|
-
get root() {
|
|
1861
|
-
if (!this._parent) {
|
|
1862
|
-
return this;
|
|
1863
|
-
}
|
|
1864
|
-
return this._parent.root;
|
|
1865
|
-
}
|
|
1866
|
-
get children() {
|
|
1867
|
-
return (
|
|
1868
|
-
(new Map())
|
|
1869
|
-
);
|
|
1870
|
-
}
|
|
1871
|
-
updateName(value) {
|
|
1872
|
-
this._parent?.removeChild(this);
|
|
1873
|
-
this._name = value;
|
|
1874
|
-
this._parent?.addChild(this);
|
|
1875
|
-
}
|
|
1876
|
-
getId() {
|
|
1877
|
-
return ( (this.root.resource.toString())) + '::' + ( (this.resource.toString()));
|
|
1878
|
-
}
|
|
1879
|
-
toString() {
|
|
1880
|
-
return `ExplorerItem: ${this.name}`;
|
|
1881
|
-
}
|
|
1882
|
-
get isRoot() {
|
|
1883
|
-
return this === this.root;
|
|
1884
|
-
}
|
|
1885
|
-
static create(fileService, configService, raw, parent, resolveTo) {
|
|
1886
|
-
const stat = ( (new ExplorerItem(
|
|
1887
|
-
raw.resource,
|
|
1888
|
-
fileService,
|
|
1889
|
-
configService,
|
|
1890
|
-
parent,
|
|
1891
|
-
raw.isDirectory,
|
|
1892
|
-
raw.isSymbolicLink,
|
|
1893
|
-
raw.readonly,
|
|
1894
|
-
raw.name,
|
|
1895
|
-
raw.mtime,
|
|
1896
|
-
!raw.isFile && !raw.isDirectory
|
|
1897
|
-
)));
|
|
1898
|
-
if (stat.isDirectory) {
|
|
1899
|
-
stat._isDirectoryResolved = !!raw.children || (!!resolveTo && resolveTo.some((r) => {
|
|
1900
|
-
return isEqualOrParent(r, stat.resource);
|
|
1901
|
-
}));
|
|
1902
|
-
if (raw.children) {
|
|
1903
|
-
for (let i = 0, len = raw.children.length; i < len; i++) {
|
|
1904
|
-
const child = ExplorerItem.create(fileService, configService, raw.children[i], stat, resolveTo);
|
|
1905
|
-
stat.addChild(child);
|
|
1906
|
-
}
|
|
1907
|
-
}
|
|
1908
|
-
}
|
|
1909
|
-
return stat;
|
|
1910
|
-
}
|
|
1911
|
-
static mergeLocalWithDisk(disk, local) {
|
|
1912
|
-
if (( (disk.resource.toString())) !== ( (local.resource.toString()))) {
|
|
1913
|
-
return;
|
|
1914
|
-
}
|
|
1915
|
-
const mergingDirectories = disk.isDirectory || local.isDirectory;
|
|
1916
|
-
if (mergingDirectories && local._isDirectoryResolved && !disk._isDirectoryResolved) {
|
|
1917
|
-
return;
|
|
1918
|
-
}
|
|
1919
|
-
local.resource = disk.resource;
|
|
1920
|
-
if (!local.isRoot) {
|
|
1921
|
-
local.updateName(disk.name);
|
|
1922
|
-
}
|
|
1923
|
-
local._isDirectory = disk.isDirectory;
|
|
1924
|
-
local._mtime = disk.mtime;
|
|
1925
|
-
local._isDirectoryResolved = disk._isDirectoryResolved;
|
|
1926
|
-
local._isSymbolicLink = disk.isSymbolicLink;
|
|
1927
|
-
local.error = disk.error;
|
|
1928
|
-
if (mergingDirectories && disk._isDirectoryResolved) {
|
|
1929
|
-
const oldLocalChildren = ( (new ResourceMap()));
|
|
1930
|
-
local.children.forEach(child => {
|
|
1931
|
-
oldLocalChildren.set(child.resource, child);
|
|
1932
|
-
});
|
|
1933
|
-
local.children.clear();
|
|
1934
|
-
disk.children.forEach(diskChild => {
|
|
1935
|
-
const formerLocalChild = oldLocalChildren.get(diskChild.resource);
|
|
1936
|
-
if (formerLocalChild) {
|
|
1937
|
-
ExplorerItem.mergeLocalWithDisk(diskChild, formerLocalChild);
|
|
1938
|
-
local.addChild(formerLocalChild);
|
|
1939
|
-
oldLocalChildren.delete(diskChild.resource);
|
|
1940
|
-
}
|
|
1941
|
-
else {
|
|
1942
|
-
local.addChild(diskChild);
|
|
1943
|
-
}
|
|
1944
|
-
});
|
|
1945
|
-
oldLocalChildren.forEach(oldChild => {
|
|
1946
|
-
if (oldChild instanceof NewExplorerItem) {
|
|
1947
|
-
local.addChild(oldChild);
|
|
1948
|
-
}
|
|
1949
|
-
});
|
|
1950
|
-
}
|
|
1951
|
-
}
|
|
1952
|
-
addChild(child) {
|
|
1953
|
-
child._parent = this;
|
|
1954
|
-
child.updateResource(false);
|
|
1955
|
-
this.children.set(this.getPlatformAwareName(child.name), child);
|
|
1956
|
-
}
|
|
1957
|
-
getChild(name) {
|
|
1958
|
-
return this.children.get(this.getPlatformAwareName(name));
|
|
1959
|
-
}
|
|
1960
|
-
fetchChildren(sortOrder) {
|
|
1961
|
-
const nestingConfig = this.configService.getValue({ resource: this.root.resource }).explorer.fileNesting;
|
|
1962
|
-
if (nestingConfig.enabled && this.nestedChildren) {
|
|
1963
|
-
return this.nestedChildren;
|
|
1964
|
-
}
|
|
1965
|
-
return (async () => {
|
|
1966
|
-
if (!this._isDirectoryResolved) {
|
|
1967
|
-
const resolveMetadata = sortOrder === "modified" ;
|
|
1968
|
-
this.error = undefined;
|
|
1969
|
-
try {
|
|
1970
|
-
const stat = await this.fileService.resolve(this.resource, { resolveSingleChildDescendants: true, resolveMetadata });
|
|
1971
|
-
const resolved = ExplorerItem.create(this.fileService, this.configService, stat, this);
|
|
1972
|
-
ExplorerItem.mergeLocalWithDisk(resolved, this);
|
|
1973
|
-
}
|
|
1974
|
-
catch (e) {
|
|
1975
|
-
this.error = e;
|
|
1976
|
-
throw e;
|
|
1977
|
-
}
|
|
1978
|
-
this._isDirectoryResolved = true;
|
|
1979
|
-
}
|
|
1980
|
-
const items = [];
|
|
1981
|
-
if (nestingConfig.enabled) {
|
|
1982
|
-
const fileChildren = [];
|
|
1983
|
-
const dirChildren = [];
|
|
1984
|
-
for (const child of this.children.entries()) {
|
|
1985
|
-
child[1].nestedParent = undefined;
|
|
1986
|
-
if (child[1].isDirectory) {
|
|
1987
|
-
dirChildren.push(child);
|
|
1988
|
-
}
|
|
1989
|
-
else {
|
|
1990
|
-
fileChildren.push(child);
|
|
1991
|
-
}
|
|
1992
|
-
}
|
|
1993
|
-
const nested = this.fileNester.nest(( (fileChildren.map(([name]) => name))), this.getPlatformAwareName(this.name));
|
|
1994
|
-
for (const [fileEntryName, fileEntryItem] of fileChildren) {
|
|
1995
|
-
const nestedItems = nested.get(fileEntryName);
|
|
1996
|
-
if (nestedItems !== undefined) {
|
|
1997
|
-
fileEntryItem.nestedChildren = [];
|
|
1998
|
-
for (const name of ( (nestedItems.keys()))) {
|
|
1999
|
-
const child = assertIsDefined(this.children.get(name));
|
|
2000
|
-
fileEntryItem.nestedChildren.push(child);
|
|
2001
|
-
child.nestedParent = fileEntryItem;
|
|
2002
|
-
}
|
|
2003
|
-
items.push(fileEntryItem);
|
|
2004
|
-
}
|
|
2005
|
-
else {
|
|
2006
|
-
fileEntryItem.nestedChildren = undefined;
|
|
2007
|
-
}
|
|
2008
|
-
}
|
|
2009
|
-
for (const [_, dirEntryItem] of ( (dirChildren.values()))) {
|
|
2010
|
-
items.push(dirEntryItem);
|
|
2011
|
-
}
|
|
2012
|
-
}
|
|
2013
|
-
else {
|
|
2014
|
-
this.children.forEach(child => {
|
|
2015
|
-
items.push(child);
|
|
2016
|
-
});
|
|
2017
|
-
}
|
|
2018
|
-
return items;
|
|
2019
|
-
})();
|
|
2020
|
-
}
|
|
2021
|
-
get fileNester() {
|
|
2022
|
-
if (!this.root._fileNester) {
|
|
2023
|
-
const nestingConfig = this.configService.getValue({ resource: this.root.resource }).explorer.fileNesting;
|
|
2024
|
-
const patterns = ( (Object.entries(nestingConfig.patterns)
|
|
2025
|
-
.filter(entry => typeof (entry[0]) === 'string' && typeof (entry[1]) === 'string' && entry[0] && entry[1])
|
|
2026
|
-
.map(([parentPattern, childrenPatterns]) => [
|
|
2027
|
-
this.getPlatformAwareName(parentPattern.trim()),
|
|
2028
|
-
( (childrenPatterns.split(',').map(p => this.getPlatformAwareName(p.trim().replace(/\u200b/g, '')))))
|
|
2029
|
-
])));
|
|
2030
|
-
this.root._fileNester = ( (new ExplorerFileNestingTrie(patterns)));
|
|
2031
|
-
}
|
|
2032
|
-
return this.root._fileNester;
|
|
2033
|
-
}
|
|
2034
|
-
removeChild(child) {
|
|
2035
|
-
this.nestedChildren = undefined;
|
|
2036
|
-
this.children.delete(this.getPlatformAwareName(child.name));
|
|
2037
|
-
}
|
|
2038
|
-
forgetChildren() {
|
|
2039
|
-
this.children.clear();
|
|
2040
|
-
this.nestedChildren = undefined;
|
|
2041
|
-
this._isDirectoryResolved = false;
|
|
2042
|
-
this._fileNester = undefined;
|
|
2043
|
-
}
|
|
2044
|
-
getPlatformAwareName(name) {
|
|
2045
|
-
return this.fileService.hasCapability(this.resource, 1024 ) ? name : name.toLowerCase();
|
|
2046
|
-
}
|
|
2047
|
-
move(newParent) {
|
|
2048
|
-
this.nestedParent?.removeChild(this);
|
|
2049
|
-
this._parent?.removeChild(this);
|
|
2050
|
-
newParent.removeChild(this);
|
|
2051
|
-
newParent.addChild(this);
|
|
2052
|
-
this.updateResource(true);
|
|
2053
|
-
}
|
|
2054
|
-
updateResource(recursive) {
|
|
2055
|
-
if (this._parent) {
|
|
2056
|
-
this.resource = joinPath(this._parent.resource, this.name);
|
|
2057
|
-
}
|
|
2058
|
-
if (recursive) {
|
|
2059
|
-
if (this.isDirectory) {
|
|
2060
|
-
this.children.forEach(child => {
|
|
2061
|
-
child.updateResource(true);
|
|
2062
|
-
});
|
|
2063
|
-
}
|
|
2064
|
-
}
|
|
2065
|
-
}
|
|
2066
|
-
rename(renamedStat) {
|
|
2067
|
-
this.updateName(renamedStat.name);
|
|
2068
|
-
this._mtime = renamedStat.mtime;
|
|
2069
|
-
this.updateResource(true);
|
|
2070
|
-
}
|
|
2071
|
-
find(resource) {
|
|
2072
|
-
const ignoreCase = !this.fileService.hasCapability(resource, 1024 );
|
|
2073
|
-
if (resource && this.resource.scheme === resource.scheme && equalsIgnoreCase(this.resource.authority, resource.authority) &&
|
|
2074
|
-
(ignoreCase ? startsWithIgnoreCase(resource.path, this.resource.path) : resource.path.startsWith(this.resource.path))) {
|
|
2075
|
-
return this.findByPath(rtrim(resource.path, posix.sep), this.resource.path.length, ignoreCase);
|
|
2076
|
-
}
|
|
2077
|
-
return null;
|
|
2078
|
-
}
|
|
2079
|
-
findByPath(path, index, ignoreCase) {
|
|
2080
|
-
if (isEqual$1(rtrim(this.resource.path, posix.sep), path, ignoreCase)) {
|
|
2081
|
-
return this;
|
|
2082
|
-
}
|
|
2083
|
-
if (this.isDirectory) {
|
|
2084
|
-
while (index < path.length && path[index] === posix.sep) {
|
|
2085
|
-
index++;
|
|
2086
|
-
}
|
|
2087
|
-
let indexOfNextSep = path.indexOf(posix.sep, index);
|
|
2088
|
-
if (indexOfNextSep === -1) {
|
|
2089
|
-
indexOfNextSep = path.length;
|
|
2090
|
-
}
|
|
2091
|
-
const name = path.substring(index, indexOfNextSep);
|
|
2092
|
-
const child = this.children.get(this.getPlatformAwareName(name));
|
|
2093
|
-
if (child) {
|
|
2094
|
-
return child.findByPath(path, indexOfNextSep, ignoreCase);
|
|
2095
|
-
}
|
|
2096
|
-
}
|
|
2097
|
-
return null;
|
|
2098
|
-
}
|
|
2099
|
-
}
|
|
2100
|
-
ExplorerItem.__decorator = ( (__decorate([
|
|
2101
|
-
memoize
|
|
2102
|
-
], ExplorerItem.prototype, "children", null)));
|
|
2103
|
-
class NewExplorerItem extends ExplorerItem {
|
|
2104
|
-
constructor(fileService, configService, parent, isDirectory) {
|
|
2105
|
-
super(URI.file(''), fileService, configService, parent, isDirectory);
|
|
2106
|
-
this._isDirectoryResolved = true;
|
|
2107
|
-
}
|
|
2108
|
-
}
|
|
2109
|
-
const IExplorerService = ( (createDecorator('explorerService')));
|
|
2110
|
-
let ResourceGlobMatcher = class ResourceGlobMatcher extends Disposable {
|
|
2111
|
-
constructor(globFn, shouldUpdate, contextService, configurationService) {
|
|
2112
|
-
super();
|
|
2113
|
-
this.globFn = globFn;
|
|
2114
|
-
this.shouldUpdate = shouldUpdate;
|
|
2115
|
-
this.contextService = contextService;
|
|
2116
|
-
this.configurationService = configurationService;
|
|
2117
|
-
this._onExpressionChange = this._register(( (new Emitter())));
|
|
2118
|
-
this.onExpressionChange = this._onExpressionChange.event;
|
|
2119
|
-
this.mapRootToParsedExpression = ( (new Map()));
|
|
2120
|
-
this.mapRootToExpressionConfig = ( (new Map()));
|
|
2121
|
-
this.updateExcludes(false);
|
|
2122
|
-
this.registerListeners();
|
|
2123
|
-
}
|
|
2124
|
-
registerListeners() {
|
|
2125
|
-
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
|
2126
|
-
if (this.shouldUpdate(e)) {
|
|
2127
|
-
this.updateExcludes(true);
|
|
2128
|
-
}
|
|
2129
|
-
}));
|
|
2130
|
-
this._register(this.contextService.onDidChangeWorkspaceFolders(() => this.updateExcludes(true)));
|
|
2131
|
-
}
|
|
2132
|
-
updateExcludes(fromEvent) {
|
|
2133
|
-
let changed = false;
|
|
2134
|
-
this.contextService.getWorkspace().folders.forEach(folder => {
|
|
2135
|
-
const rootExcludes = this.globFn(folder.uri);
|
|
2136
|
-
if (!this.mapRootToExpressionConfig.has(( (folder.uri.toString()))) || !equals(this.mapRootToExpressionConfig.get(( (folder.uri.toString()))), rootExcludes)) {
|
|
2137
|
-
changed = true;
|
|
2138
|
-
this.mapRootToParsedExpression.set(( (folder.uri.toString())), parse(rootExcludes));
|
|
2139
|
-
this.mapRootToExpressionConfig.set(( (folder.uri.toString())), deepClone(rootExcludes));
|
|
2140
|
-
}
|
|
2141
|
-
});
|
|
2142
|
-
this.mapRootToExpressionConfig.forEach((value, root) => {
|
|
2143
|
-
if (root === ResourceGlobMatcher.NO_ROOT) {
|
|
2144
|
-
return;
|
|
2145
|
-
}
|
|
2146
|
-
if (root && !this.contextService.getWorkspaceFolder(( (URI.parse(root))))) {
|
|
2147
|
-
this.mapRootToParsedExpression.delete(root);
|
|
2148
|
-
this.mapRootToExpressionConfig.delete(root);
|
|
2149
|
-
changed = true;
|
|
2150
|
-
}
|
|
2151
|
-
});
|
|
2152
|
-
const globalExcludes = this.globFn();
|
|
2153
|
-
if (!this.mapRootToExpressionConfig.has(ResourceGlobMatcher.NO_ROOT) || !equals(this.mapRootToExpressionConfig.get(ResourceGlobMatcher.NO_ROOT), globalExcludes)) {
|
|
2154
|
-
changed = true;
|
|
2155
|
-
this.mapRootToParsedExpression.set(ResourceGlobMatcher.NO_ROOT, parse(globalExcludes));
|
|
2156
|
-
this.mapRootToExpressionConfig.set(ResourceGlobMatcher.NO_ROOT, deepClone(globalExcludes));
|
|
2157
|
-
}
|
|
2158
|
-
if (fromEvent && changed) {
|
|
2159
|
-
this._onExpressionChange.fire();
|
|
2160
|
-
}
|
|
2161
|
-
}
|
|
2162
|
-
matches(resource, hasSibling) {
|
|
2163
|
-
const folder = this.contextService.getWorkspaceFolder(resource);
|
|
2164
|
-
let expressionForRoot;
|
|
2165
|
-
if (folder && this.mapRootToParsedExpression.has(( (folder.uri.toString())))) {
|
|
2166
|
-
expressionForRoot = this.mapRootToParsedExpression.get(( (folder.uri.toString())));
|
|
2167
|
-
}
|
|
2168
|
-
else {
|
|
2169
|
-
expressionForRoot = this.mapRootToParsedExpression.get(ResourceGlobMatcher.NO_ROOT);
|
|
2170
|
-
}
|
|
2171
|
-
let resourcePathToMatch;
|
|
2172
|
-
if (folder) {
|
|
2173
|
-
resourcePathToMatch = relativePath(folder.uri, resource);
|
|
2174
|
-
}
|
|
2175
|
-
else {
|
|
2176
|
-
resourcePathToMatch = resource.fsPath;
|
|
2177
|
-
}
|
|
2178
|
-
return !!expressionForRoot && typeof resourcePathToMatch === 'string' && !!expressionForRoot(resourcePathToMatch, undefined, hasSibling);
|
|
2179
|
-
}
|
|
2180
|
-
};
|
|
2181
|
-
ResourceGlobMatcher.NO_ROOT = null;
|
|
2182
|
-
ResourceGlobMatcher = ( (__decorate([
|
|
2183
|
-
( (__param(2, IWorkspaceContextService))),
|
|
2184
|
-
( (__param(3, IConfigurationService)))
|
|
2185
|
-
], ResourceGlobMatcher)));
|
|
2186
|
-
const UNDO_REDO_SOURCE = ( (new UndoRedoSource()));
|
|
2187
|
-
let ExplorerService = class ExplorerService {
|
|
2188
|
-
constructor(fileService, configurationService, contextService, clipboardService, editorService, uriIdentityService, bulkEditService, progressService, hostService) {
|
|
2189
|
-
this.fileService = fileService;
|
|
2190
|
-
this.configurationService = configurationService;
|
|
2191
|
-
this.contextService = contextService;
|
|
2192
|
-
this.clipboardService = clipboardService;
|
|
2193
|
-
this.editorService = editorService;
|
|
2194
|
-
this.uriIdentityService = uriIdentityService;
|
|
2195
|
-
this.bulkEditService = bulkEditService;
|
|
2196
|
-
this.progressService = progressService;
|
|
2197
|
-
this.disposables = ( (new DisposableStore()));
|
|
2198
|
-
this.fileChangeEvents = [];
|
|
2199
|
-
this.config = this.configurationService.getValue('explorer');
|
|
2200
|
-
this.model = ( (new ExplorerModel(
|
|
2201
|
-
this.contextService,
|
|
2202
|
-
this.uriIdentityService,
|
|
2203
|
-
this.fileService,
|
|
2204
|
-
this.configurationService
|
|
2205
|
-
)));
|
|
2206
|
-
this.disposables.add(this.model);
|
|
2207
|
-
this.disposables.add(this.fileService.onDidRunOperation(e => this.onDidRunOperation(e)));
|
|
2208
|
-
this.onFileChangesScheduler = ( (new RunOnceScheduler(async () => {
|
|
2209
|
-
const events = this.fileChangeEvents;
|
|
2210
|
-
this.fileChangeEvents = [];
|
|
2211
|
-
const types = [2 ];
|
|
2212
|
-
if (this.config.sortOrder === "modified" ) {
|
|
2213
|
-
types.push(0 );
|
|
2214
|
-
}
|
|
2215
|
-
let shouldRefresh = false;
|
|
2216
|
-
this.roots.forEach(r => {
|
|
2217
|
-
if (this.view && !shouldRefresh) {
|
|
2218
|
-
shouldRefresh = doesFileEventAffect(r, this.view, events, types);
|
|
2219
|
-
}
|
|
2220
|
-
});
|
|
2221
|
-
events.forEach(e => {
|
|
2222
|
-
if (!shouldRefresh) {
|
|
2223
|
-
for (const resource of e.rawAdded) {
|
|
2224
|
-
const parent = this.model.findClosest(dirname(resource));
|
|
2225
|
-
if (parent && !parent.getChild(basename(resource))) {
|
|
2226
|
-
shouldRefresh = true;
|
|
2227
|
-
break;
|
|
2228
|
-
}
|
|
2229
|
-
}
|
|
2230
|
-
}
|
|
2231
|
-
});
|
|
2232
|
-
if (shouldRefresh) {
|
|
2233
|
-
await this.refresh(false);
|
|
2234
|
-
}
|
|
2235
|
-
}, ExplorerService.EXPLORER_FILE_CHANGES_REACT_DELAY)));
|
|
2236
|
-
this.disposables.add(this.fileService.onDidFilesChange(e => {
|
|
2237
|
-
this.fileChangeEvents.push(e);
|
|
2238
|
-
if (this.editable) {
|
|
2239
|
-
return;
|
|
2240
|
-
}
|
|
2241
|
-
if (!this.onFileChangesScheduler.isScheduled()) {
|
|
2242
|
-
this.onFileChangesScheduler.schedule();
|
|
2243
|
-
}
|
|
2244
|
-
}));
|
|
2245
|
-
this.disposables.add(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(e)));
|
|
2246
|
-
this.disposables.add(Event.any(this.fileService.onDidChangeFileSystemProviderRegistrations, this.fileService.onDidChangeFileSystemProviderCapabilities)(async (e) => {
|
|
2247
|
-
let affected = false;
|
|
2248
|
-
this.model.roots.forEach(r => {
|
|
2249
|
-
if (r.resource.scheme === e.scheme) {
|
|
2250
|
-
affected = true;
|
|
2251
|
-
r.forgetChildren();
|
|
2252
|
-
}
|
|
2253
|
-
});
|
|
2254
|
-
if (affected) {
|
|
2255
|
-
if (this.view) {
|
|
2256
|
-
await this.view.setTreeInput();
|
|
2257
|
-
}
|
|
2258
|
-
}
|
|
2259
|
-
}));
|
|
2260
|
-
this.disposables.add(this.model.onDidChangeRoots(() => {
|
|
2261
|
-
this.view?.setTreeInput();
|
|
2262
|
-
}));
|
|
2263
|
-
this.disposables.add(hostService.onDidChangeFocus(hasFocus => {
|
|
2264
|
-
if (hasFocus) {
|
|
2265
|
-
this.refresh(false);
|
|
2266
|
-
}
|
|
2267
|
-
}));
|
|
2268
|
-
this.revealExcludeMatcher = ( (new ResourceGlobMatcher(
|
|
2269
|
-
(uri) => getRevealExcludes(configurationService.getValue({ resource: uri })),
|
|
2270
|
-
(event) => event.affectsConfiguration('explorer.autoRevealExclude'),
|
|
2271
|
-
contextService,
|
|
2272
|
-
configurationService
|
|
2273
|
-
)));
|
|
2274
|
-
this.disposables.add(this.revealExcludeMatcher);
|
|
2275
|
-
}
|
|
2276
|
-
get roots() {
|
|
2277
|
-
return this.model.roots;
|
|
2278
|
-
}
|
|
2279
|
-
get sortOrderConfiguration() {
|
|
2280
|
-
return {
|
|
2281
|
-
sortOrder: this.config.sortOrder,
|
|
2282
|
-
lexicographicOptions: this.config.sortOrderLexicographicOptions,
|
|
2283
|
-
};
|
|
2284
|
-
}
|
|
2285
|
-
registerView(contextProvider) {
|
|
2286
|
-
this.view = contextProvider;
|
|
2287
|
-
}
|
|
2288
|
-
getContext(respectMultiSelection, ignoreNestedChildren = false) {
|
|
2289
|
-
if (!this.view) {
|
|
2290
|
-
return [];
|
|
2291
|
-
}
|
|
2292
|
-
const items = ( (new Set(this.view.getContext(respectMultiSelection))));
|
|
2293
|
-
items.forEach(item => {
|
|
2294
|
-
try {
|
|
2295
|
-
if (respectMultiSelection && !ignoreNestedChildren && this.view?.isItemCollapsed(item) && item.nestedChildren) {
|
|
2296
|
-
for (const child of item.nestedChildren) {
|
|
2297
|
-
items.add(child);
|
|
2298
|
-
}
|
|
2299
|
-
}
|
|
2300
|
-
}
|
|
2301
|
-
catch {
|
|
2302
|
-
return;
|
|
2303
|
-
}
|
|
2304
|
-
});
|
|
2305
|
-
return [...items];
|
|
2306
|
-
}
|
|
2307
|
-
async applyBulkEdit(edit, options) {
|
|
2308
|
-
const cancellationTokenSource = ( (new CancellationTokenSource()));
|
|
2309
|
-
const promise = this.progressService.withProgress({
|
|
2310
|
-
location: options.progressLocation || 10 ,
|
|
2311
|
-
title: options.progressLabel,
|
|
2312
|
-
cancellable: edit.length > 1,
|
|
2313
|
-
delay: 500,
|
|
2314
|
-
}, async (progress) => {
|
|
2315
|
-
await this.bulkEditService.apply(edit, {
|
|
2316
|
-
undoRedoSource: UNDO_REDO_SOURCE,
|
|
2317
|
-
label: options.undoLabel,
|
|
2318
|
-
code: 'undoredo.explorerOperation',
|
|
2319
|
-
progress,
|
|
2320
|
-
token: cancellationTokenSource.token,
|
|
2321
|
-
confirmBeforeUndo: options.confirmBeforeUndo
|
|
2322
|
-
});
|
|
2323
|
-
}, () => cancellationTokenSource.cancel());
|
|
2324
|
-
await this.progressService.withProgress({ location: 1 , delay: 500 }, () => promise);
|
|
2325
|
-
cancellationTokenSource.dispose();
|
|
2326
|
-
}
|
|
2327
|
-
hasViewFocus() {
|
|
2328
|
-
return !!this.view && this.view.hasFocus();
|
|
2329
|
-
}
|
|
2330
|
-
findClosest(resource) {
|
|
2331
|
-
return this.model.findClosest(resource);
|
|
2332
|
-
}
|
|
2333
|
-
findClosestRoot(resource) {
|
|
2334
|
-
const parentRoots = this.model.roots.filter(r => this.uriIdentityService.extUri.isEqualOrParent(resource, r.resource))
|
|
2335
|
-
.sort((first, second) => second.resource.path.length - first.resource.path.length);
|
|
2336
|
-
return parentRoots.length ? parentRoots[0] : null;
|
|
2337
|
-
}
|
|
2338
|
-
async setEditable(stat, data) {
|
|
2339
|
-
if (!this.view) {
|
|
2340
|
-
return;
|
|
2341
|
-
}
|
|
2342
|
-
if (!data) {
|
|
2343
|
-
this.editable = undefined;
|
|
2344
|
-
}
|
|
2345
|
-
else {
|
|
2346
|
-
this.editable = { stat, data };
|
|
2347
|
-
}
|
|
2348
|
-
const isEditing = this.isEditable(stat);
|
|
2349
|
-
await this.view.setEditable(stat, isEditing);
|
|
2350
|
-
if (!this.editable && this.fileChangeEvents.length && !this.onFileChangesScheduler.isScheduled()) {
|
|
2351
|
-
this.onFileChangesScheduler.schedule();
|
|
2352
|
-
}
|
|
2353
|
-
}
|
|
2354
|
-
async setToCopy(items, cut) {
|
|
2355
|
-
const previouslyCutItems = this.cutItems;
|
|
2356
|
-
this.cutItems = cut ? items : undefined;
|
|
2357
|
-
await this.clipboardService.writeResources(( (items.map(s => s.resource))));
|
|
2358
|
-
this.view?.itemsCopied(items, cut, previouslyCutItems);
|
|
2359
|
-
}
|
|
2360
|
-
isCut(item) {
|
|
2361
|
-
return !!this.cutItems && this.cutItems.some(i => this.uriIdentityService.extUri.isEqual(i.resource, item.resource));
|
|
2362
|
-
}
|
|
2363
|
-
getEditable() {
|
|
2364
|
-
return this.editable;
|
|
2365
|
-
}
|
|
2366
|
-
getEditableData(stat) {
|
|
2367
|
-
return this.editable && this.editable.stat === stat ? this.editable.data : undefined;
|
|
2368
|
-
}
|
|
2369
|
-
isEditable(stat) {
|
|
2370
|
-
return !!this.editable && (this.editable.stat === stat || !stat);
|
|
2371
|
-
}
|
|
2372
|
-
async select(resource, reveal) {
|
|
2373
|
-
if (!this.view) {
|
|
2374
|
-
return;
|
|
2375
|
-
}
|
|
2376
|
-
const ignoreRevealExcludes = reveal === 'force';
|
|
2377
|
-
const fileStat = this.findClosest(resource);
|
|
2378
|
-
if (fileStat) {
|
|
2379
|
-
if (!this.shouldAutoRevealItem(fileStat, ignoreRevealExcludes)) {
|
|
2380
|
-
return;
|
|
2381
|
-
}
|
|
2382
|
-
await this.view.selectResource(fileStat.resource, reveal);
|
|
2383
|
-
return Promise.resolve(undefined);
|
|
2384
|
-
}
|
|
2385
|
-
const options = { resolveTo: [resource], resolveMetadata: this.config.sortOrder === "modified" };
|
|
2386
|
-
const root = this.findClosestRoot(resource);
|
|
2387
|
-
if (!root) {
|
|
2388
|
-
return undefined;
|
|
2389
|
-
}
|
|
2390
|
-
try {
|
|
2391
|
-
const stat = await this.fileService.resolve(root.resource, options);
|
|
2392
|
-
const modelStat = ExplorerItem.create(this.fileService, this.configurationService, stat, undefined, options.resolveTo);
|
|
2393
|
-
ExplorerItem.mergeLocalWithDisk(modelStat, root);
|
|
2394
|
-
const item = root.find(resource);
|
|
2395
|
-
await this.view.refresh(true, root);
|
|
2396
|
-
if (item && !this.shouldAutoRevealItem(item, ignoreRevealExcludes)) {
|
|
2397
|
-
return;
|
|
2398
|
-
}
|
|
2399
|
-
await this.view.selectResource(item ? item.resource : undefined, reveal);
|
|
2400
|
-
}
|
|
2401
|
-
catch (error) {
|
|
2402
|
-
root.error = error;
|
|
2403
|
-
await this.view.refresh(false, root);
|
|
2404
|
-
}
|
|
2405
|
-
}
|
|
2406
|
-
async refresh(reveal = true) {
|
|
2407
|
-
this.model.roots.forEach(r => r.forgetChildren());
|
|
2408
|
-
if (this.view) {
|
|
2409
|
-
await this.view.refresh(true);
|
|
2410
|
-
const resource = this.editorService.activeEditor?.resource;
|
|
2411
|
-
const autoReveal = this.configurationService.getValue().explorer.autoReveal;
|
|
2412
|
-
if (reveal && resource && autoReveal) {
|
|
2413
|
-
this.select(resource, autoReveal);
|
|
2414
|
-
}
|
|
2415
|
-
}
|
|
2416
|
-
}
|
|
2417
|
-
async onDidRunOperation(e) {
|
|
2418
|
-
const shouldDeepRefresh = this.config.fileNesting.enabled;
|
|
2419
|
-
if (e.isOperation(0 ) || e.isOperation(3 )) {
|
|
2420
|
-
const addedElement = e.target;
|
|
2421
|
-
const parentResource = dirname(addedElement.resource);
|
|
2422
|
-
const parents = this.model.findAll(parentResource);
|
|
2423
|
-
if (parents.length) {
|
|
2424
|
-
await Promise.all(( (parents.map(async (p) => {
|
|
2425
|
-
const resolveMetadata = this.config.sortOrder === `modified`;
|
|
2426
|
-
if (!p.isDirectoryResolved) {
|
|
2427
|
-
const stat = await this.fileService.resolve(p.resource, { resolveMetadata });
|
|
2428
|
-
if (stat) {
|
|
2429
|
-
const modelStat = ExplorerItem.create(this.fileService, this.configurationService, stat, p.parent);
|
|
2430
|
-
ExplorerItem.mergeLocalWithDisk(modelStat, p);
|
|
2431
|
-
}
|
|
2432
|
-
}
|
|
2433
|
-
const childElement = ExplorerItem.create(this.fileService, this.configurationService, addedElement, p.parent);
|
|
2434
|
-
p.removeChild(childElement);
|
|
2435
|
-
p.addChild(childElement);
|
|
2436
|
-
await this.view?.refresh(shouldDeepRefresh, p);
|
|
2437
|
-
}))));
|
|
2438
|
-
}
|
|
2439
|
-
}
|
|
2440
|
-
else if (e.isOperation(2 )) {
|
|
2441
|
-
const oldResource = e.resource;
|
|
2442
|
-
const newElement = e.target;
|
|
2443
|
-
const oldParentResource = dirname(oldResource);
|
|
2444
|
-
const newParentResource = dirname(newElement.resource);
|
|
2445
|
-
const modelElements = this.model.findAll(oldResource);
|
|
2446
|
-
const sameParentMove = modelElements.every(e => !e.nestedParent) && this.uriIdentityService.extUri.isEqual(oldParentResource, newParentResource);
|
|
2447
|
-
if (sameParentMove) {
|
|
2448
|
-
await Promise.all(( (modelElements.map(async (modelElement) => {
|
|
2449
|
-
modelElement.rename(newElement);
|
|
2450
|
-
await this.view?.refresh(shouldDeepRefresh, modelElement.parent);
|
|
2451
|
-
}))));
|
|
2452
|
-
}
|
|
2453
|
-
else {
|
|
2454
|
-
const newParents = this.model.findAll(newParentResource);
|
|
2455
|
-
if (newParents.length && modelElements.length) {
|
|
2456
|
-
await Promise.all(( (modelElements.map(async (modelElement, index) => {
|
|
2457
|
-
const oldParent = modelElement.parent;
|
|
2458
|
-
const oldNestedParent = modelElement.nestedParent;
|
|
2459
|
-
modelElement.move(newParents[index]);
|
|
2460
|
-
if (oldNestedParent) {
|
|
2461
|
-
await this.view?.refresh(false, oldNestedParent);
|
|
2462
|
-
}
|
|
2463
|
-
await this.view?.refresh(false, oldParent);
|
|
2464
|
-
await this.view?.refresh(shouldDeepRefresh, newParents[index]);
|
|
2465
|
-
}))));
|
|
2466
|
-
}
|
|
2467
|
-
}
|
|
2468
|
-
}
|
|
2469
|
-
else if (e.isOperation(1 )) {
|
|
2470
|
-
const modelElements = this.model.findAll(e.resource);
|
|
2471
|
-
await Promise.all(( (modelElements.map(async (modelElement) => {
|
|
2472
|
-
if (modelElement.parent) {
|
|
2473
|
-
const parent = modelElement.parent;
|
|
2474
|
-
parent.removeChild(modelElement);
|
|
2475
|
-
const oldNestedParent = modelElement.nestedParent;
|
|
2476
|
-
if (oldNestedParent) {
|
|
2477
|
-
oldNestedParent.removeChild(modelElement);
|
|
2478
|
-
await this.view?.refresh(false, oldNestedParent);
|
|
2479
|
-
}
|
|
2480
|
-
await this.view?.refresh(shouldDeepRefresh, parent);
|
|
2481
|
-
}
|
|
2482
|
-
}))));
|
|
2483
|
-
}
|
|
2484
|
-
}
|
|
2485
|
-
shouldAutoRevealItem(item, ignore) {
|
|
2486
|
-
if (item === undefined || ignore) {
|
|
2487
|
-
return true;
|
|
2488
|
-
}
|
|
2489
|
-
if (this.revealExcludeMatcher.matches(item.resource, name => !!(item.parent && item.parent.getChild(name)))) {
|
|
2490
|
-
return false;
|
|
2491
|
-
}
|
|
2492
|
-
const root = item.root;
|
|
2493
|
-
let currentItem = item.parent;
|
|
2494
|
-
while (currentItem !== root) {
|
|
2495
|
-
if (currentItem === undefined) {
|
|
2496
|
-
return true;
|
|
2497
|
-
}
|
|
2498
|
-
if (this.revealExcludeMatcher.matches(currentItem.resource)) {
|
|
2499
|
-
return false;
|
|
2500
|
-
}
|
|
2501
|
-
currentItem = currentItem.parent;
|
|
2502
|
-
}
|
|
2503
|
-
return true;
|
|
2504
|
-
}
|
|
2505
|
-
async onConfigurationUpdated(event) {
|
|
2506
|
-
if (!event.affectsConfiguration('explorer')) {
|
|
2507
|
-
return;
|
|
2508
|
-
}
|
|
2509
|
-
let shouldRefresh = false;
|
|
2510
|
-
if (event.affectsConfiguration('explorer.fileNesting')) {
|
|
2511
|
-
shouldRefresh = true;
|
|
2512
|
-
}
|
|
2513
|
-
const configuration = this.configurationService.getValue();
|
|
2514
|
-
const configSortOrder = configuration?.explorer?.sortOrder || "default" ;
|
|
2515
|
-
if (this.config.sortOrder !== configSortOrder) {
|
|
2516
|
-
shouldRefresh = this.config.sortOrder !== undefined;
|
|
2517
|
-
}
|
|
2518
|
-
const configLexicographicOptions = configuration?.explorer?.sortOrderLexicographicOptions || "default" ;
|
|
2519
|
-
if (this.config.sortOrderLexicographicOptions !== configLexicographicOptions) {
|
|
2520
|
-
shouldRefresh = shouldRefresh || this.config.sortOrderLexicographicOptions !== undefined;
|
|
2521
|
-
}
|
|
2522
|
-
this.config = configuration.explorer;
|
|
2523
|
-
if (shouldRefresh) {
|
|
2524
|
-
await this.refresh();
|
|
2525
|
-
}
|
|
2526
|
-
}
|
|
2527
|
-
dispose() {
|
|
2528
|
-
this.disposables.dispose();
|
|
2529
|
-
}
|
|
2530
|
-
};
|
|
2531
|
-
ExplorerService.EXPLORER_FILE_CHANGES_REACT_DELAY = 500;
|
|
2532
|
-
ExplorerService = ( (__decorate([
|
|
2533
|
-
( (__param(0, IFileService))),
|
|
2534
|
-
( (__param(1, IConfigurationService))),
|
|
2535
|
-
( (__param(2, IWorkspaceContextService))),
|
|
2536
|
-
( (__param(3, IClipboardService))),
|
|
2537
|
-
( (__param(4, IEditorService))),
|
|
2538
|
-
( (__param(5, IUriIdentityService))),
|
|
2539
|
-
( (__param(6, IBulkEditService))),
|
|
2540
|
-
( (__param(7, IProgressService))),
|
|
2541
|
-
( (__param(8, IHostService)))
|
|
2542
|
-
], ExplorerService)));
|
|
2543
|
-
function doesFileEventAffect(item, view, events, types) {
|
|
2544
|
-
for (const [_name, child] of item.children) {
|
|
2545
|
-
if (view.isItemVisible(child)) {
|
|
2546
|
-
if (events.some(e => e.contains(child.resource, ...types))) {
|
|
2547
|
-
return true;
|
|
2548
|
-
}
|
|
2549
|
-
if (child.isDirectory && child.isDirectoryResolved) {
|
|
2550
|
-
if (doesFileEventAffect(child, view, events, types)) {
|
|
2551
|
-
return true;
|
|
2552
|
-
}
|
|
2553
|
-
}
|
|
2554
|
-
}
|
|
2555
|
-
}
|
|
2556
|
-
return false;
|
|
2557
|
-
}
|
|
2558
|
-
function getRevealExcludes(configuration) {
|
|
2559
|
-
const revealExcludes = configuration && configuration.explorer && configuration.explorer.autoRevealExclude;
|
|
2560
|
-
if (!revealExcludes) {
|
|
2561
|
-
return {};
|
|
2562
|
-
}
|
|
2563
|
-
return revealExcludes;
|
|
2564
|
-
}
|
|
2565
|
-
( (Registry.as(EditorExtensions.EditorFactory))).registerFileEditorFactory({
|
|
2566
|
-
typeId: FILE_EDITOR_INPUT_ID,
|
|
2567
|
-
createFileEditor: (resource, preferredResource, preferredName, preferredDescription, preferredEncoding, preferredLanguageId, preferredContents, instantiationService) => {
|
|
2568
|
-
return instantiationService.createInstance(FileEditorInput, resource, preferredResource, preferredName, preferredDescription, preferredEncoding, preferredLanguageId, preferredContents);
|
|
2569
|
-
},
|
|
2570
|
-
isFileEditor: (obj) => {
|
|
2571
|
-
return obj instanceof FileEditorInput;
|
|
2572
|
-
}
|
|
2573
|
-
});
|
|
2574
|
-
const configurationRegistry = ( (Registry.as(Extensions.Configuration)));
|
|
2575
|
-
const hotExitConfiguration = isNative ?
|
|
2576
|
-
{
|
|
2577
|
-
'type': 'string',
|
|
2578
|
-
'scope': 1 ,
|
|
2579
|
-
'enum': [HotExitConfiguration.OFF, HotExitConfiguration.ON_EXIT, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE],
|
|
2580
|
-
'default': HotExitConfiguration.ON_EXIT,
|
|
2581
|
-
'markdownEnumDescriptions': [
|
|
2582
|
-
( (localize(
|
|
2583
|
-
'hotExit.off',
|
|
2584
|
-
'Disable hot exit. A prompt will show when attempting to close a window with editors that have unsaved changes.'
|
|
2585
|
-
))),
|
|
2586
|
-
( (localize(
|
|
2587
|
-
'hotExit.onExit',
|
|
2588
|
-
'Hot exit will be triggered when the last window is closed on Windows/Linux or when the `workbench.action.quit` command is triggered (command palette, keybinding, menu). All windows without folders opened will be restored upon next launch. A list of previously opened windows with unsaved files can be accessed via `File > Open Recent > More...`'
|
|
2589
|
-
))),
|
|
2590
|
-
( (localize(
|
|
2591
|
-
'hotExit.onExitAndWindowClose',
|
|
2592
|
-
'Hot exit will be triggered when the last window is closed on Windows/Linux or when the `workbench.action.quit` command is triggered (command palette, keybinding, menu), and also for any window with a folder opened regardless of whether it\'s the last window. All windows without folders opened will be restored upon next launch. A list of previously opened windows with unsaved files can be accessed via `File > Open Recent > More...`'
|
|
2593
|
-
)))
|
|
2594
|
-
],
|
|
2595
|
-
'description': ( (localize(
|
|
2596
|
-
'hotExit',
|
|
2597
|
-
"Controls whether unsaved files are remembered between sessions, allowing the save prompt when exiting the editor to be skipped.",
|
|
2598
|
-
HotExitConfiguration.ON_EXIT,
|
|
2599
|
-
HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE
|
|
2600
|
-
)))
|
|
2601
|
-
} : {
|
|
2602
|
-
'type': 'string',
|
|
2603
|
-
'scope': 1 ,
|
|
2604
|
-
'enum': [HotExitConfiguration.OFF, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE],
|
|
2605
|
-
'default': HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE,
|
|
2606
|
-
'markdownEnumDescriptions': [
|
|
2607
|
-
( (localize(
|
|
2608
|
-
'hotExit.off',
|
|
2609
|
-
'Disable hot exit. A prompt will show when attempting to close a window with editors that have unsaved changes.'
|
|
2610
|
-
))),
|
|
2611
|
-
( (localize(
|
|
2612
|
-
'hotExit.onExitAndWindowCloseBrowser',
|
|
2613
|
-
'Hot exit will be triggered when the browser quits or the window or tab is closed.'
|
|
2614
|
-
)))
|
|
2615
|
-
],
|
|
2616
|
-
'description': ( (localize(
|
|
2617
|
-
'hotExit',
|
|
2618
|
-
"Controls whether unsaved files are remembered between sessions, allowing the save prompt when exiting the editor to be skipped.",
|
|
2619
|
-
HotExitConfiguration.ON_EXIT,
|
|
2620
|
-
HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE
|
|
2621
|
-
)))
|
|
2622
|
-
};
|
|
2623
|
-
configurationRegistry.registerConfiguration({
|
|
2624
|
-
'id': 'files',
|
|
2625
|
-
'order': 9,
|
|
2626
|
-
'title': ( (localize('filesConfigurationTitle', "Files"))),
|
|
2627
|
-
'type': 'object',
|
|
2628
|
-
'properties': {
|
|
2629
|
-
[FILES_EXCLUDE_CONFIG]: {
|
|
2630
|
-
'type': 'object',
|
|
2631
|
-
'markdownDescription': ( (localize(
|
|
2632
|
-
'exclude',
|
|
2633
|
-
"Configure [glob patterns](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options) for excluding files and folders. For example, the File Explorer decides which files and folders to show or hide based on this setting. Refer to the `#search.exclude#` setting to define search-specific excludes. Refer to the `#explorer.excludeGitIgnore#` setting for ignoring files based on your `.gitignore`."
|
|
2634
|
-
))),
|
|
2635
|
-
'default': {
|
|
2636
|
-
...{ '**/.git': true, '**/.svn': true, '**/.hg': true, '**/CVS': true, '**/.DS_Store': true, '**/Thumbs.db': true },
|
|
2637
|
-
...(isWeb ? { '**/*.crswap': true } : undefined)
|
|
2638
|
-
},
|
|
2639
|
-
'scope': 4 ,
|
|
2640
|
-
'additionalProperties': {
|
|
2641
|
-
'anyOf': [
|
|
2642
|
-
{
|
|
2643
|
-
'type': 'boolean',
|
|
2644
|
-
'enum': [true, false],
|
|
2645
|
-
'enumDescriptions': [( (localize('trueDescription', "Enable the pattern."))), ( (localize('falseDescription', "Disable the pattern.")))],
|
|
2646
|
-
'description': ( (localize(
|
|
2647
|
-
'files.exclude.boolean',
|
|
2648
|
-
"The glob pattern to match file paths against. Set to true or false to enable or disable the pattern."
|
|
2649
|
-
))),
|
|
2650
|
-
},
|
|
2651
|
-
{
|
|
2652
|
-
'type': 'object',
|
|
2653
|
-
'properties': {
|
|
2654
|
-
'when': {
|
|
2655
|
-
'type': 'string',
|
|
2656
|
-
'pattern': '\\w*\\$\\(basename\\)\\w*',
|
|
2657
|
-
'default': '$(basename).ext',
|
|
2658
|
-
'markdownDescription': ( (localize(
|
|
2659
|
-
{ key: 'files.exclude.when', comment: ['\\$(basename) should not be translated'] },
|
|
2660
|
-
"Additional check on the siblings of a matching file. Use \\$(basename) as variable for the matching file name."
|
|
2661
|
-
)))
|
|
2662
|
-
}
|
|
2663
|
-
}
|
|
2664
|
-
}
|
|
2665
|
-
]
|
|
2666
|
-
}
|
|
2667
|
-
},
|
|
2668
|
-
[FILES_ASSOCIATIONS_CONFIG]: {
|
|
2669
|
-
'type': 'object',
|
|
2670
|
-
'markdownDescription': ( (localize(
|
|
2671
|
-
'associations',
|
|
2672
|
-
"Configure file associations to languages (for example `\"*.extension\": \"html\"`). These have precedence over the default associations of the languages installed."
|
|
2673
|
-
))),
|
|
2674
|
-
'additionalProperties': {
|
|
2675
|
-
'type': 'string'
|
|
2676
|
-
}
|
|
2677
|
-
},
|
|
2678
|
-
'files.encoding': {
|
|
2679
|
-
'type': 'string',
|
|
2680
|
-
'enum': ( (Object.keys(SUPPORTED_ENCODINGS))),
|
|
2681
|
-
'default': 'utf8',
|
|
2682
|
-
'description': ( (localize(
|
|
2683
|
-
'encoding',
|
|
2684
|
-
"The default character set encoding to use when reading and writing files. This setting can also be configured per language."
|
|
2685
|
-
))),
|
|
2686
|
-
'scope': 5 ,
|
|
2687
|
-
'enumDescriptions': ( (( (Object.keys(SUPPORTED_ENCODINGS))).map(key => SUPPORTED_ENCODINGS[key].labelLong))),
|
|
2688
|
-
'enumItemLabels': ( (( (Object.keys(SUPPORTED_ENCODINGS))).map(key => SUPPORTED_ENCODINGS[key].labelLong)))
|
|
2689
|
-
},
|
|
2690
|
-
'files.autoGuessEncoding': {
|
|
2691
|
-
'type': 'boolean',
|
|
2692
|
-
'default': false,
|
|
2693
|
-
'markdownDescription': ( (localize(
|
|
2694
|
-
'autoGuessEncoding',
|
|
2695
|
-
"When enabled, the editor will attempt to guess the character set encoding when opening files. This setting can also be configured per language. Note, this setting is not respected by text search. Only {0} is respected.",
|
|
2696
|
-
'`#files.encoding#`'
|
|
2697
|
-
))),
|
|
2698
|
-
'scope': 5
|
|
2699
|
-
},
|
|
2700
|
-
'files.eol': {
|
|
2701
|
-
'type': 'string',
|
|
2702
|
-
'enum': [
|
|
2703
|
-
'\n',
|
|
2704
|
-
'\r\n',
|
|
2705
|
-
'auto'
|
|
2706
|
-
],
|
|
2707
|
-
'enumDescriptions': [
|
|
2708
|
-
( (localize('eol.LF', "LF"))),
|
|
2709
|
-
( (localize('eol.CRLF', "CRLF"))),
|
|
2710
|
-
( (localize('eol.auto', "Uses operating system specific end of line character.")))
|
|
2711
|
-
],
|
|
2712
|
-
'default': 'auto',
|
|
2713
|
-
'description': ( (localize('eol', "The default end of line character."))),
|
|
2714
|
-
'scope': 5
|
|
2715
|
-
},
|
|
2716
|
-
'files.enableTrash': {
|
|
2717
|
-
'type': 'boolean',
|
|
2718
|
-
'default': true,
|
|
2719
|
-
'description': ( (localize(
|
|
2720
|
-
'useTrash',
|
|
2721
|
-
"Moves files/folders to the OS trash (recycle bin on Windows) when deleting. Disabling this will delete files/folders permanently."
|
|
2722
|
-
)))
|
|
2723
|
-
},
|
|
2724
|
-
'files.trimTrailingWhitespace': {
|
|
2725
|
-
'type': 'boolean',
|
|
2726
|
-
'default': false,
|
|
2727
|
-
'description': ( (localize(
|
|
2728
|
-
'trimTrailingWhitespace',
|
|
2729
|
-
"When enabled, will trim trailing whitespace when saving a file."
|
|
2730
|
-
))),
|
|
2731
|
-
'scope': 5
|
|
2732
|
-
},
|
|
2733
|
-
'files.insertFinalNewline': {
|
|
2734
|
-
'type': 'boolean',
|
|
2735
|
-
'default': false,
|
|
2736
|
-
'description': ( (localize(
|
|
2737
|
-
'insertFinalNewline',
|
|
2738
|
-
"When enabled, insert a final new line at the end of the file when saving it."
|
|
2739
|
-
))),
|
|
2740
|
-
'scope': 5
|
|
2741
|
-
},
|
|
2742
|
-
'files.trimFinalNewlines': {
|
|
2743
|
-
'type': 'boolean',
|
|
2744
|
-
'default': false,
|
|
2745
|
-
'description': ( (localize(
|
|
2746
|
-
'trimFinalNewlines',
|
|
2747
|
-
"When enabled, will trim all new lines after the final new line at the end of the file when saving it."
|
|
2748
|
-
))),
|
|
2749
|
-
scope: 5 ,
|
|
2750
|
-
},
|
|
2751
|
-
'files.autoSave': {
|
|
2752
|
-
'type': 'string',
|
|
2753
|
-
'enum': [AutoSaveConfiguration.OFF, AutoSaveConfiguration.AFTER_DELAY, AutoSaveConfiguration.ON_FOCUS_CHANGE, AutoSaveConfiguration.ON_WINDOW_CHANGE],
|
|
2754
|
-
'markdownEnumDescriptions': [
|
|
2755
|
-
( (localize(
|
|
2756
|
-
{ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'files.autoSave.off' },
|
|
2757
|
-
"An editor with changes is never automatically saved."
|
|
2758
|
-
))),
|
|
2759
|
-
( (localize(
|
|
2760
|
-
{ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'files.autoSave.afterDelay' },
|
|
2761
|
-
"An editor with changes is automatically saved after the configured `#files.autoSaveDelay#`."
|
|
2762
|
-
))),
|
|
2763
|
-
( (localize(
|
|
2764
|
-
{ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'files.autoSave.onFocusChange' },
|
|
2765
|
-
"An editor with changes is automatically saved when the editor loses focus."
|
|
2766
|
-
))),
|
|
2767
|
-
( (localize(
|
|
2768
|
-
{ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'files.autoSave.onWindowChange' },
|
|
2769
|
-
"An editor with changes is automatically saved when the window loses focus."
|
|
2770
|
-
)))
|
|
2771
|
-
],
|
|
2772
|
-
'default': isWeb ? AutoSaveConfiguration.AFTER_DELAY : AutoSaveConfiguration.OFF,
|
|
2773
|
-
'markdownDescription': ( (localize(
|
|
2774
|
-
{ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'autoSave' },
|
|
2775
|
-
"Controls [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors that have unsaved changes.",
|
|
2776
|
-
AutoSaveConfiguration.OFF,
|
|
2777
|
-
AutoSaveConfiguration.AFTER_DELAY,
|
|
2778
|
-
AutoSaveConfiguration.ON_FOCUS_CHANGE,
|
|
2779
|
-
AutoSaveConfiguration.ON_WINDOW_CHANGE,
|
|
2780
|
-
AutoSaveConfiguration.AFTER_DELAY
|
|
2781
|
-
)))
|
|
2782
|
-
},
|
|
2783
|
-
'files.autoSaveDelay': {
|
|
2784
|
-
'type': 'number',
|
|
2785
|
-
'default': 1000,
|
|
2786
|
-
'minimum': 0,
|
|
2787
|
-
'markdownDescription': ( (localize(
|
|
2788
|
-
{ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'autoSaveDelay' },
|
|
2789
|
-
"Controls the delay in milliseconds after which an editor with unsaved changes is saved automatically. Only applies when `#files.autoSave#` is set to `{0}`.",
|
|
2790
|
-
AutoSaveConfiguration.AFTER_DELAY
|
|
2791
|
-
)))
|
|
2792
|
-
},
|
|
2793
|
-
'files.watcherExclude': {
|
|
2794
|
-
'type': 'object',
|
|
2795
|
-
'default': { '**/.git/objects/**': true, '**/.git/subtree-cache/**': true, '**/node_modules/*/**': true, '**/.hg/store/**': true },
|
|
2796
|
-
'markdownDescription': ( (localize(
|
|
2797
|
-
'watcherExclude',
|
|
2798
|
-
"Configure paths or glob patterns to exclude from file watching. Paths can either be relative to the watched folder or absolute. Glob patterns are matched relative from the watched folder. When you experience the file watcher process consuming a lot of CPU, make sure to exclude large folders that are of less interest (such as build output folders)."
|
|
2799
|
-
))),
|
|
2800
|
-
'scope': 4
|
|
2801
|
-
},
|
|
2802
|
-
'files.watcherInclude': {
|
|
2803
|
-
'type': 'array',
|
|
2804
|
-
'items': {
|
|
2805
|
-
'type': 'string'
|
|
2806
|
-
},
|
|
2807
|
-
'default': [],
|
|
2808
|
-
'description': ( (localize(
|
|
2809
|
-
'watcherInclude',
|
|
2810
|
-
"Configure extra paths to watch for changes inside the workspace. By default, all workspace folders will be watched recursively, except for folders that are symbolic links. You can explicitly add absolute or relative paths to support watching folders that are symbolic links. Relative paths will be resolved to an absolute path using the currently opened workspace."
|
|
2811
|
-
))),
|
|
2812
|
-
'scope': 4
|
|
2813
|
-
},
|
|
2814
|
-
'files.hotExit': hotExitConfiguration,
|
|
2815
|
-
'files.defaultLanguage': {
|
|
2816
|
-
'type': 'string',
|
|
2817
|
-
'markdownDescription': ( (localize(
|
|
2818
|
-
'defaultLanguage',
|
|
2819
|
-
"The default language identifier that is assigned to new files. If configured to `${activeEditorLanguage}`, will use the language identifier of the currently active text editor if any."
|
|
2820
|
-
)))
|
|
2821
|
-
},
|
|
2822
|
-
'files.maxMemoryForLargeFilesMB': {
|
|
2823
|
-
'type': 'number',
|
|
2824
|
-
'default': 4096,
|
|
2825
|
-
'minimum': 0,
|
|
2826
|
-
'markdownDescription': ( (localize(
|
|
2827
|
-
'maxMemoryForLargeFilesMB',
|
|
2828
|
-
"Controls the memory available to VS Code after restart when trying to open large files. Same effect as specifying `--max-memory=NEWSIZE` on the command line."
|
|
2829
|
-
))),
|
|
2830
|
-
included: isNative
|
|
2831
|
-
},
|
|
2832
|
-
'files.restoreUndoStack': {
|
|
2833
|
-
'type': 'boolean',
|
|
2834
|
-
'description': ( (localize(
|
|
2835
|
-
'files.restoreUndoStack',
|
|
2836
|
-
"Restore the undo stack when a file is reopened."
|
|
2837
|
-
))),
|
|
2838
|
-
'default': true
|
|
2839
|
-
},
|
|
2840
|
-
'files.saveConflictResolution': {
|
|
2841
|
-
'type': 'string',
|
|
2842
|
-
'enum': [
|
|
2843
|
-
'askUser',
|
|
2844
|
-
'overwriteFileOnDisk'
|
|
2845
|
-
],
|
|
2846
|
-
'enumDescriptions': [
|
|
2847
|
-
( (localize(
|
|
2848
|
-
'askUser',
|
|
2849
|
-
"Will refuse to save and ask for resolving the save conflict manually."
|
|
2850
|
-
))),
|
|
2851
|
-
( (localize(
|
|
2852
|
-
'overwriteFileOnDisk',
|
|
2853
|
-
"Will resolve the save conflict by overwriting the file on disk with the changes in the editor."
|
|
2854
|
-
)))
|
|
2855
|
-
],
|
|
2856
|
-
'description': ( (localize(
|
|
2857
|
-
'files.saveConflictResolution',
|
|
2858
|
-
"A save conflict can occur when a file is saved to disk that was changed by another program in the meantime. To prevent data loss, the user is asked to compare the changes in the editor with the version on disk. This setting should only be changed if you frequently encounter save conflict errors and may result in data loss if used without caution."
|
|
2859
|
-
))),
|
|
2860
|
-
'default': 'askUser',
|
|
2861
|
-
'scope': 5
|
|
2862
|
-
},
|
|
2863
|
-
'files.simpleDialog.enable': {
|
|
2864
|
-
'type': 'boolean',
|
|
2865
|
-
'description': ( (localize(
|
|
2866
|
-
'files.simpleDialog.enable',
|
|
2867
|
-
"Enables the simple file dialog. The simple file dialog replaces the system file dialog when enabled."
|
|
2868
|
-
))),
|
|
2869
|
-
'default': false
|
|
2870
|
-
},
|
|
2871
|
-
'files.participants.timeout': {
|
|
2872
|
-
type: 'number',
|
|
2873
|
-
default: 60000,
|
|
2874
|
-
markdownDescription: ( (localize(
|
|
2875
|
-
'files.participants.timeout',
|
|
2876
|
-
"Timeout in milliseconds after which file participants for create, rename, and delete are cancelled. Use `0` to disable participants."
|
|
2877
|
-
))),
|
|
2878
|
-
}
|
|
2879
|
-
}
|
|
2880
|
-
});
|
|
2881
|
-
configurationRegistry.registerConfiguration({
|
|
2882
|
-
...editorConfigurationBaseNode,
|
|
2883
|
-
properties: {
|
|
2884
|
-
'editor.formatOnSave': {
|
|
2885
|
-
'type': 'boolean',
|
|
2886
|
-
'description': ( (localize(
|
|
2887
|
-
'formatOnSave',
|
|
2888
|
-
"Format a file on save. A formatter must be available, the file must not be saved after delay, and the editor must not be shutting down."
|
|
2889
|
-
))),
|
|
2890
|
-
'scope': 5 ,
|
|
2891
|
-
},
|
|
2892
|
-
'editor.formatOnSaveMode': {
|
|
2893
|
-
'type': 'string',
|
|
2894
|
-
'default': 'file',
|
|
2895
|
-
'enum': [
|
|
2896
|
-
'file',
|
|
2897
|
-
'modifications',
|
|
2898
|
-
'modificationsIfAvailable'
|
|
2899
|
-
],
|
|
2900
|
-
'enumDescriptions': [
|
|
2901
|
-
( (localize(
|
|
2902
|
-
{ key: 'everything', comment: ['This is the description of an option'] },
|
|
2903
|
-
"Format the whole file."
|
|
2904
|
-
))),
|
|
2905
|
-
( (localize(
|
|
2906
|
-
{ key: 'modification', comment: ['This is the description of an option'] },
|
|
2907
|
-
"Format modifications (requires source control)."
|
|
2908
|
-
))),
|
|
2909
|
-
( (localize(
|
|
2910
|
-
{ key: 'modificationIfAvailable', comment: ['This is the description of an option'] },
|
|
2911
|
-
"Will attempt to format modifications only (requires source control). If source control can't be used, then the whole file will be formatted."
|
|
2912
|
-
))),
|
|
2913
|
-
],
|
|
2914
|
-
'markdownDescription': ( (localize(
|
|
2915
|
-
'formatOnSaveMode',
|
|
2916
|
-
"Controls if format on save formats the whole file or only modifications. Only applies when `#editor.formatOnSave#` is enabled."
|
|
2917
|
-
))),
|
|
2918
|
-
'scope': 5 ,
|
|
2919
|
-
},
|
|
2920
|
-
}
|
|
2921
|
-
});
|
|
2922
|
-
RedoCommand.addImplementation(110, 'explorer', (accessor) => {
|
|
2923
|
-
const undoRedoService = accessor.get(IUndoRedoService);
|
|
2924
|
-
const explorerService = accessor.get(IExplorerService);
|
|
2925
|
-
const configurationService = accessor.get(IConfigurationService);
|
|
2926
|
-
const explorerCanUndo = configurationService.getValue().explorer.enableUndo;
|
|
2927
|
-
if (explorerService.hasViewFocus() && undoRedoService.canRedo(UNDO_REDO_SOURCE) && explorerCanUndo) {
|
|
2928
|
-
undoRedoService.redo(UNDO_REDO_SOURCE);
|
|
2929
|
-
return true;
|
|
2930
|
-
}
|
|
2931
|
-
return false;
|
|
2932
|
-
});
|
|
2933
|
-
ModesRegistry.registerLanguage({
|
|
2934
|
-
id: BINARY_TEXT_FILE_MODE,
|
|
2935
|
-
aliases: ['Binary'],
|
|
2936
|
-
mimetypes: ['text/x-code-binary']
|
|
2937
|
-
});
|
|
2938
|
-
class File {
|
|
2939
|
-
constructor(getContent) {
|
|
2940
|
-
this.getContent = getContent;
|
|
2941
|
-
this.ctime = Date.now();
|
|
2942
|
-
this.mtime = Date.now();
|
|
2943
|
-
this.size = 0;
|
|
2944
|
-
this.type = FileType.File;
|
|
2945
|
-
}
|
|
2946
|
-
}
|
|
2947
|
-
const encoder = new TextEncoder();
|
|
2948
|
-
const decoder = new TextDecoder();
|
|
2949
|
-
class SimpleTextFileSystemProvider {
|
|
2950
|
-
constructor() {
|
|
2951
|
-
this.onDidChangeCapabilities = Event.None;
|
|
2952
|
-
this.capabilities = 2 | 1024 ;
|
|
2953
|
-
this.onDidChangeFile = Event.None;
|
|
2954
|
-
this.onDidWatchError = Event.None;
|
|
2955
|
-
}
|
|
2956
|
-
async readFile(resource) {
|
|
2957
|
-
try {
|
|
2958
|
-
const content = await this.getFileContent(resource);
|
|
2959
|
-
if (content != null) {
|
|
2960
|
-
return encoder.encode(content);
|
|
2961
|
-
}
|
|
2962
|
-
}
|
|
2963
|
-
catch (err) {
|
|
2964
|
-
throw createFileSystemProviderError(err, FileSystemProviderErrorCode.Unknown);
|
|
2965
|
-
}
|
|
2966
|
-
throw createFileSystemProviderError('file not found', FileSystemProviderErrorCode.FileNotFound);
|
|
2967
|
-
}
|
|
2968
|
-
async writeFile(resource, content, opts) {
|
|
2969
|
-
try {
|
|
2970
|
-
await this.setFileContent(resource, decoder.decode(content), opts);
|
|
2971
|
-
}
|
|
2972
|
-
catch (err) {
|
|
2973
|
-
throw createFileSystemProviderError(err, FileSystemProviderErrorCode.Unknown);
|
|
2974
|
-
}
|
|
2975
|
-
}
|
|
2976
|
-
watch() {
|
|
2977
|
-
return Disposable.None;
|
|
2978
|
-
}
|
|
2979
|
-
async stat(resource) {
|
|
2980
|
-
try {
|
|
2981
|
-
const content = await this.getFileContent(resource);
|
|
2982
|
-
if (content != null) {
|
|
2983
|
-
return {
|
|
2984
|
-
type: FileType.File,
|
|
2985
|
-
size: encoder.encode(content).length,
|
|
2986
|
-
ctime: Date.now(),
|
|
2987
|
-
mtime: Date.now()
|
|
2988
|
-
};
|
|
2989
|
-
}
|
|
2990
|
-
}
|
|
2991
|
-
catch (err) {
|
|
2992
|
-
throw createFileSystemProviderError(err, FileSystemProviderErrorCode.Unknown);
|
|
2993
|
-
}
|
|
2994
|
-
throw createFileSystemProviderError('file not found', FileSystemProviderErrorCode.FileNotFound);
|
|
2995
|
-
}
|
|
2996
|
-
async mkdir() {
|
|
2997
|
-
}
|
|
2998
|
-
readdir() {
|
|
2999
|
-
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
3000
|
-
}
|
|
3001
|
-
delete() {
|
|
3002
|
-
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
3003
|
-
}
|
|
3004
|
-
rename() {
|
|
3005
|
-
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
3006
|
-
}
|
|
3007
|
-
}
|
|
3008
|
-
class ExtensionFileSystemProviderWithFileReadWriteCapability {
|
|
3009
|
-
constructor() {
|
|
3010
|
-
this.capabilities = 2 | 1024 | 2048 ;
|
|
3011
|
-
this.onDidChangeFile = Event.None;
|
|
3012
|
-
this.onDidChangeCapabilities = Event.None;
|
|
3013
|
-
this.files = new Map();
|
|
3014
|
-
}
|
|
3015
|
-
async stat(resource) {
|
|
3016
|
-
const file = this.files.get(( resource.toString()));
|
|
3017
|
-
if (file != null) {
|
|
3018
|
-
return file;
|
|
3019
|
-
}
|
|
3020
|
-
throw FileSystemProviderError.create('file not found', FileSystemProviderErrorCode.FileNotFound);
|
|
3021
|
-
}
|
|
3022
|
-
async readFile(resource) {
|
|
3023
|
-
const file = this.files.get(( resource.toString()));
|
|
3024
|
-
if (file != null) {
|
|
3025
|
-
return encoder.encode(await file.getContent());
|
|
3026
|
-
}
|
|
3027
|
-
throw FileSystemProviderError.create('file not found', FileSystemProviderErrorCode.FileNotFound);
|
|
3028
|
-
}
|
|
3029
|
-
watch() {
|
|
3030
|
-
return Disposable.None;
|
|
3031
|
-
}
|
|
3032
|
-
registerFile(resource, getContent) {
|
|
3033
|
-
this.files.set(( resource.toString()), new File(getContent));
|
|
3034
|
-
return {
|
|
3035
|
-
dispose: () => {
|
|
3036
|
-
this.files.delete(( resource.toString()));
|
|
3037
|
-
}
|
|
3038
|
-
};
|
|
3039
|
-
}
|
|
3040
|
-
async writeFile() {
|
|
3041
|
-
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
3042
|
-
}
|
|
3043
|
-
async mkdir() {
|
|
3044
|
-
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
3045
|
-
}
|
|
3046
|
-
readdir() {
|
|
3047
|
-
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
3048
|
-
}
|
|
3049
|
-
async delete() {
|
|
3050
|
-
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
3051
|
-
}
|
|
3052
|
-
async rename() {
|
|
3053
|
-
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
3054
|
-
}
|
|
3055
|
-
}
|
|
3056
|
-
const extensionFileSystemProvider = new ExtensionFileSystemProviderWithFileReadWriteCapability();
|
|
3057
|
-
class OverlayFileSystemProvider {
|
|
3058
|
-
constructor(_default) {
|
|
3059
|
-
this._default = _default;
|
|
3060
|
-
this.others = [];
|
|
3061
|
-
this.onDidChangeCapabilities = Event.any(...( this.delegates.map(delegate => delegate.onDidChangeCapabilities)));
|
|
3062
|
-
this._onDidChangeFile = new Emitter();
|
|
3063
|
-
this.onDidChangeFile = Event.any(this._default.onDidChangeFile, this._onDidChangeFile.event);
|
|
3064
|
-
this.capabilities = 2 | 1024 ;
|
|
3065
|
-
_default.onDidChangeFile((e) => {
|
|
3066
|
-
this._onDidChangeFile.fire(e);
|
|
3067
|
-
});
|
|
3068
|
-
}
|
|
3069
|
-
register(delegate) {
|
|
3070
|
-
this.others.push(delegate);
|
|
3071
|
-
const disposableStore = new DisposableStore();
|
|
3072
|
-
disposableStore.add(delegate.onDidChangeFile(e => {
|
|
3073
|
-
this._onDidChangeFile.fire(e);
|
|
3074
|
-
}));
|
|
3075
|
-
disposableStore.add({
|
|
3076
|
-
dispose: () => {
|
|
3077
|
-
const index = this.others.indexOf(delegate);
|
|
3078
|
-
if (index >= 0) {
|
|
3079
|
-
this.others.splice(index, 1);
|
|
3080
|
-
}
|
|
3081
|
-
}
|
|
3082
|
-
});
|
|
3083
|
-
return disposableStore;
|
|
3084
|
-
}
|
|
3085
|
-
get delegates() {
|
|
3086
|
-
return [this._default, ...this.others];
|
|
3087
|
-
}
|
|
3088
|
-
async readFromDelegates(caller) {
|
|
3089
|
-
let firstError;
|
|
3090
|
-
for (const delegate of this.delegates) {
|
|
3091
|
-
try {
|
|
3092
|
-
return await caller(delegate);
|
|
3093
|
-
}
|
|
3094
|
-
catch (err) {
|
|
3095
|
-
firstError ?? (firstError = err);
|
|
3096
|
-
if (err instanceof FileSystemProviderError && err.code === FileSystemProviderErrorCode.FileNotFound) {
|
|
3097
|
-
continue;
|
|
3098
|
-
}
|
|
3099
|
-
throw err;
|
|
3100
|
-
}
|
|
3101
|
-
}
|
|
3102
|
-
throw firstError;
|
|
3103
|
-
}
|
|
3104
|
-
async writeToDelegates(caller) {
|
|
3105
|
-
await Promise.all(( this.delegates.map(async (delegate) => {
|
|
3106
|
-
if (((delegate.capabilities & 2048) ) === 0) {
|
|
3107
|
-
await caller(delegate);
|
|
3108
|
-
}
|
|
3109
|
-
})));
|
|
3110
|
-
}
|
|
3111
|
-
async stat(resource) {
|
|
3112
|
-
return this.readFromDelegates(delegate => delegate.stat(resource));
|
|
3113
|
-
}
|
|
3114
|
-
async readFile(resource) {
|
|
3115
|
-
return this.readFromDelegates(delegate => delegate.readFile(resource));
|
|
3116
|
-
}
|
|
3117
|
-
async readdir(resource) {
|
|
3118
|
-
return this.readFromDelegates(delegate => delegate.readdir(resource));
|
|
3119
|
-
}
|
|
3120
|
-
watch(resource, opts) {
|
|
3121
|
-
const store = new DisposableStore();
|
|
3122
|
-
for (const delegate of this.delegates) {
|
|
3123
|
-
store.add(delegate.watch(resource, opts));
|
|
3124
|
-
}
|
|
3125
|
-
return store;
|
|
3126
|
-
}
|
|
3127
|
-
async writeFile(resource, content, opts) {
|
|
3128
|
-
await this.writeToDelegates(delegate => delegate.writeFile(resource, content, opts));
|
|
3129
|
-
}
|
|
3130
|
-
async mkdir(resource) {
|
|
3131
|
-
await this.writeToDelegates(delegate => delegate.mkdir(resource));
|
|
3132
|
-
}
|
|
3133
|
-
async delete(resource, opts) {
|
|
3134
|
-
await this.writeToDelegates(delegate => delegate.delete(resource, opts));
|
|
3135
|
-
}
|
|
3136
|
-
async rename(from, to, opts) {
|
|
3137
|
-
await this.writeToDelegates(delegate => delegate.rename(from, to, opts));
|
|
3138
|
-
}
|
|
3139
|
-
}
|
|
3140
|
-
const fileSystemProvider = new OverlayFileSystemProvider(new InMemoryFileSystemProvider());
|
|
3141
|
-
let MemoryFileService = class MemoryFileService extends FileService {
|
|
3142
|
-
constructor(logService) {
|
|
3143
|
-
super(logService);
|
|
3144
|
-
const userMemoryFileSystem = new InMemoryFileSystemProvider();
|
|
3145
|
-
this.registerProvider('user', userMemoryFileSystem);
|
|
3146
|
-
this.registerProvider('extension', extensionFileSystemProvider);
|
|
3147
|
-
this.registerProvider('cache', new InMemoryFileSystemProvider());
|
|
3148
|
-
this.registerProvider('logs', new InMemoryFileSystemProvider());
|
|
3149
|
-
this.registerProvider('file', fileSystemProvider);
|
|
3150
|
-
}
|
|
3151
|
-
};
|
|
3152
|
-
MemoryFileService = __decorate([
|
|
3153
|
-
( __param(0, ILogService))
|
|
3154
|
-
], MemoryFileService);
|
|
3155
|
-
function getServiceOverride() {
|
|
3156
|
-
return {
|
|
3157
|
-
[( IFileService.toString())]: new SyncDescriptor(MemoryFileService),
|
|
3158
|
-
[( ITextFileService.toString())]: new SyncDescriptor(BrowserTextFileService)
|
|
3159
|
-
};
|
|
3160
|
-
}
|
|
3161
|
-
function registerExtensionFile(extensionLocation, path, getContent) {
|
|
3162
|
-
return extensionFileSystemProvider.registerFile(joinPath(extensionLocation, path), getContent);
|
|
3163
|
-
}
|
|
3164
|
-
function registerFileSystemOverlay(provider) {
|
|
3165
|
-
return fileSystemProvider.register(provider);
|
|
3166
|
-
}
|
|
3167
|
-
export { FileSystemProviderError, FileSystemProviderErrorCode, SimpleTextFileSystemProvider, getServiceOverride as default, registerExtensionFile, registerFileSystemOverlay };
|