@codingame/monaco-vscode-api 1.82.6 → 1.83.0-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/api.js +5 -5
- package/assets/index-no-csp.html +2 -1
- package/assets/index.html +3 -2
- package/extensions.js +17 -14
- package/external/xterm/typings/xterm.d.ts +171 -109
- package/missing-services.js +33 -22
- package/monaco-editor-treemending.patch +1745 -1628
- package/monaco-treemending.js +2 -2
- package/monaco.js +2 -2
- package/package.json +2 -2
- package/service-override/extensions.js +10 -11
- package/services.d.ts +1 -1
- package/vscode/src/vs/base/browser/ui/menu/menubar.js +1 -1
- package/vscode/src/vs/base/common/event.d.ts +13 -17
- package/vscode/src/vs/base/common/keyCodes.d.ts +18 -18
- package/vscode/src/vs/base/common/lifecycle.d.ts +9 -0
- package/vscode/src/vs/base/common/observableInternal/base.d.ts +2 -0
- package/vscode/src/vs/base/common/product.d.ts +1 -0
- package/vscode/src/vs/base/parts/ipc/common/ipc.js +6 -2
- package/vscode/src/vs/base/parts/storage/common/storage.d.ts +1 -0
- package/vscode/src/vs/editor/common/config/editorOptions.d.ts +12 -3
- package/vscode/src/vs/editor/common/core/lineRange.d.ts +0 -5
- package/vscode/src/vs/editor/common/core/offsetRange.d.ts +9 -2
- package/vscode/src/vs/editor/common/diff/documentDiffProvider.d.ts +6 -20
- package/vscode/src/vs/editor/common/diff/legacyLinesDiffComputer.d.ts +2 -2
- package/vscode/src/vs/editor/common/diff/linesDiffComputer.d.ts +5 -55
- package/vscode/src/vs/editor/common/diff/rangeMapping.d.ts +55 -0
- package/vscode/src/vs/editor/common/languages.d.ts +7 -10
- package/vscode/src/vs/editor/common/model.d.ts +1 -1
- package/vscode/src/vs/platform/actions/common/actions.d.ts +1 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionNls.js +5 -5
- package/vscode/src/vs/platform/files/common/fileService.js +46 -40
- package/vscode/src/vs/platform/files/common/files.d.ts +46 -1
- package/vscode/src/vs/platform/files/common/inMemoryFilesystemProvider.js +45 -0
- package/vscode/src/vs/platform/storage/common/storage.d.ts +5 -0
- package/vscode/src/vs/platform/storage/common/storage.js +4 -0
- package/vscode/src/vs/platform/telemetry/common/telemetryUtils.js +4 -1
- package/vscode/src/vs/platform/terminal/common/terminal.js +1 -3
- package/vscode/src/vs/platform/tunnel/common/tunnel.d.ts +1 -1
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.d.ts +1 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +11 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents.js +50 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSlashCommands.js +3 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +16 -11
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +20 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +8 -8
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +3 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +93 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +3 -166
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +3 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +18 -11
- package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +14 -9
- package/vscode/src/vs/workbench/api/common/extHost.protocol.js +2 -1
- package/vscode/src/vs/workbench/api/common/extHostApiCommands.js +11 -2
- package/vscode/src/vs/workbench/api/common/extHostChat.js +10 -1
- package/vscode/src/vs/workbench/api/common/extHostChatAgents.js +62 -0
- package/vscode/src/vs/workbench/api/common/extHostChatSlashCommand.js +13 -4
- package/vscode/src/vs/workbench/api/common/extHostCommands.js +4 -4
- package/vscode/src/vs/workbench/api/common/extHostComments.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +36 -4
- package/vscode/src/vs/workbench/api/common/extHostInlineChat.js +6 -29
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +24 -12
- package/vscode/src/vs/workbench/api/common/extHostNotebookKernels.js +0 -2
- package/vscode/src/vs/workbench/api/common/extHostRequireInterceptor.js +0 -63
- package/vscode/src/vs/workbench/api/common/extHostSCM.js +80 -0
- package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +24 -0
- package/vscode/src/vs/workbench/api/common/extHostTesting.js +14 -10
- package/vscode/src/vs/workbench/api/common/extHostTextEditor.js +4 -4
- package/vscode/src/vs/workbench/api/common/extHostTreeViews.js +11 -7
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +34 -16
- package/vscode/src/vs/workbench/api/common/extHostTypes.js +31 -13
- package/vscode/src/vs/workbench/api/common/extHostWebview.js +14 -2
- package/vscode/src/vs/workbench/api/common/extHostWebviewPanels.js +11 -5
- package/vscode/src/vs/workbench/api/common/extensionHostMain.js +1 -1
- package/vscode/src/vs/workbench/browser/actions/layoutActions.js +32 -9
- package/vscode/src/vs/workbench/browser/actions/quickAccessActions.js +3 -1
- package/vscode/src/vs/workbench/browser/codeeditor.js +1 -1
- package/vscode/src/vs/workbench/browser/dnd.js +7 -6
- package/vscode/src/vs/workbench/browser/media/part.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +7 -10
- package/vscode/src/vs/workbench/browser/parts/editor/editor.js +7 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editorActions.js +9 -3
- package/vscode/src/vs/workbench/browser/parts/editor/editorAutoSave.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +9 -2
- package/vscode/src/vs/workbench/browser/parts/editor/editorStatus.js +44 -14
- package/vscode/src/vs/workbench/browser/parts/editor/media/editorplaceholder.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/textDiffEditor.js +3 -19
- package/vscode/src/vs/workbench/browser/parts/editor/textResourceEditor.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCommands.js +9 -3
- package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarPart.d.ts +1 -1
- package/vscode/src/vs/workbench/browser/parts/titlebar/menubarControl.js +10 -9
- package/vscode/src/vs/workbench/browser/parts/views/viewFilter.js +2 -0
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js +6 -5
- package/vscode/src/vs/workbench/browser/web.api.d.ts +0 -6
- package/vscode/src/vs/workbench/browser/workbench.contribution.js +34 -3
- package/vscode/src/vs/workbench/common/contextkeys.js +2 -1
- package/vscode/src/vs/workbench/common/editor/editorGroupModel.js +4 -4
- package/vscode/src/vs/workbench/common/editor/editorInput.d.ts +0 -1
- package/vscode/src/vs/workbench/common/editor/editorInput.js +2 -4
- package/vscode/src/vs/workbench/common/editor/editorModel.d.ts +0 -1
- package/vscode/src/vs/workbench/common/editor/editorModel.js +1 -3
- package/vscode/src/vs/workbench/common/editor.d.ts +2 -0
- package/vscode/src/vs/workbench/common/theme.js +21 -1
- package/vscode/src/vs/workbench/common/views.d.ts +1 -1
- package/vscode/src/vs/workbench/common/views.js +1 -2
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +12 -4
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityContributions.js +335 -0
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleView.js +81 -27
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.js +1 -1
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkTextEdits.js +22 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +2 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.js +136 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +14 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +78 -1
- package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +43 -17
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +30 -26
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/largeFileOptimizations.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.js +23 -18
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +8 -8
- package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +55 -20
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +26 -10
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +7 -6
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +58 -9
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +9 -6
- package/vscode/src/vs/workbench/contrib/comments/browser/comments.contribution.js +171 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +204 -33
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +3 -7
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +2 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/simpleCommentEditor.js +21 -4
- package/vscode/src/vs/workbench/contrib/comments/common/commentContextKeys.js +22 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debug.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/debug/common/debugUtils.js +2 -1
- package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/fileImportExport.js +2 -2
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.js +7 -4
- package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +2 -1
- package/vscode/src/vs/workbench/contrib/files/common/files.js +7 -5
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +2 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +2 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +17 -17
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +4 -1
- package/vscode/src/vs/workbench/contrib/output/browser/output.contribution.js +22 -19
- package/vscode/src/vs/workbench/contrib/output/browser/outputServices.js +2 -38
- package/vscode/src/vs/workbench/contrib/preferences/common/preferences.js +14 -1
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +3 -8
- package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +10 -12
- package/vscode/src/vs/workbench/contrib/snippets/browser/tabCompletion.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalContextKey.js +0 -16
- package/vscode/src/vs/workbench/contrib/testing/common/observableValue.js +2 -1
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +8 -6
- package/vscode/src/vs/workbench/services/actions/common/menusExtensionPoint.js +2 -4
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +2 -4
- package/vscode/src/vs/workbench/services/decorations/browser/decorationsService.js +7 -3
- package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.d.ts +2 -6
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +18 -20
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +9 -13
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.d.ts +2 -1
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +47 -15
- package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.d.ts +14 -4
- package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.js +22 -3
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +15 -14
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostProtocol.d.ts +12 -7
- package/vscode/src/vs/workbench/services/extensions/common/extensions.d.ts +10 -6
- package/vscode/src/vs/workbench/services/extensions/common/extensions.js +27 -11
- package/vscode/src/vs/workbench/services/extensions/common/extensionsApiProposals.js +2 -5
- package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +7 -11
- package/vscode/src/vs/workbench/services/extensions/common/rpcProtocol.js +20 -4
- package/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.js +24 -16
- package/vscode/src/vs/workbench/services/output/common/output.js +1 -2
- package/vscode/src/vs/workbench/services/preferences/common/preferences.d.ts +6 -6
- package/vscode/src/vs/workbench/services/preferences/common/preferences.js +4 -3
- package/vscode/src/vs/workbench/services/preferences/common/preferencesModels.d.ts +0 -1
- package/vscode/src/vs/workbench/services/search/common/fileSearchManager.js +3 -1
- package/vscode/src/vs/workbench/services/search/common/search.js +2 -1
- package/vscode/src/vs/workbench/services/search/common/textSearchManager.js +1 -2
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +2 -2
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileService.js +3 -8
- package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +3 -4
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant.js +1 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyBackupService.js +2 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyService.js +4 -2
- package/vscode/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.contribution.js +0 -180
- package/vscode/src/vs/platform/credentials/common/credentials.d.ts +0 -13
- package/vscode/src/vs/platform/credentials/common/credentials.js +0 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadKeytar.js +0 -31
- package/vscode/src/vs/workbench/browser/iframe.js +0 -16
- package/vscode/src/vs/workbench/browser/parts/editor/accessibilityStatus.js +0 -90
- package/vscode/src/vs/workbench/browser/parts/editor/tabFocus.js +0 -77
- package/vscode/src/vs/workbench/contrib/output/browser/logViewer.js +0 -67
|
@@ -2,10 +2,9 @@ import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
|
2
2
|
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
3
3
|
import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
4
4
|
import { Disposable, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
5
|
-
import { getOrSet } from 'monaco-editor/esm/vs/base/common/map.js';
|
|
5
|
+
import { getOrSet, SetMap } from 'monaco-editor/esm/vs/base/common/map.js';
|
|
6
6
|
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
7
7
|
import { flatten } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
8
|
-
import { SetMap } from 'monaco-editor/esm/vs/base/common/collections.js';
|
|
9
8
|
import { mixin } from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
10
9
|
import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
|
|
11
10
|
import { registerIcon } from 'monaco-editor/esm/vs/platform/theme/common/iconRegistry.js';
|
|
@@ -8,6 +8,7 @@ const accessibleViewIsShown = ( new RawContextKey('accessibleViewIsShown', false
|
|
|
8
8
|
const accessibleViewSupportsNavigation = ( new RawContextKey('accessibleViewSupportsNavigation', false, true));
|
|
9
9
|
const accessibleViewVerbosityEnabled = ( new RawContextKey('accessibleViewVerbosityEnabled', false, true));
|
|
10
10
|
const accessibleViewGoToSymbolSupported = ( new RawContextKey('accessibleViewGoToSymbolSupported', false, true));
|
|
11
|
+
const accessibleViewOnLastLine = ( new RawContextKey('accessibleViewOnLastLine', false, true));
|
|
11
12
|
const accessibleViewCurrentProviderId = ( new RawContextKey('accessibleViewCurrentProviderId', undefined, undefined));
|
|
12
13
|
const baseProperty = {
|
|
13
14
|
type: 'boolean',
|
|
@@ -82,10 +83,17 @@ const configuration = {
|
|
|
82
83
|
)),
|
|
83
84
|
...baseProperty
|
|
84
85
|
},
|
|
85
|
-
["accessibility.verbosity.
|
|
86
|
+
["accessibility.verbosity.emptyEditorHint" ]: {
|
|
86
87
|
description: ( localize(
|
|
87
|
-
'verbosity.
|
|
88
|
-
'Provide information about relevant actions in an
|
|
88
|
+
'verbosity.emptyEditorHint',
|
|
89
|
+
'Provide information about relevant actions in an empty text editor.'
|
|
90
|
+
)),
|
|
91
|
+
...baseProperty
|
|
92
|
+
},
|
|
93
|
+
["accessibility.verbosity.comments" ]: {
|
|
94
|
+
description: ( localize(
|
|
95
|
+
'verbosity.comments',
|
|
96
|
+
'Provide information about actions that can be taken in the comment widget or in a file which contains comments.'
|
|
89
97
|
)),
|
|
90
98
|
...baseProperty
|
|
91
99
|
}
|
|
@@ -123,4 +131,4 @@ function registerAccessibilityConfiguration() {
|
|
|
123
131
|
}
|
|
124
132
|
});
|
|
125
133
|
}
|
|
126
|
-
export { accessibilityHelpIsShown, accessibleViewCurrentProviderId, accessibleViewGoToSymbolSupported, accessibleViewIsShown, accessibleViewSupportsNavigation, accessibleViewVerbosityEnabled, registerAccessibilityConfiguration };
|
|
134
|
+
export { accessibilityHelpIsShown, accessibleViewCurrentProviderId, accessibleViewGoToSymbolSupported, accessibleViewIsShown, accessibleViewOnLastLine, accessibleViewSupportsNavigation, accessibleViewVerbosityEnabled, registerAccessibilityConfiguration };
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
+
import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
|
|
4
|
+
import { AccessibilityHelpNLS } from 'monaco-editor/esm/vs/editor/common/standaloneStrings.js';
|
|
5
|
+
import { ToggleTabFocusModeAction } from 'monaco-editor/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js';
|
|
6
|
+
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
7
|
+
import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
|
|
8
|
+
import { accessibleViewIsShown } from './accessibilityConfiguration.js';
|
|
9
|
+
import * as strings from 'monaco-editor/esm/vs/base/common/strings.js';
|
|
10
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
11
|
+
import { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
12
|
+
import { NEW_UNTITLED_FILE_COMMAND_ID } from '../../files/browser/fileConstants.js';
|
|
13
|
+
import { ModesHoverController } from 'monaco-editor/esm/vs/editor/contrib/hover/browser/hover.js';
|
|
14
|
+
import { IContextViewService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
|
|
15
|
+
import { EditorContextKeys } from 'monaco-editor/esm/vs/editor/common/editorContextKeys.js';
|
|
16
|
+
import { getNotificationFromContext } from '../../../browser/parts/notifications/notificationsCommands.js';
|
|
17
|
+
import { IListService, WorkbenchList } from 'monaco-editor/esm/vs/platform/list/browser/listService.js';
|
|
18
|
+
import { NotificationFocusedContext } from '../../../common/contextkeys.js';
|
|
19
|
+
import { IAccessibleViewService } from './accessibleView.js';
|
|
20
|
+
import { IHoverService } from '../../../services/hover/browser/hover.js';
|
|
21
|
+
import { alert } from 'monaco-editor/esm/vs/base/browser/ui/aria/aria.js';
|
|
22
|
+
import { AccessibilityHelpAction, AccessibleViewAction } from './accessibleViewActions.js';
|
|
23
|
+
import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
|
|
24
|
+
import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
|
|
25
|
+
import { InlineCompletionsController } from 'monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController.js';
|
|
26
|
+
import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
27
|
+
import { CommentContextKeys } from '../../comments/common/commentContextKeys.js';
|
|
28
|
+
import { CommentAccessibilityHelpNLS } from '../../comments/browser/comments.contribution.js';
|
|
29
|
+
class EditorAccessibilityHelpContribution extends Disposable {
|
|
30
|
+
constructor() {
|
|
31
|
+
super();
|
|
32
|
+
this._register(AccessibilityHelpAction.addImplementation(95, 'editor', async (accessor) => {
|
|
33
|
+
const codeEditorService = accessor.get(ICodeEditorService);
|
|
34
|
+
const accessibleViewService = accessor.get(IAccessibleViewService);
|
|
35
|
+
const instantiationService = accessor.get(IInstantiationService);
|
|
36
|
+
const commandService = accessor.get(ICommandService);
|
|
37
|
+
let codeEditor = codeEditorService.getActiveCodeEditor() || codeEditorService.getFocusedCodeEditor();
|
|
38
|
+
if (!codeEditor) {
|
|
39
|
+
await commandService.executeCommand(NEW_UNTITLED_FILE_COMMAND_ID);
|
|
40
|
+
codeEditor = codeEditorService.getActiveCodeEditor();
|
|
41
|
+
}
|
|
42
|
+
accessibleViewService.show(instantiationService.createInstance(EditorAccessibilityHelpProvider, codeEditor));
|
|
43
|
+
}, EditorContextKeys.focus));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
let EditorAccessibilityHelpProvider = class EditorAccessibilityHelpProvider {
|
|
47
|
+
onClose() {
|
|
48
|
+
this._editor.focus();
|
|
49
|
+
}
|
|
50
|
+
constructor(_editor, _keybindingService, _contextKeyService) {
|
|
51
|
+
this._editor = _editor;
|
|
52
|
+
this._keybindingService = _keybindingService;
|
|
53
|
+
this._contextKeyService = _contextKeyService;
|
|
54
|
+
this.options = { type: "help" , readMoreUrl: 'https://go.microsoft.com/fwlink/?linkid=851010' };
|
|
55
|
+
this.verbositySettingKey = "accessibility.verbosity.editor" ;
|
|
56
|
+
}
|
|
57
|
+
provideContent() {
|
|
58
|
+
const options = this._editor.getOptions();
|
|
59
|
+
const content = [];
|
|
60
|
+
if (options.get(61 )) {
|
|
61
|
+
if (options.get(90 )) {
|
|
62
|
+
content.push(AccessibilityHelpNLS.readonlyDiffEditor);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
content.push(AccessibilityHelpNLS.editableDiffEditor);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
if (options.get(90 )) {
|
|
70
|
+
content.push(AccessibilityHelpNLS.readonlyEditor);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
content.push(AccessibilityHelpNLS.editableEditor);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const commentCommandInfo = getCommentCommandInfo(this._keybindingService, this._contextKeyService, this._editor);
|
|
77
|
+
if (commentCommandInfo) {
|
|
78
|
+
content.push(commentCommandInfo);
|
|
79
|
+
}
|
|
80
|
+
if (options.get(114 ).enabled) {
|
|
81
|
+
content.push(descriptionForCommand('editor.action.focusStickyScroll', AccessibilityHelpNLS.stickScrollKb, AccessibilityHelpNLS.stickScrollNoKb, this._keybindingService));
|
|
82
|
+
}
|
|
83
|
+
if (options.get(142 )) {
|
|
84
|
+
content.push(descriptionForCommand(ToggleTabFocusModeAction.ID, AccessibilityHelpNLS.tabFocusModeOnMsg, AccessibilityHelpNLS.tabFocusModeOnMsgNoKb, this._keybindingService));
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
content.push(descriptionForCommand(ToggleTabFocusModeAction.ID, AccessibilityHelpNLS.tabFocusModeOffMsg, AccessibilityHelpNLS.tabFocusModeOffMsgNoKb, this._keybindingService));
|
|
88
|
+
}
|
|
89
|
+
return content.join('\n\n');
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
EditorAccessibilityHelpProvider = ( __decorate([
|
|
93
|
+
( __param(1, IKeybindingService)),
|
|
94
|
+
( __param(2, IContextKeyService))
|
|
95
|
+
], EditorAccessibilityHelpProvider));
|
|
96
|
+
function getCommentCommandInfo(keybindingService, contextKeyService, editor) {
|
|
97
|
+
const editorContext = contextKeyService.getContext(editor.getDomNode());
|
|
98
|
+
if (editorContext.getValue(CommentContextKeys.activeEditorHasCommentingRange.key)) {
|
|
99
|
+
const commentCommandInfo = [];
|
|
100
|
+
commentCommandInfo.push(CommentAccessibilityHelpNLS.intro);
|
|
101
|
+
commentCommandInfo.push(descriptionForCommand("workbench.action.addComment" , CommentAccessibilityHelpNLS.addComment, CommentAccessibilityHelpNLS.addCommentNoKb, keybindingService));
|
|
102
|
+
commentCommandInfo.push(descriptionForCommand("editor.action.nextCommentThreadAction" , CommentAccessibilityHelpNLS.nextCommentThreadKb, CommentAccessibilityHelpNLS.nextCommentThreadNoKb, keybindingService));
|
|
103
|
+
commentCommandInfo.push(descriptionForCommand("editor.action.previousCommentThreadAction" , CommentAccessibilityHelpNLS.previousCommentThreadKb, CommentAccessibilityHelpNLS.previousCommentThreadNoKb, keybindingService));
|
|
104
|
+
commentCommandInfo.push(descriptionForCommand("editor.action.nextCommentingRange" , CommentAccessibilityHelpNLS.nextRange, CommentAccessibilityHelpNLS.nextRangeNoKb, keybindingService));
|
|
105
|
+
commentCommandInfo.push(descriptionForCommand("editor.action.previousCommentingRange" , CommentAccessibilityHelpNLS.previousRange, CommentAccessibilityHelpNLS.previousRangeNoKb, keybindingService));
|
|
106
|
+
return commentCommandInfo.join('\n');
|
|
107
|
+
}
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
function descriptionForCommand(commandId, msg, noKbMsg, keybindingService) {
|
|
111
|
+
const kb = keybindingService.lookupKeybinding(commandId);
|
|
112
|
+
if (kb) {
|
|
113
|
+
return strings.format(msg, kb.getAriaLabel());
|
|
114
|
+
}
|
|
115
|
+
return strings.format(noKbMsg, commandId);
|
|
116
|
+
}
|
|
117
|
+
class HoverAccessibleViewContribution extends Disposable {
|
|
118
|
+
constructor() {
|
|
119
|
+
super();
|
|
120
|
+
this._options = { language: 'typescript', type: "view" };
|
|
121
|
+
this._register(AccessibleViewAction.addImplementation(95, 'hover', accessor => {
|
|
122
|
+
const accessibleViewService = accessor.get(IAccessibleViewService);
|
|
123
|
+
const codeEditorService = accessor.get(ICodeEditorService);
|
|
124
|
+
const editor = codeEditorService.getActiveCodeEditor() || codeEditorService.getFocusedCodeEditor();
|
|
125
|
+
const editorHoverContent = editor ? ModesHoverController.get(editor)?.getWidgetContent() ?? undefined : undefined;
|
|
126
|
+
if (!editor || !editorHoverContent) {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
this._options.language = editor?.getModel()?.getLanguageId() ?? undefined;
|
|
130
|
+
accessibleViewService.show({
|
|
131
|
+
verbositySettingKey: "accessibility.verbosity.hover" ,
|
|
132
|
+
provideContent() { return editorHoverContent; },
|
|
133
|
+
onClose() {
|
|
134
|
+
ModesHoverController.get(editor)?.focus();
|
|
135
|
+
},
|
|
136
|
+
options: this._options
|
|
137
|
+
});
|
|
138
|
+
return true;
|
|
139
|
+
}, EditorContextKeys.hoverFocused));
|
|
140
|
+
this._register(AccessibleViewAction.addImplementation(90, 'extension-hover', accessor => {
|
|
141
|
+
const accessibleViewService = accessor.get(IAccessibleViewService);
|
|
142
|
+
const contextViewService = accessor.get(IContextViewService);
|
|
143
|
+
const contextViewElement = contextViewService.getContextViewElement();
|
|
144
|
+
const extensionHoverContent = contextViewElement?.textContent ?? undefined;
|
|
145
|
+
const hoverService = accessor.get(IHoverService);
|
|
146
|
+
if (contextViewElement.classList.contains('accessible-view-container') || !extensionHoverContent) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
accessibleViewService.show({
|
|
150
|
+
verbositySettingKey: "accessibility.verbosity.hover" ,
|
|
151
|
+
provideContent() { return extensionHoverContent; },
|
|
152
|
+
onClose() {
|
|
153
|
+
hoverService.showAndFocusLastHover();
|
|
154
|
+
},
|
|
155
|
+
options: this._options
|
|
156
|
+
});
|
|
157
|
+
return true;
|
|
158
|
+
}));
|
|
159
|
+
this._register(AccessibilityHelpAction.addImplementation(115, 'accessible-view', accessor => {
|
|
160
|
+
accessor.get(IAccessibleViewService).showAccessibleViewHelp();
|
|
161
|
+
return true;
|
|
162
|
+
}, accessibleViewIsShown));
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
class NotificationAccessibleViewContribution extends Disposable {
|
|
166
|
+
constructor() {
|
|
167
|
+
super();
|
|
168
|
+
this._register(AccessibleViewAction.addImplementation(90, 'notifications', accessor => {
|
|
169
|
+
const accessibleViewService = accessor.get(IAccessibleViewService);
|
|
170
|
+
const listService = accessor.get(IListService);
|
|
171
|
+
const commandService = accessor.get(ICommandService);
|
|
172
|
+
function renderAccessibleView() {
|
|
173
|
+
const notification = getNotificationFromContext(listService);
|
|
174
|
+
if (!notification) {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
commandService.executeCommand('notifications.showList');
|
|
178
|
+
let notificationIndex;
|
|
179
|
+
let length;
|
|
180
|
+
const list = listService.lastFocusedList;
|
|
181
|
+
if (list instanceof WorkbenchList) {
|
|
182
|
+
notificationIndex = list.indexOf(notification);
|
|
183
|
+
length = list.length;
|
|
184
|
+
}
|
|
185
|
+
if (notificationIndex === undefined) {
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
function focusList() {
|
|
189
|
+
commandService.executeCommand('notifications.showList');
|
|
190
|
+
if (list && notificationIndex !== undefined) {
|
|
191
|
+
list.domFocus();
|
|
192
|
+
try {
|
|
193
|
+
list.setFocus([notificationIndex]);
|
|
194
|
+
}
|
|
195
|
+
catch { }
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
const message = ( notification.message.original.toString());
|
|
199
|
+
if (!message) {
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
202
|
+
notification.onDidClose(() => accessibleViewService.next());
|
|
203
|
+
accessibleViewService.show({
|
|
204
|
+
provideContent: () => {
|
|
205
|
+
return notification.source ? ( localize(
|
|
206
|
+
'notification.accessibleViewSrc',
|
|
207
|
+
'{0} Source: {1}',
|
|
208
|
+
message,
|
|
209
|
+
notification.source
|
|
210
|
+
)) : ( localize('notification.accessibleView', '{0}', message));
|
|
211
|
+
},
|
|
212
|
+
onClose() {
|
|
213
|
+
focusList();
|
|
214
|
+
},
|
|
215
|
+
next() {
|
|
216
|
+
if (!list) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
focusList();
|
|
220
|
+
list.focusNext();
|
|
221
|
+
alertFocusChange(notificationIndex, length, 'next');
|
|
222
|
+
renderAccessibleView();
|
|
223
|
+
},
|
|
224
|
+
previous() {
|
|
225
|
+
if (!list) {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
focusList();
|
|
229
|
+
list.focusPrevious();
|
|
230
|
+
alertFocusChange(notificationIndex, length, 'previous');
|
|
231
|
+
renderAccessibleView();
|
|
232
|
+
},
|
|
233
|
+
verbositySettingKey: "accessibility.verbosity.notification" ,
|
|
234
|
+
options: { type: "view" },
|
|
235
|
+
actions: getActionsFromNotification(notification)
|
|
236
|
+
});
|
|
237
|
+
return true;
|
|
238
|
+
}
|
|
239
|
+
return renderAccessibleView();
|
|
240
|
+
}, NotificationFocusedContext));
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
function getActionsFromNotification(notification) {
|
|
244
|
+
let actions = undefined;
|
|
245
|
+
if (notification.actions) {
|
|
246
|
+
actions = [];
|
|
247
|
+
if (notification.actions.primary) {
|
|
248
|
+
actions.push(...notification.actions.primary);
|
|
249
|
+
}
|
|
250
|
+
if (notification.actions.secondary) {
|
|
251
|
+
actions.push(...notification.actions.secondary);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
if (actions) {
|
|
255
|
+
for (const action of actions) {
|
|
256
|
+
action.class = ThemeIcon.asClassName(Codicon.bell);
|
|
257
|
+
const initialAction = action.run;
|
|
258
|
+
action.run = () => {
|
|
259
|
+
initialAction();
|
|
260
|
+
notification.close();
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
const manageExtension = actions?.find(a => a.label.includes('Manage Extension'));
|
|
265
|
+
if (manageExtension) {
|
|
266
|
+
manageExtension.class = ThemeIcon.asClassName(Codicon.gear);
|
|
267
|
+
}
|
|
268
|
+
if (actions) {
|
|
269
|
+
actions.push({ id: 'clearNotification', label: ( localize('clearNotification', "Clear Notification")), tooltip: ( localize('clearNotification', "Clear Notification")), run: () => notification.close(), enabled: true, class: ThemeIcon.asClassName(Codicon.clearAll) });
|
|
270
|
+
}
|
|
271
|
+
return actions;
|
|
272
|
+
}
|
|
273
|
+
function alertFocusChange(index, length, type) {
|
|
274
|
+
if (index === undefined || length === undefined) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
const number = index + 1;
|
|
278
|
+
if (type === 'next' && number + 1 <= length) {
|
|
279
|
+
alert(`Focused ${number + 1} of ${length}`);
|
|
280
|
+
}
|
|
281
|
+
else if (type === 'previous' && number - 1 > 0) {
|
|
282
|
+
alert(`Focused ${number - 1} of ${length}`);
|
|
283
|
+
}
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
class InlineCompletionsAccessibleViewContribution extends Disposable {
|
|
287
|
+
constructor() {
|
|
288
|
+
super();
|
|
289
|
+
this._options = { type: "view" };
|
|
290
|
+
this._register(AccessibleViewAction.addImplementation(95, 'inline-completions', accessor => {
|
|
291
|
+
const accessibleViewService = accessor.get(IAccessibleViewService);
|
|
292
|
+
const codeEditorService = accessor.get(ICodeEditorService);
|
|
293
|
+
const show = () => {
|
|
294
|
+
const editor = codeEditorService.getActiveCodeEditor() || codeEditorService.getFocusedCodeEditor();
|
|
295
|
+
if (!editor) {
|
|
296
|
+
return false;
|
|
297
|
+
}
|
|
298
|
+
const model = InlineCompletionsController.get(editor)?.model.get();
|
|
299
|
+
const state = model?.state.get();
|
|
300
|
+
if (!model || !state) {
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
303
|
+
const lineText = model.textModel.getLineContent(state.ghostText.lineNumber);
|
|
304
|
+
if (!lineText) {
|
|
305
|
+
return false;
|
|
306
|
+
}
|
|
307
|
+
const ghostText = state.ghostText.renderForScreenReader(lineText);
|
|
308
|
+
if (!ghostText) {
|
|
309
|
+
return false;
|
|
310
|
+
}
|
|
311
|
+
this._options.language = editor.getModel()?.getLanguageId() ?? undefined;
|
|
312
|
+
accessibleViewService.show({
|
|
313
|
+
verbositySettingKey: "accessibility.verbosity.inlineCompletions" ,
|
|
314
|
+
provideContent() { return lineText + ghostText; },
|
|
315
|
+
onClose() {
|
|
316
|
+
model.stop();
|
|
317
|
+
editor.focus();
|
|
318
|
+
},
|
|
319
|
+
next() {
|
|
320
|
+
model.next();
|
|
321
|
+
setTimeout(() => show(), 50);
|
|
322
|
+
},
|
|
323
|
+
previous() {
|
|
324
|
+
model.previous();
|
|
325
|
+
setTimeout(() => show(), 50);
|
|
326
|
+
},
|
|
327
|
+
options: this._options
|
|
328
|
+
});
|
|
329
|
+
return true;
|
|
330
|
+
};
|
|
331
|
+
return show();
|
|
332
|
+
}));
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
export { EditorAccessibilityHelpContribution, HoverAccessibleViewContribution, InlineCompletionsAccessibleViewContribution, NotificationAccessibleViewContribution, alertFocusChange, getCommentCommandInfo };
|
|
@@ -10,6 +10,7 @@ import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
|
|
|
10
10
|
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
11
11
|
import { EditorExtensionsRegistry } from 'monaco-editor/esm/vs/editor/browser/editorExtensions.js';
|
|
12
12
|
import { CodeEditorWidget } from 'monaco-editor/esm/vs/editor/browser/widget/codeEditorWidget.js';
|
|
13
|
+
import { Position } from 'monaco-editor/esm/vs/editor/common/core/position.js';
|
|
13
14
|
import { IModelService } from 'monaco-editor/esm/vs/editor/common/services/model.js';
|
|
14
15
|
import { AccessibilityHelpNLS } from 'monaco-editor/esm/vs/editor/common/standaloneStrings.js';
|
|
15
16
|
import { CodeActionController } from 'monaco-editor/esm/vs/editor/contrib/codeAction/browser/codeActionController.js';
|
|
@@ -26,7 +27,7 @@ import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/com
|
|
|
26
27
|
import { ILayoutService } from 'monaco-editor/esm/vs/platform/layout/browser/layoutService.js';
|
|
27
28
|
import { IOpenerService } from 'monaco-editor/esm/vs/platform/opener/common/opener.js';
|
|
28
29
|
import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
|
|
29
|
-
import { accessibilityHelpIsShown, accessibleViewIsShown, accessibleViewSupportsNavigation, accessibleViewVerbosityEnabled, accessibleViewGoToSymbolSupported, accessibleViewCurrentProviderId } from './accessibilityConfiguration.js';
|
|
30
|
+
import { accessibilityHelpIsShown, accessibleViewIsShown, accessibleViewSupportsNavigation, accessibleViewVerbosityEnabled, accessibleViewGoToSymbolSupported, accessibleViewCurrentProviderId, accessibleViewOnLastLine } from './accessibilityConfiguration.js';
|
|
30
31
|
import { getSimpleEditorOptions } from '../../codeEditor/browser/simpleEditorOptions.js';
|
|
31
32
|
const IAccessibleViewService = ( createDecorator('accessibleViewService'));
|
|
32
33
|
let AccessibleView = class AccessibleView extends Disposable {
|
|
@@ -49,6 +50,7 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
49
50
|
this._accessibleViewVerbosityEnabled = accessibleViewVerbosityEnabled.bindTo(this._contextKeyService);
|
|
50
51
|
this._accessibleViewGoToSymbolSupported = accessibleViewGoToSymbolSupported.bindTo(this._contextKeyService);
|
|
51
52
|
this._accessibleViewCurrentProviderId = accessibleViewCurrentProviderId.bindTo(this._contextKeyService);
|
|
53
|
+
this._onLastLine = accessibleViewOnLastLine.bindTo(this._contextKeyService);
|
|
52
54
|
this._container = document.createElement('div');
|
|
53
55
|
this._container.classList.add('accessible-view');
|
|
54
56
|
const codeEditorWidgetOptions = {
|
|
@@ -97,6 +99,9 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
97
99
|
}
|
|
98
100
|
}));
|
|
99
101
|
this._register(this._editorWidget.onDidDispose(() => this._resetContextKeys()));
|
|
102
|
+
this._register(this._editorWidget.onDidChangeCursorPosition(() => {
|
|
103
|
+
this._onLastLine.set(this._editorWidget.getPosition()?.lineNumber === this._editorWidget.getModel()?.getLineCount());
|
|
104
|
+
}));
|
|
100
105
|
}
|
|
101
106
|
_resetContextKeys() {
|
|
102
107
|
this._accessiblityHelpIsShown.reset();
|
|
@@ -106,7 +111,7 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
106
111
|
this._accessibleViewGoToSymbolSupported.reset();
|
|
107
112
|
this._accessibleViewCurrentProviderId.reset();
|
|
108
113
|
}
|
|
109
|
-
show(provider, symbol, showAccessibleViewHelp) {
|
|
114
|
+
show(provider, symbol, showAccessibleViewHelp, lineNumber) {
|
|
110
115
|
provider = provider ?? this._currentProvider;
|
|
111
116
|
if (!provider) {
|
|
112
117
|
return;
|
|
@@ -125,6 +130,12 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
125
130
|
}
|
|
126
131
|
};
|
|
127
132
|
this._contextViewService.showContextView(delegate);
|
|
133
|
+
if (lineNumber) {
|
|
134
|
+
setTimeout(() => {
|
|
135
|
+
this._editorWidget.revealLine(lineNumber);
|
|
136
|
+
this._editorWidget.setSelection({ startLineNumber: lineNumber, startColumn: 1, endLineNumber: lineNumber, endColumn: 1 });
|
|
137
|
+
}, 50);
|
|
138
|
+
}
|
|
128
139
|
if (symbol && this._currentProvider) {
|
|
129
140
|
this.showSymbol(this._currentProvider, symbol);
|
|
130
141
|
}
|
|
@@ -151,11 +162,21 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
151
162
|
if (!this._currentProvider || !this._currentContent) {
|
|
152
163
|
return;
|
|
153
164
|
}
|
|
154
|
-
const
|
|
155
|
-
if (
|
|
165
|
+
const symbols = this._currentProvider.getSymbols?.() || [];
|
|
166
|
+
if (symbols?.length) {
|
|
167
|
+
return symbols;
|
|
168
|
+
}
|
|
169
|
+
if (this._currentProvider.options.language && this._currentProvider.options.language !== 'markdown') {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
const markdownTokens = marked.lexer(this._currentContent);
|
|
173
|
+
if (!markdownTokens) {
|
|
156
174
|
return;
|
|
157
175
|
}
|
|
158
|
-
|
|
176
|
+
this._convertTokensToSymbols(markdownTokens, symbols);
|
|
177
|
+
return symbols.length ? symbols : undefined;
|
|
178
|
+
}
|
|
179
|
+
_convertTokensToSymbols(tokens, symbols) {
|
|
159
180
|
let firstListItem;
|
|
160
181
|
for (const token of tokens) {
|
|
161
182
|
let label = undefined;
|
|
@@ -177,26 +198,31 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
177
198
|
}
|
|
178
199
|
}
|
|
179
200
|
}
|
|
180
|
-
else {
|
|
181
|
-
label = token.label;
|
|
182
|
-
}
|
|
183
201
|
if (label) {
|
|
184
|
-
symbols.push({
|
|
202
|
+
symbols.push({ markdownToParse: label, label: ( localize('symbolLabel', "({0}) {1}", token.type, label)), ariaLabel: ( localize('symbolLabelAria', "({0}) {1}", token.type, label)), firstListItem });
|
|
185
203
|
firstListItem = undefined;
|
|
186
204
|
}
|
|
187
205
|
}
|
|
188
|
-
return symbols;
|
|
189
206
|
}
|
|
190
207
|
showSymbol(provider, symbol) {
|
|
191
208
|
if (!this._currentContent) {
|
|
192
209
|
return;
|
|
193
210
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
this._editorWidget.setSelection({ startLineNumber: index + 1, startColumn: 1, endLineNumber: index + 1, endColumn: 1 });
|
|
211
|
+
let lineNumber = symbol.lineNumber;
|
|
212
|
+
const markdownToParse = symbol.markdownToParse;
|
|
213
|
+
if (lineNumber === undefined && markdownToParse === undefined) {
|
|
214
|
+
return;
|
|
199
215
|
}
|
|
216
|
+
if (lineNumber === undefined && markdownToParse) {
|
|
217
|
+
const index = this._currentContent.split('\n').findIndex(line => line.includes(markdownToParse.split('\n')[0]) || (symbol.firstListItem && line.includes(symbol.firstListItem))) ?? -1;
|
|
218
|
+
if (index >= 0) {
|
|
219
|
+
lineNumber = index + 1;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
if (lineNumber === undefined) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
this.show(provider, undefined, undefined, lineNumber);
|
|
200
226
|
this._updateContextKeys(provider, true);
|
|
201
227
|
}
|
|
202
228
|
disableHint() {
|
|
@@ -237,7 +263,7 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
237
263
|
const value = this._configurationService.getValue(provider.verbositySettingKey);
|
|
238
264
|
const readMoreLink = provider.options.readMoreUrl ? ( localize(
|
|
239
265
|
"openDoc",
|
|
240
|
-
"\n\
|
|
266
|
+
"\n\nOpen a browser window with more information related to accessibility (H)."
|
|
241
267
|
)) : '';
|
|
242
268
|
let disableHelpHint = '';
|
|
243
269
|
if (provider.options.type === "help" && !!value) {
|
|
@@ -258,7 +284,9 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
258
284
|
message += '\n';
|
|
259
285
|
}
|
|
260
286
|
}
|
|
261
|
-
|
|
287
|
+
const verbose = this._configurationService.getValue(provider.verbositySettingKey);
|
|
288
|
+
const exitThisDialogHint = verbose && !provider.options.positionBottom ? ( localize('exit', '\n\nExit this dialog (Escape).')) : '';
|
|
289
|
+
this._currentContent = message + provider.provideContent() + readMoreLink + disableHelpHint + exitThisDialogHint;
|
|
262
290
|
this._updateContextKeys(provider, true);
|
|
263
291
|
this._getTextModel(( URI.from(
|
|
264
292
|
{ path: `accessible-view-${provider.verbositySettingKey}`, scheme: 'accessible-view', fragment: this._currentContent }
|
|
@@ -277,9 +305,12 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
277
305
|
const verbose = this._configurationService.getValue(provider.verbositySettingKey);
|
|
278
306
|
const hasActions = this._accessibleViewSupportsNavigation.get() || this._accessibleViewVerbosityEnabled.get() || this._accessibleViewGoToSymbolSupported.get() || this._currentProvider?.actions;
|
|
279
307
|
if (verbose && !showAccessibleViewHelp && hasActions) {
|
|
280
|
-
actionsHint = ( localize(
|
|
308
|
+
actionsHint = provider.options.positionBottom ? ( localize(
|
|
309
|
+
'ariaAccessibleViewActionsBottom',
|
|
310
|
+
'Explore actions such as disabling this hint (Shift+Tab), use Escape to exit this dialog.'
|
|
311
|
+
)) : ( localize(
|
|
281
312
|
'ariaAccessibleViewActions',
|
|
282
|
-
|
|
313
|
+
'Explore actions such as disabling this hint (Shift+Tab).'
|
|
283
314
|
));
|
|
284
315
|
}
|
|
285
316
|
let ariaLabel = provider.options.type === "help" ? ( localize('accessibility-help', "Accessibility Help")) : ( localize('accessible-view', "Accessible View"));
|
|
@@ -292,6 +323,14 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
292
323
|
}
|
|
293
324
|
this._editorWidget.updateOptions({ ariaLabel });
|
|
294
325
|
this._editorWidget.focus();
|
|
326
|
+
if (this._currentProvider?.options.positionBottom) {
|
|
327
|
+
const lastLine = this.editorWidget.getModel()?.getLineCount();
|
|
328
|
+
const position = lastLine !== undefined && lastLine > 0 ? ( new Position(lastLine, 1)) : undefined;
|
|
329
|
+
if (position) {
|
|
330
|
+
this._editorWidget.setPosition(position);
|
|
331
|
+
this._editorWidget.revealLine(position.lineNumber);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
295
334
|
});
|
|
296
335
|
this._updateToolbar(provider.actions, provider.options.type);
|
|
297
336
|
const handleEscape = (e) => {
|
|
@@ -363,16 +402,17 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
363
402
|
if (!this._currentProvider) {
|
|
364
403
|
return false;
|
|
365
404
|
}
|
|
366
|
-
return this._currentProvider.options.type === "help" || this._currentProvider.options.language === 'markdown' || this._currentProvider.options.language === undefined || !!this._currentProvider.getSymbols;
|
|
405
|
+
return this._currentProvider.options.type === "help" || this._currentProvider.options.language === 'markdown' || this._currentProvider.options.language === undefined || !!this._currentProvider.getSymbols?.();
|
|
367
406
|
}
|
|
368
407
|
showAccessibleViewHelp() {
|
|
369
408
|
if (!this._currentProvider) {
|
|
370
409
|
return;
|
|
371
410
|
}
|
|
372
411
|
const currentProvider = Object.assign({}, this._currentProvider);
|
|
412
|
+
currentProvider.provideContent = this._currentProvider.provideContent.bind(currentProvider);
|
|
373
413
|
currentProvider.options = Object.assign({}, currentProvider.options);
|
|
374
414
|
const accessibleViewHelpProvider = {
|
|
375
|
-
provideContent: () => this._getAccessibleViewHelpDialogContent(this._goToSymbolsSupported()),
|
|
415
|
+
provideContent: () => currentProvider.options.customHelp ? currentProvider?.options.customHelp() : this._getAccessibleViewHelpDialogContent(this._goToSymbolsSupported()),
|
|
376
416
|
onClose: () => this.show(currentProvider),
|
|
377
417
|
options: { type: "help" },
|
|
378
418
|
verbositySettingKey: this._currentProvider.verbositySettingKey
|
|
@@ -383,7 +423,7 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
383
423
|
_getAccessibleViewHelpDialogContent(providerHasSymbols) {
|
|
384
424
|
const navigationHint = this._getNavigationHint();
|
|
385
425
|
const goToSymbolHint = this._getGoToSymbolHint(providerHasSymbols);
|
|
386
|
-
const toolbarHint = ( localize('toolbar', "Navigate to the toolbar (Shift+Tab))"));
|
|
426
|
+
const toolbarHint = ( localize('toolbar', "Navigate to the toolbar (Shift+Tab))."));
|
|
387
427
|
let hint = ( localize('intro', "In the accessible view, you can:\n"));
|
|
388
428
|
if (navigationHint) {
|
|
389
429
|
hint += ' - ' + navigationHint + '\n';
|
|
@@ -403,7 +443,7 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
403
443
|
if (nextKeybinding && previousKeybinding) {
|
|
404
444
|
hint = ( localize(
|
|
405
445
|
'accessibleViewNextPreviousHint',
|
|
406
|
-
"Show the next ({0}) or previous ({1}) item",
|
|
446
|
+
"Show the next ({0}) or previous ({1}) item.",
|
|
407
447
|
nextKeybinding,
|
|
408
448
|
previousKeybinding
|
|
409
449
|
));
|
|
@@ -411,7 +451,7 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
411
451
|
else {
|
|
412
452
|
hint = ( localize(
|
|
413
453
|
'chatAccessibleViewNextPreviousHintNoKb',
|
|
414
|
-
"Show the next or previous item by configuring keybindings for the Show Next & Previous in Accessible View commands"
|
|
454
|
+
"Show the next or previous item by configuring keybindings for the Show Next & Previous in Accessible View commands."
|
|
415
455
|
));
|
|
416
456
|
}
|
|
417
457
|
return hint;
|
|
@@ -425,14 +465,14 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
425
465
|
if (disableKeybinding) {
|
|
426
466
|
hint = ( localize(
|
|
427
467
|
'acessibleViewDisableHint',
|
|
428
|
-
"
|
|
468
|
+
"\n\nDisable accessibility verbosity for this feature ({0}).",
|
|
429
469
|
disableKeybinding
|
|
430
470
|
));
|
|
431
471
|
}
|
|
432
472
|
else {
|
|
433
473
|
hint = ( localize(
|
|
434
474
|
'accessibleViewDisableHintNoKb',
|
|
435
|
-
"
|
|
475
|
+
"\n\nAdd a keybinding for the command Disable Accessible View Hint, which disables accessibility verbosity for this feature.s"
|
|
436
476
|
));
|
|
437
477
|
}
|
|
438
478
|
return hint;
|
|
@@ -515,6 +555,20 @@ let AccessibleViewService = class AccessibleViewService extends Disposable {
|
|
|
515
555
|
showAccessibleViewHelp() {
|
|
516
556
|
this._accessibleView?.showAccessibleViewHelp();
|
|
517
557
|
}
|
|
558
|
+
getPosition() {
|
|
559
|
+
return this._accessibleView?.editorWidget.getPosition() ?? undefined;
|
|
560
|
+
}
|
|
561
|
+
getLastPosition() {
|
|
562
|
+
const lastLine = this._accessibleView?.editorWidget.getModel()?.getLineCount();
|
|
563
|
+
return lastLine !== undefined && lastLine > 0 ? ( new Position(lastLine, 1)) : undefined;
|
|
564
|
+
}
|
|
565
|
+
setPosition(position, reveal) {
|
|
566
|
+
const editorWidget = this._accessibleView?.editorWidget;
|
|
567
|
+
editorWidget?.setPosition(position);
|
|
568
|
+
if (reveal) {
|
|
569
|
+
editorWidget?.revealLine(position.lineNumber);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
518
572
|
};
|
|
519
573
|
AccessibleViewService = ( __decorate([
|
|
520
574
|
( __param(0, IInstantiationService)),
|
|
@@ -553,4 +607,4 @@ let AccessibleViewSymbolQuickPick = class AccessibleViewSymbolQuickPick {
|
|
|
553
607
|
AccessibleViewSymbolQuickPick = ( __decorate([
|
|
554
608
|
( __param(1, IQuickInputService))
|
|
555
609
|
], AccessibleViewSymbolQuickPick));
|
|
556
|
-
export { AccessibleViewService, IAccessibleViewService };
|
|
610
|
+
export { AccessibleView, AccessibleViewService, IAccessibleViewService };
|