@codingame/monaco-vscode-api 1.83.5 → 1.83.6
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/lifecycle.js +3 -1
- package/missing-services.js +32 -28
- package/monaco-editor-treemending.patch +786 -760
- package/monaco.js +1 -0
- package/package.json +1 -1
- package/service-override/extensions.js +5 -5
- package/service-override/files.js +37 -13
- package/service-override/keybindings.js +10 -4
- package/service-override/layout.js +1 -3
- package/services.d.ts +13 -2
- package/services.js +35 -5
- package/vscode/src/vs/base/browser/broadcast.js +52 -0
- package/vscode/src/vs/base/browser/ui/menu/menubar.js +1 -1
- package/vscode/src/vs/base/browser/ui/splitview/paneview.js +6 -1
- package/vscode/src/vs/base/common/date.js +244 -54
- package/vscode/src/vs/base/common/jsonErrorMessages.js +45 -9
- package/vscode/src/vs/editor/common/services/textResourceConfiguration.d.ts +65 -0
- package/vscode/src/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +33 -5
- package/vscode/src/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +165 -32
- package/vscode/src/vs/platform/dialogs/common/dialogs.js +30 -9
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +0 -3
- package/vscode/src/vs/platform/extensionManagement/common/extensionNls.js +6 -1
- package/vscode/src/vs/platform/files/browser/indexedDBFileSystemProvider.js +404 -0
- package/vscode/src/vs/platform/files/common/fileService.js +13 -2
- package/vscode/src/vs/platform/files/common/files.js +25 -5
- package/vscode/src/vs/platform/keyboardLayout/common/keyboardConfig.js +15 -3
- package/vscode/src/vs/platform/quickinput/browser/commandsQuickAccess.js +38 -7
- package/vscode/src/vs/platform/quickinput/browser/helpQuickAccess.js +7 -1
- package/vscode/src/vs/platform/request/common/request.js +1 -1
- package/vscode/src/vs/platform/theme/common/tokenClassificationRegistry.js +210 -42
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +73 -13
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +5 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +11 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +5 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +70 -35
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +108 -20
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +17 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +5 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +5 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +5 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +7 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +14 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +12 -14
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +6 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +32 -5
- package/vscode/src/vs/workbench/api/browser/statusBarExtensionPoint.js +0 -60
- package/vscode/src/vs/workbench/api/common/extHostChat.js +11 -2
- package/vscode/src/vs/workbench/api/common/extHostDiagnostics.js +6 -1
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +12 -2
- package/vscode/src/vs/workbench/api/common/extHostLogService.js +9 -1
- package/vscode/src/vs/workbench/api/common/extHostProgress.js +6 -1
- package/vscode/src/vs/workbench/api/common/extHostStatusBar.js +11 -2
- package/vscode/src/vs/workbench/api/common/extHostTelemetry.js +6 -1
- package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +6 -1
- package/vscode/src/vs/workbench/api/common/extHostTunnelService.js +10 -2
- package/vscode/src/vs/workbench/api/common/extHostWorkspace.js +7 -1
- package/vscode/src/vs/workbench/api/common/jsonValidationExtensionPoint.js +49 -9
- package/vscode/src/vs/workbench/browser/actions/layoutActions.js +397 -274
- package/vscode/src/vs/workbench/browser/actions/quickAccessActions.js +30 -6
- package/vscode/src/vs/workbench/browser/actions/windowActions.js +85 -31
- package/vscode/src/vs/workbench/browser/actions/workspaceActions.js +56 -102
- package/vscode/src/vs/workbench/browser/actions/workspaceCommands.js +5 -1
- package/vscode/src/vs/workbench/browser/editor.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.js +55 -11
- package/vscode/src/vs/workbench/browser/parts/compositeBarActions.js +63 -11
- package/vscode/src/vs/workbench/browser/parts/editor/binaryDiffEditor.js +7 -1
- package/vscode/src/vs/workbench/browser/parts/editor/binaryEditor.js +15 -3
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbs.js +205 -41
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +617 -139
- package/vscode/src/vs/workbench/browser/parts/editor/editorActions.js +578 -114
- package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +96 -20
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +30 -6
- package/vscode/src/vs/workbench/browser/parts/editor/editorPlaceholder.js +46 -9
- package/vscode/src/vs/workbench/browser/parts/editor/editorQuickAccess.js +30 -5
- package/vscode/src/vs/workbench/browser/parts/editor/editorStatus.js +309 -59
- package/vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.js +5 -1
- package/vscode/src/vs/workbench/browser/parts/editor/textCodeEditor.js +5 -1
- package/vscode/src/vs/workbench/browser/parts/editor/textDiffEditor.js +16 -3
- package/vscode/src/vs/workbench/browser/parts/editor/textEditor.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCommands.js +35 -7
- package/vscode/src/vs/workbench/browser/parts/panel/panelActions.js +185 -33
- package/vscode/src/vs/workbench/browser/parts/titlebar/menubarControl.js +90 -57
- package/vscode/src/vs/workbench/browser/parts/views/viewFilter.js +5 -1
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +16 -3
- package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js +26 -6
- package/vscode/src/vs/workbench/browser/parts/views/viewsService.js +35 -6
- package/vscode/src/vs/workbench/browser/quickaccess.js +6 -6
- package/vscode/src/vs/workbench/browser/workbench.contribution.js +918 -185
- package/vscode/src/vs/workbench/common/configuration.js +25 -11
- package/vscode/src/vs/workbench/common/contextkeys.js +244 -228
- package/vscode/src/vs/workbench/common/editor/diffEditorInput.js +7 -1
- package/vscode/src/vs/workbench/common/editor/resourceEditorInput.d.ts +44 -0
- package/vscode/src/vs/workbench/common/editor/sideBySideEditorInput.js +7 -1
- package/vscode/src/vs/workbench/common/editor/textEditorModel.js +6 -1
- package/vscode/src/vs/workbench/common/editor/textResourceEditorInput.d.ts +23 -0
- package/vscode/src/vs/workbench/common/editor.d.ts +26 -1
- package/vscode/src/vs/workbench/common/editor.js +26 -5
- package/vscode/src/vs/workbench/common/theme.js +676 -136
- package/vscode/src/vs/workbench/common/views.js +8 -3
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +71 -14
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityContributions.js +21 -2
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleView.js +133 -21
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewActions.js +36 -8
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.js +96 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +0 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.js +22 -4
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +22 -4
- package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +41 -8
- package/vscode/src/vs/workbench/contrib/codeActions/common/codeActionsExtensionPoint.js +25 -5
- package/vscode/src/vs/workbench/contrib/codeActions/common/documentationExtensionPoint.js +30 -6
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +34 -6
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/editorFeatures.js +44 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/inspectEditorTokens/inspectEditorTokens.js +10 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.js +320 -63
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/largeFileOptimizations.js +12 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess.js +15 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.js +30 -6
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.js +25 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.js +10 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.js +20 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.js +10 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.js +10 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +25 -9
- package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +30 -6
- package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +25 -5
- package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +16 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +8 -4
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +23 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +15 -9
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +18 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/comments.contribution.js +142 -26
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +33 -5
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +45 -7
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +63 -10
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +45 -9
- package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +16 -8
- package/vscode/src/vs/workbench/contrib/comments/common/commentContextKeys.js +41 -21
- package/vscode/src/vs/workbench/contrib/comments/common/commentModel.js +5 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.js +5 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/debugColors.js +60 -12
- package/vscode/src/vs/workbench/contrib/debug/browser/debugIcons.js +275 -55
- package/vscode/src/vs/workbench/contrib/debug/common/abstractDebugAdapter.js +7 -1
- package/vscode/src/vs/workbench/contrib/debug/common/debug.js +255 -94
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsIcons.js +120 -24
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/configuration.js +22 -4
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpenerService.js +21 -4
- package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +39 -51
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.js +394 -75
- package/vscode/src/vs/workbench/contrib/files/browser/fileConstants.js +17 -6
- package/vscode/src/vs/workbench/contrib/files/browser/fileImportExport.js +190 -32
- package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +5 -1
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerDecorationsProvider.js +21 -4
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerView.js +26 -5
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.js +81 -14
- package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +26 -5
- package/vscode/src/vs/workbench/contrib/files/common/files.js +70 -26
- package/vscode/src/vs/workbench/contrib/folding/browser/folding.contribution.js +11 -3
- package/vscode/src/vs/workbench/contrib/format/browser/formatModified.js +5 -1
- package/vscode/src/vs/workbench/contrib/inlayHints/browser/inlayHintsAccessibilty.js +20 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +75 -111
- package/vscode/src/vs/workbench/contrib/keybindings/browser/keybindings.contribution.js +5 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +6 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +151 -29
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +10 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +0 -42
- package/vscode/src/vs/workbench/contrib/output/browser/output.contribution.js +115 -23
- package/vscode/src/vs/workbench/contrib/output/browser/outputView.js +17 -3
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +49 -9
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/quickAccess.contribution.js +66 -13
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/viewQuickAccess.js +52 -10
- package/vscode/src/vs/workbench/contrib/scm/browser/dirtyDiffSwitcher.js +10 -2
- package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +110 -26
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetCompletionProvider.js +21 -3
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsFile.js +15 -3
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsService.js +56 -9
- package/vscode/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.js +25 -5
- package/vscode/src/vs/workbench/contrib/tasks/common/taskService.js +16 -26
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +7 -8
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEditorInput.js +20 -4
- package/vscode/src/vs/workbench/contrib/terminal/common/terminal.js +35 -7
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalColorRegistry.js +106 -21
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalContextKey.js +81 -21
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +6 -1
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditor.js +6 -2
- package/vscode/src/vs/workbench/services/actions/common/menusExtensionPoint.js +592 -112
- package/vscode/src/vs/workbench/services/assignment/common/assignmentService.js +5 -1
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +6 -32
- package/vscode/src/vs/workbench/services/configuration/common/jsonEditingService.js +5 -1
- package/vscode/src/vs/workbench/services/decorations/browser/decorationsService.js +5 -1
- package/vscode/src/vs/workbench/services/editor/common/editorResolverService.js +5 -1
- package/vscode/src/vs/workbench/services/extensions/browser/extensionUrlHandler.js +15 -3
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +58 -10
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +5 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsRegistry.js +392 -80
- package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +28 -5
- package/vscode/src/vs/workbench/services/host/browser/browserHostService.js +10 -2
- package/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.js +129 -24
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.js +10 -2
- package/vscode/src/vs/workbench/services/keybinding/common/keybindingEditing.js +20 -10
- package/vscode/src/vs/workbench/services/language/common/languageService.js +122 -22
- package/vscode/src/vs/workbench/services/remote/common/tunnelModel.js +28 -9
- package/vscode/src/vs/workbench/services/search/common/queryBuilder.js +6 -1
- package/vscode/src/vs/workbench/services/textfile/browser/textFileService.js +48 -9
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +5 -1
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModelManager.js +7 -1
- package/vscode/src/vs/workbench/services/textfile/common/textFileSaveParticipant.js +6 -1
- package/vscode/src/vs/workbench/services/themes/common/colorExtensionPoint.js +81 -16
- package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +1 -50
- package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +126 -25
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfile.js +6 -5
- package/vscode/src/vs/workbench/services/userDataSync/common/userDataSync.js +6 -14
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant.js +6 -1
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
import { Throttler } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
2
|
+
import { VSBuffer } from 'monaco-editor/esm/vs/base/common/buffer.js';
|
|
3
|
+
import { Event, Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
4
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
5
|
+
import { ExtUri } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
6
|
+
import { isString } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
7
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
8
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
9
|
+
import { createFileSystemProviderError, FileSystemProviderErrorCode, FileType, FileSystemProviderError } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
10
|
+
import { DBClosedError } from 'monaco-editor/esm/vs/base/browser/indexedDB.js';
|
|
11
|
+
import { BroadcastDataChannel } from '../../../base/browser/broadcast.js';
|
|
12
|
+
const ERR_FILE_NOT_FOUND = createFileSystemProviderError(( localizeWithPath(
|
|
13
|
+
'vs/platform/files/browser/indexedDBFileSystemProvider',
|
|
14
|
+
'fileNotExists',
|
|
15
|
+
"File does not exist"
|
|
16
|
+
)), FileSystemProviderErrorCode.FileNotFound);
|
|
17
|
+
const ERR_FILE_IS_DIR = createFileSystemProviderError(( localizeWithPath(
|
|
18
|
+
'vs/platform/files/browser/indexedDBFileSystemProvider',
|
|
19
|
+
'fileIsDirectory',
|
|
20
|
+
"File is Directory"
|
|
21
|
+
)), FileSystemProviderErrorCode.FileIsADirectory);
|
|
22
|
+
const ERR_FILE_NOT_DIR = createFileSystemProviderError(( localizeWithPath(
|
|
23
|
+
'vs/platform/files/browser/indexedDBFileSystemProvider',
|
|
24
|
+
'fileNotDirectory',
|
|
25
|
+
"File is not a directory"
|
|
26
|
+
)), FileSystemProviderErrorCode.FileNotADirectory);
|
|
27
|
+
const ERR_DIR_NOT_EMPTY = createFileSystemProviderError(( localizeWithPath(
|
|
28
|
+
'vs/platform/files/browser/indexedDBFileSystemProvider',
|
|
29
|
+
'dirIsNotEmpty',
|
|
30
|
+
"Directory is not empty"
|
|
31
|
+
)), FileSystemProviderErrorCode.Unknown);
|
|
32
|
+
const ERR_FILE_EXCEEDS_STORAGE_QUOTA = createFileSystemProviderError(( localizeWithPath(
|
|
33
|
+
'vs/platform/files/browser/indexedDBFileSystemProvider',
|
|
34
|
+
'fileExceedsStorageQuota',
|
|
35
|
+
"File exceeds available storage quota"
|
|
36
|
+
)), FileSystemProviderErrorCode.FileExceedsStorageQuota);
|
|
37
|
+
const ERR_UNKNOWN_INTERNAL = (message) => createFileSystemProviderError(( localizeWithPath(
|
|
38
|
+
'vs/platform/files/browser/indexedDBFileSystemProvider',
|
|
39
|
+
'internal',
|
|
40
|
+
"Internal error occurred in IndexedDB File System Provider. ({0})",
|
|
41
|
+
message
|
|
42
|
+
)), FileSystemProviderErrorCode.Unknown);
|
|
43
|
+
class IndexedDBFileSystemNode {
|
|
44
|
+
constructor(entry) {
|
|
45
|
+
this.entry = entry;
|
|
46
|
+
this.type = entry.type;
|
|
47
|
+
}
|
|
48
|
+
read(path) {
|
|
49
|
+
return this.doRead(path.split('/').filter(p => p.length));
|
|
50
|
+
}
|
|
51
|
+
doRead(pathParts) {
|
|
52
|
+
if (pathParts.length === 0) {
|
|
53
|
+
return this.entry;
|
|
54
|
+
}
|
|
55
|
+
if (this.entry.type !== FileType.Directory) {
|
|
56
|
+
throw ERR_UNKNOWN_INTERNAL('Internal error reading from IndexedDBFSNode -- expected directory at ' + this.entry.path);
|
|
57
|
+
}
|
|
58
|
+
const next = this.entry.children.get(pathParts[0]);
|
|
59
|
+
if (!next) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
return next.doRead(pathParts.slice(1));
|
|
63
|
+
}
|
|
64
|
+
delete(path) {
|
|
65
|
+
const toDelete = path.split('/').filter(p => p.length);
|
|
66
|
+
if (toDelete.length === 0) {
|
|
67
|
+
if (this.entry.type !== FileType.Directory) {
|
|
68
|
+
throw ERR_UNKNOWN_INTERNAL(`Internal error deleting from IndexedDBFSNode. Expected root entry to be directory`);
|
|
69
|
+
}
|
|
70
|
+
this.entry.children.clear();
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
return this.doDelete(toDelete, path);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
doDelete(pathParts, originalPath) {
|
|
77
|
+
if (pathParts.length === 0) {
|
|
78
|
+
throw ERR_UNKNOWN_INTERNAL(`Internal error deleting from IndexedDBFSNode -- got no deletion path parts (encountered while deleting ${originalPath})`);
|
|
79
|
+
}
|
|
80
|
+
else if (this.entry.type !== FileType.Directory) {
|
|
81
|
+
throw ERR_UNKNOWN_INTERNAL('Internal error deleting from IndexedDBFSNode -- expected directory at ' + this.entry.path);
|
|
82
|
+
}
|
|
83
|
+
else if (pathParts.length === 1) {
|
|
84
|
+
this.entry.children.delete(pathParts[0]);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
const next = this.entry.children.get(pathParts[0]);
|
|
88
|
+
if (!next) {
|
|
89
|
+
throw ERR_UNKNOWN_INTERNAL('Internal error deleting from IndexedDBFSNode -- expected entry at ' + this.entry.path + '/' + next);
|
|
90
|
+
}
|
|
91
|
+
next.doDelete(pathParts.slice(1), originalPath);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
add(path, entry) {
|
|
95
|
+
this.doAdd(path.split('/').filter(p => p.length), entry, path);
|
|
96
|
+
}
|
|
97
|
+
doAdd(pathParts, entry, originalPath) {
|
|
98
|
+
if (pathParts.length === 0) {
|
|
99
|
+
throw ERR_UNKNOWN_INTERNAL(`Internal error creating IndexedDBFSNode -- adding empty path (encountered while adding ${originalPath})`);
|
|
100
|
+
}
|
|
101
|
+
else if (this.entry.type !== FileType.Directory) {
|
|
102
|
+
throw ERR_UNKNOWN_INTERNAL(`Internal error creating IndexedDBFSNode -- parent is not a directory (encountered while adding ${originalPath})`);
|
|
103
|
+
}
|
|
104
|
+
else if (pathParts.length === 1) {
|
|
105
|
+
const next = pathParts[0];
|
|
106
|
+
const existing = this.entry.children.get(next);
|
|
107
|
+
if (entry.type === 'dir') {
|
|
108
|
+
if (existing?.entry.type === FileType.File) {
|
|
109
|
+
throw ERR_UNKNOWN_INTERNAL(`Internal error creating IndexedDBFSNode -- overwriting file with directory: ${this.entry.path}/${next} (encountered while adding ${originalPath})`);
|
|
110
|
+
}
|
|
111
|
+
this.entry.children.set(next, existing ?? ( new IndexedDBFileSystemNode({
|
|
112
|
+
type: FileType.Directory,
|
|
113
|
+
path: this.entry.path + '/' + next,
|
|
114
|
+
children: ( new Map()),
|
|
115
|
+
})));
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
if (existing?.entry.type === FileType.Directory) {
|
|
119
|
+
throw ERR_UNKNOWN_INTERNAL(`Internal error creating IndexedDBFSNode -- overwriting directory with file: ${this.entry.path}/${next} (encountered while adding ${originalPath})`);
|
|
120
|
+
}
|
|
121
|
+
this.entry.children.set(next, ( new IndexedDBFileSystemNode({
|
|
122
|
+
type: FileType.File,
|
|
123
|
+
path: this.entry.path + '/' + next,
|
|
124
|
+
size: entry.size,
|
|
125
|
+
})));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
else if (pathParts.length > 1) {
|
|
129
|
+
const next = pathParts[0];
|
|
130
|
+
let childNode = this.entry.children.get(next);
|
|
131
|
+
if (!childNode) {
|
|
132
|
+
childNode = ( new IndexedDBFileSystemNode({
|
|
133
|
+
children: ( new Map()),
|
|
134
|
+
path: this.entry.path + '/' + next,
|
|
135
|
+
type: FileType.Directory
|
|
136
|
+
}));
|
|
137
|
+
this.entry.children.set(next, childNode);
|
|
138
|
+
}
|
|
139
|
+
else if (childNode.type === FileType.File) {
|
|
140
|
+
throw ERR_UNKNOWN_INTERNAL(`Internal error creating IndexedDBFSNode -- overwriting file entry with directory: ${this.entry.path}/${next} (encountered while adding ${originalPath})`);
|
|
141
|
+
}
|
|
142
|
+
childNode.doAdd(pathParts.slice(1), entry, originalPath);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
print(indentation = '') {
|
|
146
|
+
console.log(indentation + this.entry.path);
|
|
147
|
+
if (this.entry.type === FileType.Directory) {
|
|
148
|
+
this.entry.children.forEach(child => child.print(indentation + ' '));
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
class IndexedDBFileSystemProvider extends Disposable {
|
|
153
|
+
constructor(scheme, indexedDB, store, watchCrossWindowChanges) {
|
|
154
|
+
super();
|
|
155
|
+
this.scheme = scheme;
|
|
156
|
+
this.indexedDB = indexedDB;
|
|
157
|
+
this.store = store;
|
|
158
|
+
this.capabilities = 2
|
|
159
|
+
| 1024 ;
|
|
160
|
+
this.onDidChangeCapabilities = Event.None;
|
|
161
|
+
this.extUri = ( new ExtUri(() => false)) ;
|
|
162
|
+
this._onDidChangeFile = this._register(( new Emitter()));
|
|
163
|
+
this.onDidChangeFile = this._onDidChangeFile.event;
|
|
164
|
+
this._onReportError = this._register(( new Emitter()));
|
|
165
|
+
this.onReportError = this._onReportError.event;
|
|
166
|
+
this.mtimes = ( new Map());
|
|
167
|
+
this.fileWriteBatch = [];
|
|
168
|
+
this.writeManyThrottler = ( new Throttler());
|
|
169
|
+
if (watchCrossWindowChanges) {
|
|
170
|
+
this.changesBroadcastChannel = this._register(( new BroadcastDataChannel(`vscode.indexedDB.${scheme}.changes`)));
|
|
171
|
+
this._register(this.changesBroadcastChannel.onDidReceiveData(changes => {
|
|
172
|
+
this._onDidChangeFile.fire(( changes.map(c => ({ type: c.type, resource: URI.revive(c.resource) }))));
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
watch(resource, opts) {
|
|
177
|
+
return Disposable.None;
|
|
178
|
+
}
|
|
179
|
+
async mkdir(resource) {
|
|
180
|
+
try {
|
|
181
|
+
const resourceStat = await this.stat(resource);
|
|
182
|
+
if (resourceStat.type === FileType.File) {
|
|
183
|
+
throw ERR_FILE_NOT_DIR;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
catch (error) { }
|
|
187
|
+
(await this.getFiletree()).add(resource.path, { type: 'dir' });
|
|
188
|
+
}
|
|
189
|
+
async stat(resource) {
|
|
190
|
+
const entry = (await this.getFiletree()).read(resource.path);
|
|
191
|
+
if (entry?.type === FileType.File) {
|
|
192
|
+
return {
|
|
193
|
+
type: FileType.File,
|
|
194
|
+
ctime: 0,
|
|
195
|
+
mtime: this.mtimes.get(( resource.toString())) || 0,
|
|
196
|
+
size: entry.size ?? (await this.readFile(resource)).byteLength
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
if (entry?.type === FileType.Directory) {
|
|
200
|
+
return {
|
|
201
|
+
type: FileType.Directory,
|
|
202
|
+
ctime: 0,
|
|
203
|
+
mtime: 0,
|
|
204
|
+
size: 0
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
throw ERR_FILE_NOT_FOUND;
|
|
208
|
+
}
|
|
209
|
+
async readdir(resource) {
|
|
210
|
+
try {
|
|
211
|
+
const entry = (await this.getFiletree()).read(resource.path);
|
|
212
|
+
if (!entry) {
|
|
213
|
+
return [];
|
|
214
|
+
}
|
|
215
|
+
if (entry.type !== FileType.Directory) {
|
|
216
|
+
throw ERR_FILE_NOT_DIR;
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
return ( [...entry.children.entries()].map(([name, node]) => [name, node.type]));
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
catch (error) {
|
|
223
|
+
this.reportError('readDir', error);
|
|
224
|
+
throw error;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
async readFile(resource) {
|
|
228
|
+
try {
|
|
229
|
+
const result = await this.indexedDB.runInTransaction(this.store, 'readonly', objectStore => objectStore.get(resource.path));
|
|
230
|
+
if (result === undefined) {
|
|
231
|
+
throw ERR_FILE_NOT_FOUND;
|
|
232
|
+
}
|
|
233
|
+
const buffer = result instanceof Uint8Array ? result : isString(result) ? VSBuffer.fromString(result).buffer : undefined;
|
|
234
|
+
if (buffer === undefined) {
|
|
235
|
+
throw ERR_UNKNOWN_INTERNAL(`IndexedDB entry at "${resource.path}" in unexpected format`);
|
|
236
|
+
}
|
|
237
|
+
const fileTree = await this.getFiletree();
|
|
238
|
+
fileTree.add(resource.path, { type: 'file', size: buffer.byteLength });
|
|
239
|
+
return buffer;
|
|
240
|
+
}
|
|
241
|
+
catch (error) {
|
|
242
|
+
this.reportError('readFile', error);
|
|
243
|
+
throw error;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
async writeFile(resource, content, opts) {
|
|
247
|
+
try {
|
|
248
|
+
const existing = await this.stat(resource).catch(() => undefined);
|
|
249
|
+
if (existing?.type === FileType.Directory) {
|
|
250
|
+
throw ERR_FILE_IS_DIR;
|
|
251
|
+
}
|
|
252
|
+
await this.bulkWrite([[resource, content]]);
|
|
253
|
+
}
|
|
254
|
+
catch (error) {
|
|
255
|
+
this.reportError('writeFile', error);
|
|
256
|
+
throw error;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
async rename(from, to, opts) {
|
|
260
|
+
const fileTree = await this.getFiletree();
|
|
261
|
+
const fromEntry = fileTree.read(from.path);
|
|
262
|
+
if (!fromEntry) {
|
|
263
|
+
throw ERR_FILE_NOT_FOUND;
|
|
264
|
+
}
|
|
265
|
+
const toEntry = fileTree.read(to.path);
|
|
266
|
+
if (toEntry) {
|
|
267
|
+
if (!opts.overwrite) {
|
|
268
|
+
throw createFileSystemProviderError('file exists already', FileSystemProviderErrorCode.FileExists);
|
|
269
|
+
}
|
|
270
|
+
if (toEntry.type !== fromEntry.type) {
|
|
271
|
+
throw createFileSystemProviderError('Cannot rename files with different types', FileSystemProviderErrorCode.Unknown);
|
|
272
|
+
}
|
|
273
|
+
await this.delete(to, { recursive: true, useTrash: false, atomic: false });
|
|
274
|
+
}
|
|
275
|
+
const toTargetResource = (path) => this.extUri.joinPath(to, this.extUri.relativePath(from, from.with({ path })) || '');
|
|
276
|
+
const sourceEntries = await this.tree(from);
|
|
277
|
+
const sourceFiles = [];
|
|
278
|
+
for (const sourceEntry of sourceEntries) {
|
|
279
|
+
if (sourceEntry[1] === FileType.File) {
|
|
280
|
+
sourceFiles.push(sourceEntry);
|
|
281
|
+
}
|
|
282
|
+
else if (sourceEntry[1] === FileType.Directory) {
|
|
283
|
+
fileTree.add(toTargetResource(sourceEntry[0]).path, { type: 'dir' });
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
if (sourceFiles.length) {
|
|
287
|
+
const targetFiles = [];
|
|
288
|
+
const sourceFilesContents = await this.indexedDB.runInTransaction(this.store, 'readonly', objectStore => ( sourceFiles.map(([path]) => objectStore.get(path))));
|
|
289
|
+
for (let index = 0; index < sourceFiles.length; index++) {
|
|
290
|
+
const content = sourceFilesContents[index] instanceof Uint8Array ? sourceFilesContents[index] : isString(sourceFilesContents[index]) ? VSBuffer.fromString(sourceFilesContents[index]).buffer : undefined;
|
|
291
|
+
if (content) {
|
|
292
|
+
targetFiles.push([toTargetResource(sourceFiles[index][0]), content]);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
await this.bulkWrite(targetFiles);
|
|
296
|
+
}
|
|
297
|
+
await this.delete(from, { recursive: true, useTrash: false, atomic: false });
|
|
298
|
+
}
|
|
299
|
+
async delete(resource, opts) {
|
|
300
|
+
let stat;
|
|
301
|
+
try {
|
|
302
|
+
stat = await this.stat(resource);
|
|
303
|
+
}
|
|
304
|
+
catch (e) {
|
|
305
|
+
if (e.code === FileSystemProviderErrorCode.FileNotFound) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
throw e;
|
|
309
|
+
}
|
|
310
|
+
let toDelete;
|
|
311
|
+
if (opts.recursive) {
|
|
312
|
+
const tree = await this.tree(resource);
|
|
313
|
+
toDelete = ( tree.map(([path]) => path));
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
if (stat.type === FileType.Directory && (await this.readdir(resource)).length) {
|
|
317
|
+
throw ERR_DIR_NOT_EMPTY;
|
|
318
|
+
}
|
|
319
|
+
toDelete = [resource.path];
|
|
320
|
+
}
|
|
321
|
+
await this.deleteKeys(toDelete);
|
|
322
|
+
(await this.getFiletree()).delete(resource.path);
|
|
323
|
+
toDelete.forEach(key => this.mtimes.delete(key));
|
|
324
|
+
this.triggerChanges(( toDelete.map(
|
|
325
|
+
path => ({ resource: resource.with({ path }), type: 2 })
|
|
326
|
+
)));
|
|
327
|
+
}
|
|
328
|
+
async tree(resource) {
|
|
329
|
+
const stat = await this.stat(resource);
|
|
330
|
+
const allEntries = [[resource.path, stat.type]];
|
|
331
|
+
if (stat.type === FileType.Directory) {
|
|
332
|
+
const dirEntries = await this.readdir(resource);
|
|
333
|
+
for (const [key, type] of dirEntries) {
|
|
334
|
+
const childResource = this.extUri.joinPath(resource, key);
|
|
335
|
+
allEntries.push([childResource.path, type]);
|
|
336
|
+
if (type === FileType.Directory) {
|
|
337
|
+
const childEntries = await this.tree(childResource);
|
|
338
|
+
allEntries.push(...childEntries);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
return allEntries;
|
|
343
|
+
}
|
|
344
|
+
triggerChanges(changes) {
|
|
345
|
+
if (changes.length) {
|
|
346
|
+
this._onDidChangeFile.fire(changes);
|
|
347
|
+
this.changesBroadcastChannel?.postData(changes);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
getFiletree() {
|
|
351
|
+
if (!this.cachedFiletree) {
|
|
352
|
+
this.cachedFiletree = (async () => {
|
|
353
|
+
const rootNode = ( new IndexedDBFileSystemNode({
|
|
354
|
+
children: ( new Map()),
|
|
355
|
+
path: '',
|
|
356
|
+
type: FileType.Directory
|
|
357
|
+
}));
|
|
358
|
+
const result = await this.indexedDB.runInTransaction(this.store, 'readonly', objectStore => objectStore.getAllKeys());
|
|
359
|
+
const keys = ( result.map(key => ( key.toString())));
|
|
360
|
+
keys.forEach(key => rootNode.add(key, { type: 'file' }));
|
|
361
|
+
return rootNode;
|
|
362
|
+
})();
|
|
363
|
+
}
|
|
364
|
+
return this.cachedFiletree;
|
|
365
|
+
}
|
|
366
|
+
async bulkWrite(files) {
|
|
367
|
+
files.forEach(([resource, content]) => this.fileWriteBatch.push({ content, resource }));
|
|
368
|
+
await this.writeManyThrottler.queue(() => this.writeMany());
|
|
369
|
+
const fileTree = await this.getFiletree();
|
|
370
|
+
for (const [resource, content] of files) {
|
|
371
|
+
fileTree.add(resource.path, { type: 'file', size: content.byteLength });
|
|
372
|
+
this.mtimes.set(( resource.toString()), Date.now());
|
|
373
|
+
}
|
|
374
|
+
this.triggerChanges(( files.map(([resource]) => ({ resource, type: 0 }))));
|
|
375
|
+
}
|
|
376
|
+
async writeMany() {
|
|
377
|
+
if (this.fileWriteBatch.length) {
|
|
378
|
+
const fileBatch = this.fileWriteBatch.splice(0, this.fileWriteBatch.length);
|
|
379
|
+
try {
|
|
380
|
+
await this.indexedDB.runInTransaction(this.store, 'readwrite', objectStore => ( fileBatch.map(entry => {
|
|
381
|
+
return objectStore.put(entry.content, entry.resource.path);
|
|
382
|
+
})));
|
|
383
|
+
}
|
|
384
|
+
catch (ex) {
|
|
385
|
+
if (ex instanceof DOMException && ex.name === 'QuotaExceededError') {
|
|
386
|
+
throw ERR_FILE_EXCEEDS_STORAGE_QUOTA;
|
|
387
|
+
}
|
|
388
|
+
throw ex;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
async deleteKeys(keys) {
|
|
393
|
+
if (keys.length) {
|
|
394
|
+
await this.indexedDB.runInTransaction(this.store, 'readwrite', objectStore => ( keys.map(key => objectStore.delete(key))));
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
async reset() {
|
|
398
|
+
await this.indexedDB.runInTransaction(this.store, 'readwrite', objectStore => objectStore.clear());
|
|
399
|
+
}
|
|
400
|
+
reportError(operation, error) {
|
|
401
|
+
this._onReportError.fire({ scheme: this.scheme, operation, code: error instanceof FileSystemProviderError || error instanceof DBClosedError ? error.code : 'unknown' });
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
export { IndexedDBFileSystemProvider };
|
|
@@ -98,7 +98,12 @@ let FileService = class FileService extends Disposable {
|
|
|
98
98
|
const provider = this.provider.get(resource.scheme);
|
|
99
99
|
if (!provider) {
|
|
100
100
|
const error = ( new ErrorNoTelemetry());
|
|
101
|
-
error.message =
|
|
101
|
+
error.message = ( localizeWithPath(
|
|
102
|
+
'vs/platform/files/common/fileService',
|
|
103
|
+
'noProviderFound',
|
|
104
|
+
"ENOPRO: No file system provider found for resource '{0}'",
|
|
105
|
+
( resource.toString())
|
|
106
|
+
));
|
|
102
107
|
throw error;
|
|
103
108
|
}
|
|
104
109
|
return provider;
|
|
@@ -400,7 +405,13 @@ let FileService = class FileService extends Disposable {
|
|
|
400
405
|
}
|
|
401
406
|
}
|
|
402
407
|
restoreReadError(error, resource, options) {
|
|
403
|
-
const message =
|
|
408
|
+
const message = ( localizeWithPath(
|
|
409
|
+
'vs/platform/files/common/fileService',
|
|
410
|
+
'err.read',
|
|
411
|
+
"Unable to read file '{0}' ({1})",
|
|
412
|
+
this.resourceForError(resource),
|
|
413
|
+
( ensureFileSystemProviderError(error).toString())
|
|
414
|
+
));
|
|
404
415
|
if (error instanceof NotModifiedSinceFileOperationError) {
|
|
405
416
|
return ( new NotModifiedSinceFileOperationError(message, error.stat, options));
|
|
406
417
|
}
|
|
@@ -44,18 +44,38 @@ class ByteSize {
|
|
|
44
44
|
size = 0;
|
|
45
45
|
}
|
|
46
46
|
if (size < ByteSize.KB) {
|
|
47
|
-
return localizeWithPath('vs/platform/files/common/files', 'sizeB', "{0}B", size.toFixed(0));
|
|
47
|
+
return ( localizeWithPath('vs/platform/files/common/files', 'sizeB', "{0}B", size.toFixed(0)));
|
|
48
48
|
}
|
|
49
49
|
if (size < ByteSize.MB) {
|
|
50
|
-
return
|
|
50
|
+
return ( localizeWithPath(
|
|
51
|
+
'vs/platform/files/common/files',
|
|
52
|
+
'sizeKB',
|
|
53
|
+
"{0}KB",
|
|
54
|
+
(size / ByteSize.KB).toFixed(2)
|
|
55
|
+
));
|
|
51
56
|
}
|
|
52
57
|
if (size < ByteSize.GB) {
|
|
53
|
-
return
|
|
58
|
+
return ( localizeWithPath(
|
|
59
|
+
'vs/platform/files/common/files',
|
|
60
|
+
'sizeMB',
|
|
61
|
+
"{0}MB",
|
|
62
|
+
(size / ByteSize.MB).toFixed(2)
|
|
63
|
+
));
|
|
54
64
|
}
|
|
55
65
|
if (size < ByteSize.TB) {
|
|
56
|
-
return
|
|
66
|
+
return ( localizeWithPath(
|
|
67
|
+
'vs/platform/files/common/files',
|
|
68
|
+
'sizeGB',
|
|
69
|
+
"{0}GB",
|
|
70
|
+
(size / ByteSize.GB).toFixed(2)
|
|
71
|
+
));
|
|
57
72
|
}
|
|
58
|
-
return
|
|
73
|
+
return ( localizeWithPath(
|
|
74
|
+
'vs/platform/files/common/files',
|
|
75
|
+
'sizeTB',
|
|
76
|
+
"{0}TB",
|
|
77
|
+
(size / ByteSize.TB).toFixed(2)
|
|
78
|
+
));
|
|
59
79
|
}
|
|
60
80
|
}
|
|
61
81
|
export { ByteSize, FileChangeType, FilePermission, FileSystemProviderCapabilities, FileType };
|
|
@@ -13,21 +13,33 @@ const keyboardConfiguration = {
|
|
|
13
13
|
'id': 'keyboard',
|
|
14
14
|
'order': 15,
|
|
15
15
|
'type': 'object',
|
|
16
|
-
'title': nls.localizeWithPath(
|
|
16
|
+
'title': ( nls.localizeWithPath(
|
|
17
|
+
'vs/platform/keyboardLayout/common/keyboardConfig',
|
|
18
|
+
'keyboardConfigurationTitle',
|
|
19
|
+
"Keyboard"
|
|
20
|
+
)),
|
|
17
21
|
'properties': {
|
|
18
22
|
'keyboard.dispatch': {
|
|
19
23
|
scope: 1 ,
|
|
20
24
|
type: 'string',
|
|
21
25
|
enum: ['code', 'keyCode'],
|
|
22
26
|
default: 'code',
|
|
23
|
-
markdownDescription: nls.localizeWithPath(
|
|
27
|
+
markdownDescription: ( nls.localizeWithPath(
|
|
28
|
+
'vs/platform/keyboardLayout/common/keyboardConfig',
|
|
29
|
+
'dispatch',
|
|
30
|
+
"Controls the dispatching logic for key presses to use either `code` (recommended) or `keyCode`."
|
|
31
|
+
)),
|
|
24
32
|
included: OS === 2 || OS === 3
|
|
25
33
|
},
|
|
26
34
|
'keyboard.mapAltGrToCtrlAlt': {
|
|
27
35
|
scope: 1 ,
|
|
28
36
|
type: 'boolean',
|
|
29
37
|
default: false,
|
|
30
|
-
markdownDescription: nls.localizeWithPath(
|
|
38
|
+
markdownDescription: ( nls.localizeWithPath(
|
|
39
|
+
'vs/platform/keyboardLayout/common/keyboardConfig',
|
|
40
|
+
'mapAltGrToCtrlAlt',
|
|
41
|
+
"Controls if the AltGraph+ modifier should be treated as Ctrl+Alt+."
|
|
42
|
+
)),
|
|
31
43
|
included: OS === 1
|
|
32
44
|
}
|
|
33
45
|
}
|
|
@@ -132,20 +132,36 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
132
132
|
for (let i = 0; i < filteredCommandPicks.length; i++) {
|
|
133
133
|
const commandPick = filteredCommandPicks[i];
|
|
134
134
|
if (i === 0 && this.commandsHistory.peek(commandPick.commandId)) {
|
|
135
|
-
commandPicks.push({ type: 'separator', label: localizeWithPath(
|
|
135
|
+
commandPicks.push({ type: 'separator', label: ( localizeWithPath(
|
|
136
|
+
'vs/platform/quickinput/browser/commandsQuickAccess',
|
|
137
|
+
'recentlyUsed',
|
|
138
|
+
"recently used"
|
|
139
|
+
)) });
|
|
136
140
|
addOtherSeparator = true;
|
|
137
141
|
}
|
|
138
142
|
if (addSuggestedSeparator && commandPick.tfIdfScore !== undefined) {
|
|
139
|
-
commandPicks.push({ type: 'separator', label: localizeWithPath(
|
|
143
|
+
commandPicks.push({ type: 'separator', label: ( localizeWithPath(
|
|
144
|
+
'vs/platform/quickinput/browser/commandsQuickAccess',
|
|
145
|
+
'suggested',
|
|
146
|
+
"similar commands"
|
|
147
|
+
)) });
|
|
140
148
|
addSuggestedSeparator = false;
|
|
141
149
|
}
|
|
142
150
|
if (addCommonlyUsedSeparator && commandPick.tfIdfScore === undefined && !this.commandsHistory.peek(commandPick.commandId) && this.options.suggestedCommandIds?.has(commandPick.commandId)) {
|
|
143
|
-
commandPicks.push({ type: 'separator', label: localizeWithPath(
|
|
151
|
+
commandPicks.push({ type: 'separator', label: ( localizeWithPath(
|
|
152
|
+
'vs/platform/quickinput/browser/commandsQuickAccess',
|
|
153
|
+
'commonlyUsed',
|
|
154
|
+
"commonly used"
|
|
155
|
+
)) });
|
|
144
156
|
addOtherSeparator = true;
|
|
145
157
|
addCommonlyUsedSeparator = false;
|
|
146
158
|
}
|
|
147
159
|
if (addOtherSeparator && commandPick.tfIdfScore === undefined && !this.commandsHistory.peek(commandPick.commandId) && !this.options.suggestedCommandIds?.has(commandPick.commandId)) {
|
|
148
|
-
commandPicks.push({ type: 'separator', label: localizeWithPath(
|
|
160
|
+
commandPicks.push({ type: 'separator', label: ( localizeWithPath(
|
|
161
|
+
'vs/platform/quickinput/browser/commandsQuickAccess',
|
|
162
|
+
'morecCommands',
|
|
163
|
+
"other commands"
|
|
164
|
+
)) });
|
|
149
165
|
addOtherSeparator = false;
|
|
150
166
|
}
|
|
151
167
|
commandPicks.push(this.toCommandPick(commandPick, runOptions));
|
|
@@ -162,7 +178,11 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
162
178
|
}
|
|
163
179
|
const commandPicks = ( additionalCommandPicks.map(commandPick => this.toCommandPick(commandPick, runOptions)));
|
|
164
180
|
if (addSuggestedSeparator && commandPicks[0]?.type !== 'separator') {
|
|
165
|
-
commandPicks.unshift({ type: 'separator', label: localizeWithPath(
|
|
181
|
+
commandPicks.unshift({ type: 'separator', label: ( localizeWithPath(
|
|
182
|
+
'vs/platform/quickinput/browser/commandsQuickAccess',
|
|
183
|
+
'suggested',
|
|
184
|
+
"similar commands"
|
|
185
|
+
)) });
|
|
166
186
|
}
|
|
167
187
|
return commandPicks;
|
|
168
188
|
})()
|
|
@@ -174,7 +194,13 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
174
194
|
}
|
|
175
195
|
const keybinding = this.keybindingService.lookupKeybinding(commandPick.commandId);
|
|
176
196
|
const ariaLabel = keybinding ?
|
|
177
|
-
|
|
197
|
+
( localizeWithPath(
|
|
198
|
+
'vs/platform/quickinput/browser/commandsQuickAccess',
|
|
199
|
+
'commandPickAriaLabelWithKeybinding',
|
|
200
|
+
"{0}, {1}",
|
|
201
|
+
commandPick.label,
|
|
202
|
+
keybinding.getAriaLabel()
|
|
203
|
+
)) :
|
|
178
204
|
commandPick.label;
|
|
179
205
|
return {
|
|
180
206
|
...commandPick,
|
|
@@ -194,7 +220,12 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
194
220
|
}
|
|
195
221
|
catch (error) {
|
|
196
222
|
if (!isCancellationError(error)) {
|
|
197
|
-
this.dialogService.error(
|
|
223
|
+
this.dialogService.error(( localizeWithPath(
|
|
224
|
+
'vs/platform/quickinput/browser/commandsQuickAccess',
|
|
225
|
+
'canNotRun',
|
|
226
|
+
"Command '{0}' resulted in an error",
|
|
227
|
+
commandPick.label
|
|
228
|
+
)), toErrorMessage(error));
|
|
198
229
|
}
|
|
199
230
|
}
|
|
200
231
|
}
|
|
@@ -46,7 +46,13 @@ let HelpQuickAccessProvider = class HelpQuickAccessProvider {
|
|
|
46
46
|
prefix,
|
|
47
47
|
label,
|
|
48
48
|
keybinding: helpEntry.commandId ? this.keybindingService.lookupKeybinding(helpEntry.commandId) : undefined,
|
|
49
|
-
ariaLabel: localizeWithPath(
|
|
49
|
+
ariaLabel: ( localizeWithPath(
|
|
50
|
+
'vs/platform/quickinput/browser/helpQuickAccess',
|
|
51
|
+
'helpPickAriaLabel',
|
|
52
|
+
"{0}, {1}",
|
|
53
|
+
label,
|
|
54
|
+
helpEntry.description
|
|
55
|
+
)),
|
|
50
56
|
description: helpEntry.description
|
|
51
57
|
};
|
|
52
58
|
}));
|
|
@@ -29,7 +29,7 @@ class AbstractRequestService extends Disposable {
|
|
|
29
29
|
super();
|
|
30
30
|
this.counter = 0;
|
|
31
31
|
this.logger = loggerService.createLogger('network', {
|
|
32
|
-
name: localizeWithPath('vs/platform/request/common/request', 'request', "Network Requests"),
|
|
32
|
+
name: ( localizeWithPath('vs/platform/request/common/request', 'request', "Network Requests")),
|
|
33
33
|
when: ( CONTEXT_LOG_LEVEL.isEqualTo(LogLevelToString(LogLevel.Trace))).serialize()
|
|
34
34
|
});
|
|
35
35
|
}
|