@codingame/monaco-vscode-api 15.0.0 → 15.0.2
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/missing-services.js +53 -4
- package/package.json +8 -8
- package/services.js +5 -5
- package/vscode/src/vs/editor/browser/observableCodeEditor.js +1 -1
- package/vscode/src/vs/editor/browser/services/hoverService/hoverService.js +2 -4
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js +125 -0
- package/vscode/src/vs/editor/common/languages/languageConfigurationRegistry.js +2 -3
- package/vscode/src/vs/editor/common/services/languageFeatureDebounce.js +2 -3
- package/vscode/src/vs/editor/common/services/languageFeaturesService.js +2 -3
- package/vscode/src/vs/editor/common/services/semanticTokensStylingService.js +2 -3
- package/vscode/src/vs/editor/contrib/codelens/browser/codeLensCache.d.ts +15 -0
- package/vscode/src/vs/editor/contrib/codelens/browser/codeLensCache.js +93 -0
- package/vscode/src/vs/editor/contrib/documentSymbols/browser/outlineModel.js +2 -3
- package/vscode/src/vs/editor/contrib/editorState/browser/keybindingCancellation.d.ts +7 -0
- package/vscode/src/vs/editor/contrib/editorState/browser/keybindingCancellation.js +4 -4
- package/vscode/src/vs/editor/contrib/gotoError/browser/markerNavigationService.d.ts +45 -0
- package/vscode/src/vs/editor/contrib/gotoError/browser/markerNavigationService.js +215 -0
- package/vscode/src/vs/editor/contrib/gotoError/browser/markerNavigationService.service.d.ts +1 -1
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.d.ts +26 -0
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +178 -0
- package/vscode/src/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverRendered.js +3 -3
- package/vscode/src/vs/editor/contrib/hover/browser/hoverAccessibleViews.js +2 -2
- package/vscode/src/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
- package/vscode/src/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
- package/vscode/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +9 -9
- package/vscode/src/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
- package/vscode/src/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
- package/vscode/src/vs/editor/contrib/indentation/browser/indentation.js +20 -20
- package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +1 -2
- package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +20 -20
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +11 -11
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +1 -1
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +5 -5
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/indicatorView.js +3 -3
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +1 -1
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +18 -18
- package/vscode/src/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
- package/vscode/src/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
- package/vscode/src/vs/editor/contrib/linesOperations/browser/linesOperations.js +30 -30
- package/vscode/src/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
- package/vscode/src/vs/editor/contrib/links/browser/links.js +10 -10
- package/vscode/src/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/vscode/src/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
- package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
- package/vscode/src/vs/editor/contrib/peekView/browser/peekView.d.ts +6 -0
- package/vscode/src/vs/editor/contrib/peekView/browser/peekView.js +21 -22
- package/vscode/src/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
- package/vscode/src/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
- package/vscode/src/vs/editor/contrib/rename/browser/rename.js +11 -11
- package/vscode/src/vs/editor/contrib/rename/browser/renameWidget.js +6 -6
- package/vscode/src/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
- package/vscode/src/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
- package/vscode/src/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/vscode/src/vs/editor/contrib/suggest/browser/suggest.js +8 -8
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestController.js +10 -10
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestMemory.d.ts +67 -0
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestMemory.js +232 -0
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidget.js +16 -16
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
- package/vscode/src/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
- package/vscode/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
- package/vscode/src/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
- package/vscode/src/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
- package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
- package/vscode/src/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
- package/vscode/src/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/vscode/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
- package/vscode/src/vs/editor/contrib/wordOperations/browser/wordOperations.js +1 -1
- package/vscode/src/vs/editor/standalone/browser/standaloneServices.js +12 -8
- package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +54 -54
- package/vscode/src/vs/platform/action/common/actionCommonCategories.js +6 -6
- package/vscode/src/vs/platform/actionWidget/browser/actionList.js +255 -13
- package/vscode/src/vs/platform/actionWidget/browser/actionWidget.d.ts +26 -0
- package/vscode/src/vs/platform/actionWidget/browser/actionWidget.js +230 -0
- package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
- package/vscode/src/vs/platform/actions/browser/toolbar.js +2 -2
- package/vscode/src/vs/platform/actions/common/menuResetAction.js +1 -1
- package/vscode/src/vs/platform/actions/common/menuService.js +2 -2
- package/vscode/src/vs/platform/configuration/common/configurationRegistry.js +10 -10
- package/vscode/src/vs/platform/contextkey/browser/contextKeyService.js +1 -1
- package/vscode/src/vs/platform/contextkey/common/contextkey.js +11 -11
- package/vscode/src/vs/platform/contextkey/common/contextkeys.js +9 -9
- package/vscode/src/vs/platform/contextkey/common/scanner.js +5 -5
- package/vscode/src/vs/platform/dnd/browser/dnd.js +1 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +2 -2
- package/vscode/src/vs/platform/extensionManagement/common/extensionNls.js +1 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionsScannerService.js +7 -7
- package/vscode/src/vs/platform/extensions/common/extensionValidator.js +20 -20
- package/vscode/src/vs/platform/files/browser/htmlFileSystemProvider.js +2 -2
- package/vscode/src/vs/platform/files/common/files.js +6 -6
- package/vscode/src/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
- package/vscode/src/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
- package/vscode/src/vs/platform/list/browser/listService.js +27 -27
- package/vscode/src/vs/platform/log/common/log.js +6 -6
- package/vscode/src/vs/platform/markers/common/markers.js +6 -6
- package/vscode/src/vs/platform/quickinput/browser/quickInput.js +10 -10
- package/vscode/src/vs/platform/quickinput/browser/quickInputActions.js +3 -3
- package/vscode/src/vs/platform/quickinput/browser/quickInputController.js +6 -6
- package/vscode/src/vs/platform/quickinput/browser/quickInputTree.js +1 -1
- package/vscode/src/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
- package/vscode/src/vs/platform/request/common/request.js +18 -18
- package/vscode/src/vs/platform/telemetry/common/telemetryUtils.js +1 -1
- package/vscode/src/vs/platform/theme/common/colorUtils.js +2 -2
- package/vscode/src/vs/platform/theme/common/colors/baseColors.js +17 -17
- package/vscode/src/vs/platform/theme/common/colors/chartsColors.js +8 -8
- package/vscode/src/vs/platform/theme/common/colors/editorColors.js +94 -94
- package/vscode/src/vs/platform/theme/common/colors/inputColors.js +45 -45
- package/vscode/src/vs/platform/theme/common/colors/listColors.js +36 -36
- package/vscode/src/vs/platform/theme/common/colors/menuColors.js +7 -7
- package/vscode/src/vs/platform/theme/common/colors/minimapColors.js +11 -11
- package/vscode/src/vs/platform/theme/common/colors/miscColors.js +15 -15
- package/vscode/src/vs/platform/theme/common/colors/quickpickColors.js +9 -9
- package/vscode/src/vs/platform/theme/common/colors/searchColors.js +3 -3
- package/vscode/src/vs/platform/theme/common/iconRegistry.js +6 -6
- package/vscode/src/vs/platform/undoRedo/common/undoRedoService.js +22 -23
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.js +1 -1
- package/vscode/src/vs/platform/userDataSync/common/userDataSync.js +5 -5
- package/vscode/src/vs/platform/workspace/common/workspace.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostDiagnostics.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostLanguageModels.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostLogService.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostNotebook.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostStatusBar.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostTelemetry.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostTreeViews.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostTunnelService.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostWorkspace.js +1 -1
- package/vscode/src/vs/workbench/api/common/jsonValidationExtensionPoint.js +12 -12
- package/vscode/src/vs/workbench/browser/actions/developerActions.js +31 -31
- package/vscode/src/vs/workbench/browser/actions/textInputActions.js +6 -6
- package/vscode/src/vs/workbench/common/configuration.js +10 -10
- package/vscode/src/vs/workbench/common/contextkeys.js +70 -70
- package/vscode/src/vs/workbench/common/editor/editorOptions.d.ts +3 -0
- package/vscode/src/vs/workbench/common/editor/editorOptions.js +52 -0
- package/vscode/src/vs/workbench/common/editor.js +4 -4
- package/vscode/src/vs/workbench/common/theme.js +160 -160
- package/vscode/src/vs/workbench/common/views.js +4 -4
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +141 -141
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewActions.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorContextKeys.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +32 -32
- package/vscode/src/vs/workbench/contrib/chat/common/chatEditingService.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/tools/editFileTool.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/dictation/editorDictation.js +4 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorAccessibilityHelp.js +5 -5
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +3 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/largeFileOptimizations.js +3 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.js +4 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.js +4 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +5 -5
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsAccessibility.js +12 -12
- package/vscode/src/vs/workbench/contrib/comments/common/commentContextKeys.js +11 -11
- package/vscode/src/vs/workbench/contrib/debug/common/abstractDebugAdapter.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/common/debug.js +64 -64
- package/vscode/src/vs/workbench/contrib/files/browser/fileConstants.js +6 -6
- package/vscode/src/vs/workbench/contrib/folding/browser/folding.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/format/browser/formatActionsMultiple.js +20 -20
- package/vscode/src/vs/workbench/contrib/format/browser/formatActionsNone.js +4 -4
- package/vscode/src/vs/workbench/contrib/format/browser/formatModified.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlayHints/browser/inlayHintsAccessibilty.js +4 -4
- package/vscode/src/vs/workbench/contrib/list/browser/listResizeColumnAction.js +2 -2
- package/vscode/src/vs/workbench/contrib/list/browser/tableColumnResizeQuickPick.js +5 -5
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetCompletionProvider.js +3 -3
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsFile.js +3 -3
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsService.js +9 -9
- package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +29 -29
- package/vscode/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.js +5 -5
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +4 -4
- package/vscode/src/vs/workbench/contrib/testing/common/constants.js +11 -11
- package/vscode/src/vs/workbench/contrib/testing/common/testTypes.js +3 -3
- package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +16 -16
- package/vscode/src/vs/workbench/services/editor/browser/codeEditorService.d.ts +13 -0
- package/vscode/src/vs/workbench/services/editor/browser/codeEditorService.js +87 -0
- package/vscode/src/vs/workbench/services/editor/common/editorResolverService.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsRegistry.js +83 -83
- package/vscode/src/vs/workbench/services/language/common/languageService.js +28 -28
- package/vscode/src/vs/workbench/services/log/common/logConstants.js +1 -1
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.js +8 -8
- package/vscode/src/vs/workbench/services/remote/common/tunnelModel.js +6 -6
- package/vscode/src/vs/workbench/services/search/common/queryBuilder.js +1 -1
- package/vscode/src/vs/workbench/services/themes/common/colorExtensionPoint.js +22 -22
- package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +13 -13
- package/vscode/src/vs/workbench/services/userDataSync/common/userDataSync.js +12 -12
|
@@ -262,169 +262,169 @@ class AccessibilitySignal {
|
|
|
262
262
|
return [...this._signals];
|
|
263
263
|
}
|
|
264
264
|
static { this.errorAtPosition = AccessibilitySignal.register({
|
|
265
|
-
name: ( localize(
|
|
265
|
+
name: ( localize(1591, 'Error at Position')),
|
|
266
266
|
sound: Sound.error,
|
|
267
|
-
announcementMessage: ( localize(
|
|
267
|
+
announcementMessage: ( localize(1592, 'Error')),
|
|
268
268
|
settingsKey: 'accessibility.signals.positionHasError',
|
|
269
269
|
delaySettingsKey: 'accessibility.signalOptions.delays.errorAtPosition'
|
|
270
270
|
}); }
|
|
271
271
|
static { this.warningAtPosition = AccessibilitySignal.register({
|
|
272
|
-
name: ( localize(
|
|
272
|
+
name: ( localize(1593, 'Warning at Position')),
|
|
273
273
|
sound: Sound.warning,
|
|
274
|
-
announcementMessage: ( localize(
|
|
274
|
+
announcementMessage: ( localize(1594, 'Warning')),
|
|
275
275
|
settingsKey: 'accessibility.signals.positionHasWarning',
|
|
276
276
|
delaySettingsKey: 'accessibility.signalOptions.delays.warningAtPosition'
|
|
277
277
|
}); }
|
|
278
278
|
static { this.errorOnLine = AccessibilitySignal.register({
|
|
279
|
-
name: ( localize(
|
|
279
|
+
name: ( localize(1595, 'Error on Line')),
|
|
280
280
|
sound: Sound.error,
|
|
281
281
|
legacySoundSettingsKey: 'audioCues.lineHasError',
|
|
282
282
|
legacyAnnouncementSettingsKey: 'accessibility.alert.error',
|
|
283
|
-
announcementMessage: ( localize(
|
|
283
|
+
announcementMessage: ( localize(1596, 'Error on Line')),
|
|
284
284
|
settingsKey: 'accessibility.signals.lineHasError',
|
|
285
285
|
}); }
|
|
286
286
|
static { this.warningOnLine = AccessibilitySignal.register({
|
|
287
|
-
name: ( localize(
|
|
287
|
+
name: ( localize(1597, 'Warning on Line')),
|
|
288
288
|
sound: Sound.warning,
|
|
289
289
|
legacySoundSettingsKey: 'audioCues.lineHasWarning',
|
|
290
290
|
legacyAnnouncementSettingsKey: 'accessibility.alert.warning',
|
|
291
|
-
announcementMessage: ( localize(
|
|
291
|
+
announcementMessage: ( localize(1598, 'Warning on Line')),
|
|
292
292
|
settingsKey: 'accessibility.signals.lineHasWarning',
|
|
293
293
|
}); }
|
|
294
294
|
static { this.foldedArea = AccessibilitySignal.register({
|
|
295
|
-
name: ( localize(
|
|
295
|
+
name: ( localize(1599, 'Folded Area on Line')),
|
|
296
296
|
sound: Sound.foldedArea,
|
|
297
297
|
legacySoundSettingsKey: 'audioCues.lineHasFoldedArea',
|
|
298
298
|
legacyAnnouncementSettingsKey: 'accessibility.alert.foldedArea',
|
|
299
|
-
announcementMessage: ( localize(
|
|
299
|
+
announcementMessage: ( localize(1600, 'Folded')),
|
|
300
300
|
settingsKey: 'accessibility.signals.lineHasFoldedArea',
|
|
301
301
|
}); }
|
|
302
302
|
static { this.break = AccessibilitySignal.register({
|
|
303
|
-
name: ( localize(
|
|
303
|
+
name: ( localize(1601, 'Breakpoint on Line')),
|
|
304
304
|
sound: Sound.break,
|
|
305
305
|
legacySoundSettingsKey: 'audioCues.lineHasBreakpoint',
|
|
306
306
|
legacyAnnouncementSettingsKey: 'accessibility.alert.breakpoint',
|
|
307
|
-
announcementMessage: ( localize(
|
|
307
|
+
announcementMessage: ( localize(1602, 'Breakpoint')),
|
|
308
308
|
settingsKey: 'accessibility.signals.lineHasBreakpoint',
|
|
309
309
|
}); }
|
|
310
310
|
static { this.inlineSuggestion = AccessibilitySignal.register({
|
|
311
|
-
name: ( localize(
|
|
311
|
+
name: ( localize(1603, 'Inline Suggestion on Line')),
|
|
312
312
|
sound: Sound.quickFixes,
|
|
313
313
|
legacySoundSettingsKey: 'audioCues.lineHasInlineSuggestion',
|
|
314
314
|
settingsKey: 'accessibility.signals.lineHasInlineSuggestion',
|
|
315
315
|
}); }
|
|
316
316
|
static { this.terminalQuickFix = AccessibilitySignal.register({
|
|
317
|
-
name: ( localize(
|
|
317
|
+
name: ( localize(1604, 'Terminal Quick Fix')),
|
|
318
318
|
sound: Sound.quickFixes,
|
|
319
319
|
legacySoundSettingsKey: 'audioCues.terminalQuickFix',
|
|
320
320
|
legacyAnnouncementSettingsKey: 'accessibility.alert.terminalQuickFix',
|
|
321
|
-
announcementMessage: ( localize(
|
|
321
|
+
announcementMessage: ( localize(1605, 'Quick Fix')),
|
|
322
322
|
settingsKey: 'accessibility.signals.terminalQuickFix',
|
|
323
323
|
}); }
|
|
324
324
|
static { this.onDebugBreak = AccessibilitySignal.register({
|
|
325
|
-
name: ( localize(
|
|
325
|
+
name: ( localize(1606, 'Debugger Stopped on Breakpoint')),
|
|
326
326
|
sound: Sound.break,
|
|
327
327
|
legacySoundSettingsKey: 'audioCues.onDebugBreak',
|
|
328
328
|
legacyAnnouncementSettingsKey: 'accessibility.alert.onDebugBreak',
|
|
329
|
-
announcementMessage: ( localize(
|
|
329
|
+
announcementMessage: ( localize(1607, 'Breakpoint')),
|
|
330
330
|
settingsKey: 'accessibility.signals.onDebugBreak',
|
|
331
331
|
}); }
|
|
332
332
|
static { this.noInlayHints = AccessibilitySignal.register({
|
|
333
|
-
name: ( localize(
|
|
333
|
+
name: ( localize(1608, 'No Inlay Hints on Line')),
|
|
334
334
|
sound: Sound.error,
|
|
335
335
|
legacySoundSettingsKey: 'audioCues.noInlayHints',
|
|
336
336
|
legacyAnnouncementSettingsKey: 'accessibility.alert.noInlayHints',
|
|
337
|
-
announcementMessage: ( localize(
|
|
337
|
+
announcementMessage: ( localize(1609, 'No Inlay Hints')),
|
|
338
338
|
settingsKey: 'accessibility.signals.noInlayHints',
|
|
339
339
|
}); }
|
|
340
340
|
static { this.taskCompleted = AccessibilitySignal.register({
|
|
341
|
-
name: ( localize(
|
|
341
|
+
name: ( localize(1610, 'Task Completed')),
|
|
342
342
|
sound: Sound.taskCompleted,
|
|
343
343
|
legacySoundSettingsKey: 'audioCues.taskCompleted',
|
|
344
344
|
legacyAnnouncementSettingsKey: 'accessibility.alert.taskCompleted',
|
|
345
|
-
announcementMessage: ( localize(
|
|
345
|
+
announcementMessage: ( localize(1611, 'Task Completed')),
|
|
346
346
|
settingsKey: 'accessibility.signals.taskCompleted',
|
|
347
347
|
}); }
|
|
348
348
|
static { this.taskFailed = AccessibilitySignal.register({
|
|
349
|
-
name: ( localize(
|
|
349
|
+
name: ( localize(1612, 'Task Failed')),
|
|
350
350
|
sound: Sound.taskFailed,
|
|
351
351
|
legacySoundSettingsKey: 'audioCues.taskFailed',
|
|
352
352
|
legacyAnnouncementSettingsKey: 'accessibility.alert.taskFailed',
|
|
353
|
-
announcementMessage: ( localize(
|
|
353
|
+
announcementMessage: ( localize(1613, 'Task Failed')),
|
|
354
354
|
settingsKey: 'accessibility.signals.taskFailed',
|
|
355
355
|
}); }
|
|
356
356
|
static { this.terminalCommandFailed = AccessibilitySignal.register({
|
|
357
|
-
name: ( localize(
|
|
357
|
+
name: ( localize(1614, 'Terminal Command Failed')),
|
|
358
358
|
sound: Sound.error,
|
|
359
359
|
legacySoundSettingsKey: 'audioCues.terminalCommandFailed',
|
|
360
360
|
legacyAnnouncementSettingsKey: 'accessibility.alert.terminalCommandFailed',
|
|
361
|
-
announcementMessage: ( localize(
|
|
361
|
+
announcementMessage: ( localize(1615, 'Command Failed')),
|
|
362
362
|
settingsKey: 'accessibility.signals.terminalCommandFailed',
|
|
363
363
|
}); }
|
|
364
364
|
static { this.terminalCommandSucceeded = AccessibilitySignal.register({
|
|
365
|
-
name: ( localize(
|
|
365
|
+
name: ( localize(1616, 'Terminal Command Succeeded')),
|
|
366
366
|
sound: Sound.success,
|
|
367
|
-
announcementMessage: ( localize(
|
|
367
|
+
announcementMessage: ( localize(1617, 'Command Succeeded')),
|
|
368
368
|
settingsKey: 'accessibility.signals.terminalCommandSucceeded',
|
|
369
369
|
}); }
|
|
370
370
|
static { this.terminalBell = AccessibilitySignal.register({
|
|
371
|
-
name: ( localize(
|
|
371
|
+
name: ( localize(1618, 'Terminal Bell')),
|
|
372
372
|
sound: Sound.terminalBell,
|
|
373
373
|
legacySoundSettingsKey: 'audioCues.terminalBell',
|
|
374
374
|
legacyAnnouncementSettingsKey: 'accessibility.alert.terminalBell',
|
|
375
|
-
announcementMessage: ( localize(
|
|
375
|
+
announcementMessage: ( localize(1619, 'Terminal Bell')),
|
|
376
376
|
settingsKey: 'accessibility.signals.terminalBell',
|
|
377
377
|
}); }
|
|
378
378
|
static { this.notebookCellCompleted = AccessibilitySignal.register({
|
|
379
|
-
name: ( localize(
|
|
379
|
+
name: ( localize(1620, 'Notebook Cell Completed')),
|
|
380
380
|
sound: Sound.taskCompleted,
|
|
381
381
|
legacySoundSettingsKey: 'audioCues.notebookCellCompleted',
|
|
382
382
|
legacyAnnouncementSettingsKey: 'accessibility.alert.notebookCellCompleted',
|
|
383
|
-
announcementMessage: ( localize(
|
|
383
|
+
announcementMessage: ( localize(1621, 'Notebook Cell Completed')),
|
|
384
384
|
settingsKey: 'accessibility.signals.notebookCellCompleted',
|
|
385
385
|
}); }
|
|
386
386
|
static { this.notebookCellFailed = AccessibilitySignal.register({
|
|
387
|
-
name: ( localize(
|
|
387
|
+
name: ( localize(1622, 'Notebook Cell Failed')),
|
|
388
388
|
sound: Sound.taskFailed,
|
|
389
389
|
legacySoundSettingsKey: 'audioCues.notebookCellFailed',
|
|
390
390
|
legacyAnnouncementSettingsKey: 'accessibility.alert.notebookCellFailed',
|
|
391
|
-
announcementMessage: ( localize(
|
|
391
|
+
announcementMessage: ( localize(1623, 'Notebook Cell Failed')),
|
|
392
392
|
settingsKey: 'accessibility.signals.notebookCellFailed',
|
|
393
393
|
}); }
|
|
394
394
|
static { this.diffLineInserted = AccessibilitySignal.register({
|
|
395
|
-
name: ( localize(
|
|
395
|
+
name: ( localize(1624, 'Diff Line Inserted')),
|
|
396
396
|
sound: Sound.diffLineInserted,
|
|
397
397
|
legacySoundSettingsKey: 'audioCues.diffLineInserted',
|
|
398
398
|
settingsKey: 'accessibility.signals.diffLineInserted',
|
|
399
399
|
}); }
|
|
400
400
|
static { this.diffLineDeleted = AccessibilitySignal.register({
|
|
401
|
-
name: ( localize(
|
|
401
|
+
name: ( localize(1625, 'Diff Line Deleted')),
|
|
402
402
|
sound: Sound.diffLineDeleted,
|
|
403
403
|
legacySoundSettingsKey: 'audioCues.diffLineDeleted',
|
|
404
404
|
settingsKey: 'accessibility.signals.diffLineDeleted',
|
|
405
405
|
}); }
|
|
406
406
|
static { this.diffLineModified = AccessibilitySignal.register({
|
|
407
|
-
name: ( localize(
|
|
407
|
+
name: ( localize(1626, 'Diff Line Modified')),
|
|
408
408
|
sound: Sound.diffLineModified,
|
|
409
409
|
legacySoundSettingsKey: 'audioCues.diffLineModified',
|
|
410
410
|
settingsKey: 'accessibility.signals.diffLineModified',
|
|
411
411
|
}); }
|
|
412
412
|
static { this.chatEditModifiedFile = AccessibilitySignal.register({
|
|
413
|
-
name: ( localize(
|
|
413
|
+
name: ( localize(1627, 'Chat Edit Modified File')),
|
|
414
414
|
sound: Sound.chatEditModifiedFile,
|
|
415
|
-
announcementMessage: ( localize(
|
|
415
|
+
announcementMessage: ( localize(1628, 'File Modified from Chat Edits')),
|
|
416
416
|
settingsKey: 'accessibility.signals.chatEditModifiedFile',
|
|
417
417
|
}); }
|
|
418
418
|
static { this.chatRequestSent = AccessibilitySignal.register({
|
|
419
|
-
name: ( localize(
|
|
419
|
+
name: ( localize(1629, 'Chat Request Sent')),
|
|
420
420
|
sound: Sound.requestSent,
|
|
421
421
|
legacySoundSettingsKey: 'audioCues.chatRequestSent',
|
|
422
422
|
legacyAnnouncementSettingsKey: 'accessibility.alert.chatRequestSent',
|
|
423
|
-
announcementMessage: ( localize(
|
|
423
|
+
announcementMessage: ( localize(1630, 'Chat Request Sent')),
|
|
424
424
|
settingsKey: 'accessibility.signals.chatRequestSent',
|
|
425
425
|
}); }
|
|
426
426
|
static { this.chatResponseReceived = AccessibilitySignal.register({
|
|
427
|
-
name: ( localize(
|
|
427
|
+
name: ( localize(1631, 'Chat Response Received')),
|
|
428
428
|
legacySoundSettingsKey: 'audioCues.chatResponseReceived',
|
|
429
429
|
sound: {
|
|
430
430
|
randomOneOf: [
|
|
@@ -437,59 +437,59 @@ class AccessibilitySignal {
|
|
|
437
437
|
settingsKey: 'accessibility.signals.chatResponseReceived'
|
|
438
438
|
}); }
|
|
439
439
|
static { this.codeActionTriggered = AccessibilitySignal.register({
|
|
440
|
-
name: ( localize(
|
|
440
|
+
name: ( localize(1632, 'Code Action Request Triggered')),
|
|
441
441
|
sound: Sound.voiceRecordingStarted,
|
|
442
442
|
legacySoundSettingsKey: 'audioCues.codeActionRequestTriggered',
|
|
443
443
|
legacyAnnouncementSettingsKey: 'accessibility.alert.codeActionRequestTriggered',
|
|
444
|
-
announcementMessage: ( localize(
|
|
444
|
+
announcementMessage: ( localize(1633, 'Code Action Request Triggered')),
|
|
445
445
|
settingsKey: 'accessibility.signals.codeActionTriggered',
|
|
446
446
|
}); }
|
|
447
447
|
static { this.codeActionApplied = AccessibilitySignal.register({
|
|
448
|
-
name: ( localize(
|
|
448
|
+
name: ( localize(1634, 'Code Action Applied')),
|
|
449
449
|
legacySoundSettingsKey: 'audioCues.codeActionApplied',
|
|
450
450
|
sound: Sound.voiceRecordingStopped,
|
|
451
451
|
settingsKey: 'accessibility.signals.codeActionApplied'
|
|
452
452
|
}); }
|
|
453
453
|
static { this.progress = AccessibilitySignal.register({
|
|
454
|
-
name: ( localize(
|
|
454
|
+
name: ( localize(1635, 'Progress')),
|
|
455
455
|
sound: Sound.progress,
|
|
456
456
|
legacySoundSettingsKey: 'audioCues.chatResponsePending',
|
|
457
457
|
legacyAnnouncementSettingsKey: 'accessibility.alert.progress',
|
|
458
|
-
announcementMessage: ( localize(
|
|
458
|
+
announcementMessage: ( localize(1636, 'Progress')),
|
|
459
459
|
settingsKey: 'accessibility.signals.progress'
|
|
460
460
|
}); }
|
|
461
461
|
static { this.clear = AccessibilitySignal.register({
|
|
462
|
-
name: ( localize(
|
|
462
|
+
name: ( localize(1637, 'Clear')),
|
|
463
463
|
sound: Sound.clear,
|
|
464
464
|
legacySoundSettingsKey: 'audioCues.clear',
|
|
465
465
|
legacyAnnouncementSettingsKey: 'accessibility.alert.clear',
|
|
466
|
-
announcementMessage: ( localize(
|
|
466
|
+
announcementMessage: ( localize(1638, 'Clear')),
|
|
467
467
|
settingsKey: 'accessibility.signals.clear'
|
|
468
468
|
}); }
|
|
469
469
|
static { this.save = AccessibilitySignal.register({
|
|
470
|
-
name: ( localize(
|
|
470
|
+
name: ( localize(1639, 'Save')),
|
|
471
471
|
sound: Sound.save,
|
|
472
472
|
legacySoundSettingsKey: 'audioCues.save',
|
|
473
473
|
legacyAnnouncementSettingsKey: 'accessibility.alert.save',
|
|
474
|
-
announcementMessage: ( localize(
|
|
474
|
+
announcementMessage: ( localize(1640, 'Save')),
|
|
475
475
|
settingsKey: 'accessibility.signals.save'
|
|
476
476
|
}); }
|
|
477
477
|
static { this.format = AccessibilitySignal.register({
|
|
478
|
-
name: ( localize(
|
|
478
|
+
name: ( localize(1641, 'Format')),
|
|
479
479
|
sound: Sound.format,
|
|
480
480
|
legacySoundSettingsKey: 'audioCues.format',
|
|
481
481
|
legacyAnnouncementSettingsKey: 'accessibility.alert.format',
|
|
482
|
-
announcementMessage: ( localize(
|
|
482
|
+
announcementMessage: ( localize(1642, 'Format')),
|
|
483
483
|
settingsKey: 'accessibility.signals.format'
|
|
484
484
|
}); }
|
|
485
485
|
static { this.voiceRecordingStarted = AccessibilitySignal.register({
|
|
486
|
-
name: ( localize(
|
|
486
|
+
name: ( localize(1643, 'Voice Recording Started')),
|
|
487
487
|
sound: Sound.voiceRecordingStarted,
|
|
488
488
|
legacySoundSettingsKey: 'audioCues.voiceRecordingStarted',
|
|
489
489
|
settingsKey: 'accessibility.signals.voiceRecordingStarted'
|
|
490
490
|
}); }
|
|
491
491
|
static { this.voiceRecordingStopped = AccessibilitySignal.register({
|
|
492
|
-
name: ( localize(
|
|
492
|
+
name: ( localize(1644, 'Voice Recording Stopped')),
|
|
493
493
|
sound: Sound.voiceRecordingStopped,
|
|
494
494
|
legacySoundSettingsKey: 'audioCues.voiceRecordingStopped',
|
|
495
495
|
settingsKey: 'accessibility.signals.voiceRecordingStopped'
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import { localize2 } from '../../../nls.js';
|
|
3
3
|
|
|
4
4
|
const Categories = ( Object.freeze({
|
|
5
|
-
View: ( localize2(
|
|
6
|
-
Help: ( localize2(
|
|
7
|
-
Test: ( localize2(
|
|
8
|
-
File: ( localize2(
|
|
9
|
-
Preferences: ( localize2(
|
|
10
|
-
Developer: ( localize2(
|
|
5
|
+
View: ( localize2(1645, 'View')),
|
|
6
|
+
Help: ( localize2(1646, 'Help')),
|
|
7
|
+
Test: ( localize2(1647, 'Test')),
|
|
8
|
+
File: ( localize2(1648, 'File')),
|
|
9
|
+
Preferences: ( localize2(1649, 'Preferences')),
|
|
10
|
+
Developer: ( localize2(1650, "Developer")),
|
|
11
11
|
}));
|
|
12
12
|
|
|
13
13
|
export { Categories };
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
|
|
2
|
-
import '
|
|
3
|
-
import '../../../base/
|
|
4
|
-
import '../../../base/
|
|
5
|
-
import '../../../
|
|
6
|
-
import '../../../base/
|
|
7
|
-
import '../../../base/
|
|
8
|
-
import '../../../base/common/
|
|
9
|
-
import '../../../base/common/
|
|
10
|
-
import '../../../base/common/themables.js';
|
|
2
|
+
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
3
|
+
import { setVisibility } from '../../../base/browser/dom.js';
|
|
4
|
+
import { KeybindingLabel } from '../../../base/browser/ui/keybindingLabel/keybindingLabel.js';
|
|
5
|
+
import { List } from '../../../base/browser/ui/list/listWidget.js';
|
|
6
|
+
import { CancellationTokenSource } from '../../../base/common/cancellation.js';
|
|
7
|
+
import { Codicon } from '../../../base/common/codicons.js';
|
|
8
|
+
import { Disposable } from '../../../base/common/lifecycle.js';
|
|
9
|
+
import { OS } from '../../../base/common/platform.js';
|
|
10
|
+
import { ThemeIcon } from '../../../base/common/themables.js';
|
|
11
11
|
import './actionWidget.css.js';
|
|
12
|
-
import '
|
|
13
|
-
import '../../
|
|
14
|
-
import '../../
|
|
12
|
+
import { localize } from '../../../nls.js';
|
|
13
|
+
import { IContextViewService } from '../../contextview/browser/contextView.service.js';
|
|
14
|
+
import { IKeybindingService } from '../../keybinding/common/keybinding.service.js';
|
|
15
|
+
import { defaultListStyles } from '../../theme/browser/defaultStyles.js';
|
|
16
|
+
import { asCssVariable } from '../../theme/common/colorUtils.js';
|
|
15
17
|
import '../../theme/common/colors/baseColors.js';
|
|
16
18
|
import '../../theme/common/colors/chartsColors.js';
|
|
17
19
|
import '../../theme/common/colors/editorColors.js';
|
|
@@ -23,10 +25,250 @@ import '../../theme/common/colors/miscColors.js';
|
|
|
23
25
|
import '../../theme/common/colors/quickpickColors.js';
|
|
24
26
|
import '../../theme/common/colors/searchColors.js';
|
|
25
27
|
|
|
28
|
+
const acceptSelectedActionCommand = 'acceptSelectedCodeAction';
|
|
29
|
+
const previewSelectedActionCommand = 'previewSelectedCodeAction';
|
|
26
30
|
var ActionListItemKind;
|
|
27
31
|
(function (ActionListItemKind) {
|
|
28
32
|
ActionListItemKind["Action"] = "action";
|
|
29
33
|
ActionListItemKind["Header"] = "header";
|
|
30
34
|
})(ActionListItemKind || (ActionListItemKind = {}));
|
|
35
|
+
class HeaderRenderer {
|
|
36
|
+
get templateId() { return ActionListItemKind.Header; }
|
|
37
|
+
renderTemplate(container) {
|
|
38
|
+
container.classList.add('group-header');
|
|
39
|
+
const text = document.createElement('span');
|
|
40
|
+
container.append(text);
|
|
41
|
+
return { container, text };
|
|
42
|
+
}
|
|
43
|
+
renderElement(element, _index, templateData) {
|
|
44
|
+
templateData.text.textContent = element.group?.title ?? '';
|
|
45
|
+
}
|
|
46
|
+
disposeTemplate(_templateData) {
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
let ActionItemRenderer = class ActionItemRenderer {
|
|
50
|
+
get templateId() { return ActionListItemKind.Action; }
|
|
51
|
+
constructor(_supportsPreview, _keybindingService) {
|
|
52
|
+
this._supportsPreview = _supportsPreview;
|
|
53
|
+
this._keybindingService = _keybindingService;
|
|
54
|
+
}
|
|
55
|
+
renderTemplate(container) {
|
|
56
|
+
container.classList.add(this.templateId);
|
|
57
|
+
const icon = document.createElement('div');
|
|
58
|
+
icon.className = 'icon';
|
|
59
|
+
container.append(icon);
|
|
60
|
+
const text = document.createElement('span');
|
|
61
|
+
text.className = 'title';
|
|
62
|
+
container.append(text);
|
|
63
|
+
const keybinding = ( new KeybindingLabel(container, OS));
|
|
64
|
+
return { container, icon, text, keybinding };
|
|
65
|
+
}
|
|
66
|
+
renderElement(element, _index, data) {
|
|
67
|
+
if (element.group?.icon) {
|
|
68
|
+
data.icon.className = ThemeIcon.asClassName(element.group.icon);
|
|
69
|
+
if (element.group.icon.color) {
|
|
70
|
+
data.icon.style.color = asCssVariable(element.group.icon.color.id);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
data.icon.className = ThemeIcon.asClassName(Codicon.lightBulb);
|
|
75
|
+
data.icon.style.color = 'var(--vscode-editorLightBulb-foreground)';
|
|
76
|
+
}
|
|
77
|
+
if (!element.item || !element.label) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
setVisibility(!element.hideIcon, data.icon);
|
|
81
|
+
data.text.textContent = stripNewlines(element.label);
|
|
82
|
+
data.keybinding.set(element.keybinding);
|
|
83
|
+
setVisibility(!!element.keybinding, data.keybinding.element);
|
|
84
|
+
const actionTitle = this._keybindingService.lookupKeybinding(acceptSelectedActionCommand)?.getLabel();
|
|
85
|
+
const previewTitle = this._keybindingService.lookupKeybinding(previewSelectedActionCommand)?.getLabel();
|
|
86
|
+
data.container.classList.toggle('option-disabled', element.disabled);
|
|
87
|
+
if (element.disabled) {
|
|
88
|
+
data.container.title = element.label;
|
|
89
|
+
}
|
|
90
|
+
else if (actionTitle && previewTitle) {
|
|
91
|
+
if (this._supportsPreview && element.canPreview) {
|
|
92
|
+
data.container.title = ( localize(1651, "{0} to Apply, {1} to Preview", actionTitle, previewTitle));
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
data.container.title = ( localize(1652, "{0} to Apply", actionTitle));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
data.container.title = '';
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
disposeTemplate(templateData) {
|
|
103
|
+
templateData.keybinding.dispose();
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
ActionItemRenderer = ( __decorate([
|
|
107
|
+
( __param(1, IKeybindingService))
|
|
108
|
+
], ActionItemRenderer));
|
|
109
|
+
class AcceptSelectedEvent extends UIEvent {
|
|
110
|
+
constructor() { super('acceptSelectedAction'); }
|
|
111
|
+
}
|
|
112
|
+
class PreviewSelectedEvent extends UIEvent {
|
|
113
|
+
constructor() { super('previewSelectedAction'); }
|
|
114
|
+
}
|
|
115
|
+
function getKeyboardNavigationLabel(item) {
|
|
116
|
+
if (item.kind === 'action') {
|
|
117
|
+
return item.label;
|
|
118
|
+
}
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
121
|
+
let ActionList = class ActionList extends Disposable {
|
|
122
|
+
constructor(user, preview, items, _delegate, _contextViewService, _keybindingService) {
|
|
123
|
+
super();
|
|
124
|
+
this._delegate = _delegate;
|
|
125
|
+
this._contextViewService = _contextViewService;
|
|
126
|
+
this._keybindingService = _keybindingService;
|
|
127
|
+
this._actionLineHeight = 24;
|
|
128
|
+
this._headerLineHeight = 26;
|
|
129
|
+
this.cts = this._register(( new CancellationTokenSource()));
|
|
130
|
+
this.domNode = document.createElement('div');
|
|
131
|
+
this.domNode.classList.add('actionList');
|
|
132
|
+
const virtualDelegate = {
|
|
133
|
+
getHeight: element => element.kind === ActionListItemKind.Header ? this._headerLineHeight : this._actionLineHeight,
|
|
134
|
+
getTemplateId: element => element.kind
|
|
135
|
+
};
|
|
136
|
+
this._list = this._register(( new List(user, this.domNode, virtualDelegate, [
|
|
137
|
+
( new ActionItemRenderer(preview, this._keybindingService)),
|
|
138
|
+
( new HeaderRenderer()),
|
|
139
|
+
], {
|
|
140
|
+
keyboardSupport: false,
|
|
141
|
+
typeNavigationEnabled: true,
|
|
142
|
+
keyboardNavigationLabelProvider: { getKeyboardNavigationLabel },
|
|
143
|
+
accessibilityProvider: {
|
|
144
|
+
getAriaLabel: element => {
|
|
145
|
+
if (element.kind === ActionListItemKind.Action) {
|
|
146
|
+
let label = element.label ? stripNewlines(element?.label) : '';
|
|
147
|
+
if (element.disabled) {
|
|
148
|
+
label = ( localize(1653, "{0}, Disabled Reason: {1}", label, element.disabled));
|
|
149
|
+
}
|
|
150
|
+
return label;
|
|
151
|
+
}
|
|
152
|
+
return null;
|
|
153
|
+
},
|
|
154
|
+
getWidgetAriaLabel: () => ( localize(1654, "Action Widget")),
|
|
155
|
+
getRole: (e) => e.kind === ActionListItemKind.Action ? 'option' : 'separator',
|
|
156
|
+
getWidgetRole: () => 'listbox',
|
|
157
|
+
},
|
|
158
|
+
})));
|
|
159
|
+
this._list.style(defaultListStyles);
|
|
160
|
+
this._register(this._list.onMouseClick(e => this.onListClick(e)));
|
|
161
|
+
this._register(this._list.onMouseOver(e => this.onListHover(e)));
|
|
162
|
+
this._register(this._list.onDidChangeFocus(() => this.onFocus()));
|
|
163
|
+
this._register(this._list.onDidChangeSelection(e => this.onListSelection(e)));
|
|
164
|
+
this._allMenuItems = items;
|
|
165
|
+
this._list.splice(0, this._list.length, this._allMenuItems);
|
|
166
|
+
if (this._list.length) {
|
|
167
|
+
this.focusNext();
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
focusCondition(element) {
|
|
171
|
+
return !element.disabled && element.kind === ActionListItemKind.Action;
|
|
172
|
+
}
|
|
173
|
+
hide(didCancel) {
|
|
174
|
+
this._delegate.onHide(didCancel);
|
|
175
|
+
this.cts.cancel();
|
|
176
|
+
this._contextViewService.hideContextView();
|
|
177
|
+
}
|
|
178
|
+
layout(minWidth) {
|
|
179
|
+
const numHeaders = this._allMenuItems.filter(item => item.kind === 'header').length;
|
|
180
|
+
const itemsHeight = this._allMenuItems.length * this._actionLineHeight;
|
|
181
|
+
const heightWithHeaders = itemsHeight + numHeaders * this._headerLineHeight - numHeaders * this._actionLineHeight;
|
|
182
|
+
this._list.layout(heightWithHeaders);
|
|
183
|
+
let maxWidth = minWidth;
|
|
184
|
+
if (this._allMenuItems.length >= 50) {
|
|
185
|
+
maxWidth = 380;
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
const itemWidths = ( this._allMenuItems.map((_, index) => {
|
|
189
|
+
const element = this.domNode.ownerDocument.getElementById(this._list.getElementID(index));
|
|
190
|
+
if (element) {
|
|
191
|
+
element.style.width = 'auto';
|
|
192
|
+
const width = element.getBoundingClientRect().width;
|
|
193
|
+
element.style.width = '';
|
|
194
|
+
return width;
|
|
195
|
+
}
|
|
196
|
+
return 0;
|
|
197
|
+
}));
|
|
198
|
+
maxWidth = Math.max(...itemWidths, minWidth);
|
|
199
|
+
}
|
|
200
|
+
const maxVhPrecentage = 0.7;
|
|
201
|
+
const height = Math.min(heightWithHeaders, this.domNode.ownerDocument.body.clientHeight * maxVhPrecentage);
|
|
202
|
+
this._list.layout(height, maxWidth);
|
|
203
|
+
this.domNode.style.height = `${height}px`;
|
|
204
|
+
this._list.domFocus();
|
|
205
|
+
return maxWidth;
|
|
206
|
+
}
|
|
207
|
+
focusPrevious() {
|
|
208
|
+
this._list.focusPrevious(1, true, undefined, this.focusCondition);
|
|
209
|
+
}
|
|
210
|
+
focusNext() {
|
|
211
|
+
this._list.focusNext(1, true, undefined, this.focusCondition);
|
|
212
|
+
}
|
|
213
|
+
acceptSelected(preview) {
|
|
214
|
+
const focused = this._list.getFocus();
|
|
215
|
+
if (focused.length === 0) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
const focusIndex = focused[0];
|
|
219
|
+
const element = this._list.element(focusIndex);
|
|
220
|
+
if (!this.focusCondition(element)) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
const event = preview ? ( new PreviewSelectedEvent()) : ( new AcceptSelectedEvent());
|
|
224
|
+
this._list.setSelection([focusIndex], event);
|
|
225
|
+
}
|
|
226
|
+
onListSelection(e) {
|
|
227
|
+
if (!e.elements.length) {
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
const element = e.elements[0];
|
|
231
|
+
if (element.item && this.focusCondition(element)) {
|
|
232
|
+
this._delegate.onSelect(element.item, e.browserEvent instanceof PreviewSelectedEvent);
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
this._list.setSelection([]);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
onFocus() {
|
|
239
|
+
const focused = this._list.getFocus();
|
|
240
|
+
if (focused.length === 0) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
const focusIndex = focused[0];
|
|
244
|
+
const element = this._list.element(focusIndex);
|
|
245
|
+
this._delegate.onFocus?.(element.item);
|
|
246
|
+
}
|
|
247
|
+
async onListHover(e) {
|
|
248
|
+
const element = e.element;
|
|
249
|
+
if (element && element.item && this.focusCondition(element)) {
|
|
250
|
+
if (this._delegate.onHover && !element.disabled && element.kind === ActionListItemKind.Action) {
|
|
251
|
+
const result = await this._delegate.onHover(element.item, this.cts.token);
|
|
252
|
+
element.canPreview = result ? result.canPreview : undefined;
|
|
253
|
+
}
|
|
254
|
+
if (e.index) {
|
|
255
|
+
this._list.splice(e.index, 1, [element]);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
this._list.setFocus(typeof e.index === 'number' ? [e.index] : []);
|
|
259
|
+
}
|
|
260
|
+
onListClick(e) {
|
|
261
|
+
if (e.element && this.focusCondition(e.element)) {
|
|
262
|
+
this._list.setFocus([]);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
ActionList = ( __decorate([
|
|
267
|
+
( __param(4, IContextViewService)),
|
|
268
|
+
( __param(5, IKeybindingService))
|
|
269
|
+
], ActionList));
|
|
270
|
+
function stripNewlines(str) {
|
|
271
|
+
return str.replace(/\r\n|\r|\n/g, ' ');
|
|
272
|
+
}
|
|
31
273
|
|
|
32
|
-
export { ActionListItemKind };
|
|
274
|
+
export { ActionList, ActionListItemKind, acceptSelectedActionCommand, previewSelectedActionCommand };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IAnchor } from "../../../base/browser/ui/contextview/contextview.js";
|
|
2
|
+
import { IAction } from "../../../base/common/actions.js";
|
|
3
|
+
import { Disposable } from "../../../base/common/lifecycle.js";
|
|
4
|
+
import { IActionListDelegate, IActionListItem } from "./actionList.js";
|
|
5
|
+
import { IContextKeyService } from "../../contextkey/common/contextkey.service.js";
|
|
6
|
+
import { IContextViewService } from "../../contextview/browser/contextView.service.js";
|
|
7
|
+
import { IInstantiationService } from "../../instantiation/common/instantiation.js";
|
|
8
|
+
import { IActionWidgetService } from "./actionWidget.service.js";
|
|
9
|
+
export declare class ActionWidgetService extends Disposable implements IActionWidgetService {
|
|
10
|
+
private readonly _contextViewService;
|
|
11
|
+
private readonly _contextKeyService;
|
|
12
|
+
private readonly _instantiationService;
|
|
13
|
+
readonly _serviceBrand: undefined;
|
|
14
|
+
get isVisible(): boolean;
|
|
15
|
+
private readonly _list;
|
|
16
|
+
constructor(_contextViewService: IContextViewService, _contextKeyService: IContextKeyService, _instantiationService: IInstantiationService);
|
|
17
|
+
show<T>(user: string, supportsPreview: boolean, items: readonly IActionListItem<T>[], delegate: IActionListDelegate<T>, anchor: IAnchor, container: HTMLElement | undefined, actionBarActions?: readonly IAction[]): void;
|
|
18
|
+
acceptSelected(preview?: boolean): void;
|
|
19
|
+
focusPrevious(): void;
|
|
20
|
+
focusNext(): void;
|
|
21
|
+
hide(didCancel?: boolean): void;
|
|
22
|
+
clear(): void;
|
|
23
|
+
private _renderWidget;
|
|
24
|
+
private _createActionBar;
|
|
25
|
+
private _onWidgetClosed;
|
|
26
|
+
}
|