monaco-editor-core 0.56.0-dev-20260121 → 0.56.0-dev-20260123
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/esm/nls.keys.json +1 -1
- package/esm/nls.messages.cs.js +2 -2
- package/esm/nls.messages.de.js +2 -2
- package/esm/nls.messages.es.js +2 -2
- package/esm/nls.messages.fr.js +2 -2
- package/esm/nls.messages.it.js +2 -2
- package/esm/nls.messages.ja.js +2 -2
- package/esm/nls.messages.js +1 -1
- package/esm/nls.messages.json +1 -1
- package/esm/nls.messages.ko.js +2 -2
- package/esm/nls.messages.pl.js +2 -2
- package/esm/nls.messages.pt-br.js +2 -2
- package/esm/nls.messages.ru.js +2 -2
- package/esm/nls.messages.tr.js +2 -2
- package/esm/nls.messages.zh-cn.js +2 -2
- package/esm/nls.messages.zh-tw.js +2 -2
- package/esm/nls.metadata.json +6 -2
- package/esm/vs/base/browser/markdownRenderer.js +0 -1
- package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/tree/abstractTree.js +15 -1
- package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
- package/esm/vs/base/common/actions.js +1 -1
- package/esm/vs/base/common/codiconsLibrary.js +2 -0
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/base/common/errorMessage.js +6 -6
- package/esm/vs/base/common/keybindingLabels.js +20 -20
- package/esm/vs/base/common/network.js +0 -2
- package/esm/vs/base/common/network.js.map +1 -1
- package/esm/vs/base/common/observableInternal/observables/derivedImpl.js +10 -4
- package/esm/vs/base/common/observableInternal/observables/derivedImpl.js.map +1 -1
- package/esm/vs/base/common/policy.js +5 -5
- package/esm/vs/editor/browser/controller/editContext/native/screenReaderSupport.js +1 -1
- package/esm/vs/editor/browser/controller/editContext/screenReaderUtils.js +4 -4
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +1 -1
- package/esm/vs/editor/browser/coreCommands.js +3 -3
- package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
- package/esm/vs/editor/browser/editorExtensions.js +9 -9
- package/esm/vs/editor/browser/gpu/viewGpuContext.js +1 -1
- package/esm/vs/editor/browser/observableCodeEditor.js +41 -0
- package/esm/vs/editor/browser/observableCodeEditor.js.map +1 -1
- package/esm/vs/editor/browser/services/inlineCompletionsService.js +4 -4
- package/esm/vs/editor/browser/services/renameSymbolTrackerService.js +15 -0
- package/esm/vs/editor/browser/services/renameSymbolTrackerService.js.map +1 -0
- package/esm/vs/editor/browser/view.js +3 -0
- package/esm/vs/editor/browser/view.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/viewLines/viewLine.js +14 -0
- package/esm/vs/editor/browser/viewParts/viewLines/viewLine.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js +7 -0
- package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js.map +1 -1
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +8 -2
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/commands.js +12 -12
- package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +14 -14
- package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +7 -7
- package/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +5 -5
- package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +7 -7
- package/esm/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/registrations.contribution.js +5 -5
- package/esm/vs/editor/browser/widget/multiDiffEditor/colors.js +3 -3
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +2 -2
- package/esm/vs/editor/browser/widget/multiDiffEditor/style.css +2 -41
- package/esm/vs/editor/common/config/editorConfigurationSchema.js +55 -55
- package/esm/vs/editor/common/config/editorOptions.js +410 -410
- package/esm/vs/editor/common/core/editorColorRegistry.js +70 -70
- package/esm/vs/editor/common/editorContextKeys.js +48 -48
- package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
- package/esm/vs/editor/common/languages.js +56 -56
- package/esm/vs/editor/common/model/editStack.js +1 -1
- package/esm/vs/editor/common/standaloneStrings.js +11 -11
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
- package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
- package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
- package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
- package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +17 -17
- package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +44 -34
- package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js.map +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +5 -4
- package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js.map +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
- package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
- package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
- package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +10 -10
- package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +9 -9
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +2 -2
- package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
- package/esm/vs/editor/contrib/find/browser/findController.js +16 -16
- package/esm/vs/editor/contrib/find/browser/findWidget.css +5 -6
- package/esm/vs/editor/contrib/find/browser/findWidget.js +26 -26
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +2 -1
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.js +54 -45
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.js.map +1 -1
- package/esm/vs/editor/contrib/folding/browser/folding.js +20 -20
- package/esm/vs/editor/contrib/folding/browser/folding.js.map +1 -1
- package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
- package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
- package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
- package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
- package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
- package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
- package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
- package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
- package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
- package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
- package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +7 -7
- package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
- package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
- package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +21 -21
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -13
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +4 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +107 -18
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +6 -6
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +3 -3
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js +2 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js.map +1 -1
- package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
- package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +31 -31
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
- package/esm/vs/editor/contrib/links/browser/links.js +10 -10
- package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
- package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
- package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +10 -10
- package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
- package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
- package/esm/vs/editor/contrib/rename/browser/rename.js +11 -11
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
- package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -9
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +11 -11
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +17 -17
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
- package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
- package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
- package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
- package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
- package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +3 -3
- package/esm/vs/editor/standalone/browser/services/standaloneWebWorkerService.js +2 -1
- package/esm/vs/editor/standalone/browser/services/standaloneWebWorkerService.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneServices.js +2 -0
- package/esm/vs/editor/standalone/browser/standaloneServices.js.map +1 -1
- package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
- package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
- package/esm/vs/platform/actionWidget/browser/actionList.js +34 -11
- package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
- package/esm/vs/platform/actionWidget/browser/actionWidget.css +10 -0
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +3 -3
- package/esm/vs/platform/actions/browser/toolbar.js +2 -2
- package/esm/vs/platform/actions/common/actions.js +2 -0
- package/esm/vs/platform/actions/common/actions.js.map +1 -1
- package/esm/vs/platform/actions/common/menuService.js +2 -2
- package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
- package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
- package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
- package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
- package/esm/vs/platform/contextkey/common/scanner.js +5 -5
- package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
- package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
- package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
- package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +5 -5
- package/esm/vs/platform/list/browser/listService.js +27 -27
- package/esm/vs/platform/markers/common/markerService.js +2 -2
- package/esm/vs/platform/markers/common/markers.js +6 -6
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
- package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
- package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
- package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
- package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickTree.js +1 -1
- package/esm/vs/platform/theme/common/colorUtils.js +2 -2
- package/esm/vs/platform/theme/common/colors/baseColors.js +18 -18
- package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
- package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
- package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
- package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
- package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
- package/esm/vs/platform/theme/common/colors/minimapColors.js +11 -11
- package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
- package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
- package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
- package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
- package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
- package/esm/vs/platform/workspace/common/workspace.js +1 -1
- package/package.json +2 -2
|
@@ -311,7 +311,7 @@ let CommonFindController = class CommonFindController extends Disposable {
|
|
|
311
311
|
replaceAll() {
|
|
312
312
|
if (this._model) {
|
|
313
313
|
if (this._editor.getModel()?.isTooLargeForHeapOperation()) {
|
|
314
|
-
this._notificationService.warn(nls.localize(
|
|
314
|
+
this._notificationService.warn(nls.localize(951, "The file is too large to perform a replace all operation."));
|
|
315
315
|
return false;
|
|
316
316
|
}
|
|
317
317
|
this._model.replaceAll();
|
|
@@ -428,7 +428,7 @@ FindController = __decorate([
|
|
|
428
428
|
export { FindController };
|
|
429
429
|
export const StartFindAction = registerMultiEditorAction(new MultiEditorAction({
|
|
430
430
|
id: FIND_IDS.StartFindAction,
|
|
431
|
-
label: nls.localize2(
|
|
431
|
+
label: nls.localize2(958, "Find"),
|
|
432
432
|
precondition: ContextKeyExpr.or(EditorContextKeys.focus, ContextKeyExpr.has('editorIsOpen')),
|
|
433
433
|
kbOpts: {
|
|
434
434
|
kbExpr: null,
|
|
@@ -438,7 +438,7 @@ export const StartFindAction = registerMultiEditorAction(new MultiEditorAction({
|
|
|
438
438
|
menuOpts: {
|
|
439
439
|
menuId: MenuId.MenubarEditMenu,
|
|
440
440
|
group: '3_find',
|
|
441
|
-
title: nls.localize(
|
|
441
|
+
title: nls.localize(952, "&&Find"),
|
|
442
442
|
order: 1
|
|
443
443
|
}
|
|
444
444
|
}));
|
|
@@ -479,7 +479,7 @@ export class StartFindWithArgsAction extends EditorAction {
|
|
|
479
479
|
constructor() {
|
|
480
480
|
super({
|
|
481
481
|
id: FIND_IDS.StartFindWithArgs,
|
|
482
|
-
label: nls.localize2(
|
|
482
|
+
label: nls.localize2(959, "Find with Arguments"),
|
|
483
483
|
precondition: undefined,
|
|
484
484
|
kbOpts: {
|
|
485
485
|
kbExpr: null,
|
|
@@ -523,7 +523,7 @@ export class StartFindWithSelectionAction extends EditorAction {
|
|
|
523
523
|
constructor() {
|
|
524
524
|
super({
|
|
525
525
|
id: FIND_IDS.StartFindWithSelection,
|
|
526
|
-
label: nls.localize2(
|
|
526
|
+
label: nls.localize2(960, "Find with Selection"),
|
|
527
527
|
precondition: undefined,
|
|
528
528
|
kbOpts: {
|
|
529
529
|
kbExpr: null,
|
|
@@ -581,7 +581,7 @@ async function matchFindAction(editor, next) {
|
|
|
581
581
|
}
|
|
582
582
|
export const NextMatchFindAction = registerMultiEditorAction(new MultiEditorAction({
|
|
583
583
|
id: FIND_IDS.NextMatchFindAction,
|
|
584
|
-
label: nls.localize2(
|
|
584
|
+
label: nls.localize2(961, "Find Next"),
|
|
585
585
|
precondition: undefined,
|
|
586
586
|
kbOpts: [{
|
|
587
587
|
kbExpr: EditorContextKeys.focus,
|
|
@@ -599,7 +599,7 @@ NextMatchFindAction.addImplementation(0, async (accessor, editor, args) => {
|
|
|
599
599
|
});
|
|
600
600
|
export const PreviousMatchFindAction = registerMultiEditorAction(new MultiEditorAction({
|
|
601
601
|
id: FIND_IDS.PreviousMatchFindAction,
|
|
602
|
-
label: nls.localize2(
|
|
602
|
+
label: nls.localize2(962, "Find Previous"),
|
|
603
603
|
precondition: undefined,
|
|
604
604
|
kbOpts: [{
|
|
605
605
|
kbExpr: EditorContextKeys.focus,
|
|
@@ -619,7 +619,7 @@ export class MoveToMatchFindAction extends EditorAction {
|
|
|
619
619
|
constructor() {
|
|
620
620
|
super({
|
|
621
621
|
id: FIND_IDS.GoToMatchFindAction,
|
|
622
|
-
label: nls.localize2(
|
|
622
|
+
label: nls.localize2(963, "Go to Match..."),
|
|
623
623
|
precondition: CONTEXT_FIND_WIDGET_VISIBLE
|
|
624
624
|
});
|
|
625
625
|
this._highlightDecorations = [];
|
|
@@ -634,14 +634,14 @@ export class MoveToMatchFindAction extends EditorAction {
|
|
|
634
634
|
const notificationService = accessor.get(INotificationService);
|
|
635
635
|
notificationService.notify({
|
|
636
636
|
severity: Severity.Warning,
|
|
637
|
-
message: nls.localize(
|
|
637
|
+
message: nls.localize(953, "No matches. Try searching for something else.")
|
|
638
638
|
});
|
|
639
639
|
return;
|
|
640
640
|
}
|
|
641
641
|
const quickInputService = accessor.get(IQuickInputService);
|
|
642
642
|
const disposables = new DisposableStore();
|
|
643
643
|
const inputBox = disposables.add(quickInputService.createInputBox());
|
|
644
|
-
inputBox.placeholder = nls.localize(
|
|
644
|
+
inputBox.placeholder = nls.localize(954, "Type a number to go to a specific match (between 1 and {0})", matchesCount);
|
|
645
645
|
const toFindMatchIndex = (value) => {
|
|
646
646
|
const index = parseInt(value);
|
|
647
647
|
if (isNaN(index)) {
|
|
@@ -668,7 +668,7 @@ export class MoveToMatchFindAction extends EditorAction {
|
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
670
|
else {
|
|
671
|
-
inputBox.validationMessage = nls.localize(
|
|
671
|
+
inputBox.validationMessage = nls.localize(955, "Please type a number between 1 and {0}", controller.getState().matchesCount);
|
|
672
672
|
this.clearDecorations(editor);
|
|
673
673
|
}
|
|
674
674
|
};
|
|
@@ -682,7 +682,7 @@ export class MoveToMatchFindAction extends EditorAction {
|
|
|
682
682
|
inputBox.hide();
|
|
683
683
|
}
|
|
684
684
|
else {
|
|
685
|
-
inputBox.validationMessage = nls.localize(
|
|
685
|
+
inputBox.validationMessage = nls.localize(956, "Please type a number between 1 and {0}", controller.getState().matchesCount);
|
|
686
686
|
}
|
|
687
687
|
}));
|
|
688
688
|
disposables.add(inputBox.onDidHide(() => {
|
|
@@ -750,7 +750,7 @@ export class NextSelectionMatchFindAction extends SelectionMatchFindAction {
|
|
|
750
750
|
constructor() {
|
|
751
751
|
super({
|
|
752
752
|
id: FIND_IDS.NextSelectionMatchFindAction,
|
|
753
|
-
label: nls.localize2(
|
|
753
|
+
label: nls.localize2(964, "Find Next Selection"),
|
|
754
754
|
precondition: undefined,
|
|
755
755
|
kbOpts: {
|
|
756
756
|
kbExpr: EditorContextKeys.focus,
|
|
@@ -767,7 +767,7 @@ export class PreviousSelectionMatchFindAction extends SelectionMatchFindAction {
|
|
|
767
767
|
constructor() {
|
|
768
768
|
super({
|
|
769
769
|
id: FIND_IDS.PreviousSelectionMatchFindAction,
|
|
770
|
-
label: nls.localize2(
|
|
770
|
+
label: nls.localize2(965, "Find Previous Selection"),
|
|
771
771
|
precondition: undefined,
|
|
772
772
|
kbOpts: {
|
|
773
773
|
kbExpr: EditorContextKeys.focus,
|
|
@@ -782,7 +782,7 @@ export class PreviousSelectionMatchFindAction extends SelectionMatchFindAction {
|
|
|
782
782
|
}
|
|
783
783
|
export const StartFindReplaceAction = registerMultiEditorAction(new MultiEditorAction({
|
|
784
784
|
id: FIND_IDS.StartFindReplaceAction,
|
|
785
|
-
label: nls.localize2(
|
|
785
|
+
label: nls.localize2(966, "Replace"),
|
|
786
786
|
precondition: ContextKeyExpr.or(EditorContextKeys.focus, ContextKeyExpr.has('editorIsOpen')),
|
|
787
787
|
kbOpts: {
|
|
788
788
|
kbExpr: null,
|
|
@@ -793,7 +793,7 @@ export const StartFindReplaceAction = registerMultiEditorAction(new MultiEditorA
|
|
|
793
793
|
menuOpts: {
|
|
794
794
|
menuId: MenuId.MenubarEditMenu,
|
|
795
795
|
group: '3_find',
|
|
796
|
-
title: nls.localize(
|
|
796
|
+
title: nls.localize(957, "&&Replace"),
|
|
797
797
|
order: 2
|
|
798
798
|
}
|
|
799
799
|
}));
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
overflow: hidden;
|
|
12
12
|
line-height: 19px;
|
|
13
13
|
transition: transform 200ms linear;
|
|
14
|
-
padding: 0 4px;
|
|
14
|
+
padding: 0 4px 0 9px;
|
|
15
15
|
box-sizing: border-box;
|
|
16
16
|
transform: translateY(calc(-100% - 10px)); /* shadow (10px) */
|
|
17
17
|
box-shadow: 0 0 8px 2px var(--vscode-widget-shadow);
|
|
@@ -151,8 +151,7 @@
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
.monaco-editor .find-widget .button.left {
|
|
154
|
-
margin
|
|
155
|
-
margin-right: 3px;
|
|
154
|
+
margin: 4px 0 4px 5px;
|
|
156
155
|
}
|
|
157
156
|
|
|
158
157
|
.monaco-editor .find-widget .button.wide {
|
|
@@ -164,10 +163,10 @@
|
|
|
164
163
|
.monaco-editor .find-widget .button.toggle {
|
|
165
164
|
position: absolute;
|
|
166
165
|
top: 0;
|
|
167
|
-
left:
|
|
166
|
+
left: 0;
|
|
168
167
|
width: 18px;
|
|
169
|
-
height:
|
|
170
|
-
border-radius:
|
|
168
|
+
height: -webkit-fill-available;
|
|
169
|
+
border-radius: var(--vscode-cornerRadius-small);
|
|
171
170
|
box-sizing: border-box;
|
|
172
171
|
}
|
|
173
172
|
|
|
@@ -26,28 +26,28 @@ import { ThemeIcon } from '../../../../base/common/themables.js';
|
|
|
26
26
|
import { isHighContrast } from '../../../../platform/theme/common/theme.js';
|
|
27
27
|
import { assertReturnsDefined } from '../../../../base/common/types.js';
|
|
28
28
|
import { defaultInputBoxStyles, defaultToggleStyles } from '../../../../platform/theme/browser/defaultStyles.js';
|
|
29
|
-
const findCollapsedIcon = registerIcon('find-collapsed', Codicon.chevronRight, nls.localize(
|
|
30
|
-
const findExpandedIcon = registerIcon('find-expanded', Codicon.chevronDown, nls.localize(
|
|
31
|
-
export const findSelectionIcon = registerIcon('find-selection', Codicon.selection, nls.localize(
|
|
32
|
-
export const findReplaceIcon = registerIcon('find-replace', Codicon.replace, nls.localize(
|
|
33
|
-
export const findReplaceAllIcon = registerIcon('find-replace-all', Codicon.replaceAll, nls.localize(
|
|
34
|
-
export const findPreviousMatchIcon = registerIcon('find-previous-match', Codicon.arrowUp, nls.localize(
|
|
35
|
-
export const findNextMatchIcon = registerIcon('find-next-match', Codicon.arrowDown, nls.localize(
|
|
36
|
-
const NLS_FIND_DIALOG_LABEL = nls.localize(
|
|
37
|
-
const NLS_FIND_INPUT_LABEL = nls.localize(
|
|
38
|
-
const NLS_FIND_INPUT_PLACEHOLDER = nls.localize(
|
|
39
|
-
const NLS_PREVIOUS_MATCH_BTN_LABEL = nls.localize(
|
|
40
|
-
const NLS_NEXT_MATCH_BTN_LABEL = nls.localize(
|
|
41
|
-
const NLS_TOGGLE_SELECTION_FIND_TITLE = nls.localize(
|
|
42
|
-
const NLS_CLOSE_BTN_LABEL = nls.localize(
|
|
43
|
-
const NLS_REPLACE_INPUT_LABEL = nls.localize(
|
|
44
|
-
const NLS_REPLACE_INPUT_PLACEHOLDER = nls.localize(
|
|
45
|
-
const NLS_REPLACE_BTN_LABEL = nls.localize(
|
|
46
|
-
const NLS_REPLACE_ALL_BTN_LABEL = nls.localize(
|
|
47
|
-
const NLS_TOGGLE_REPLACE_MODE_BTN_LABEL = nls.localize(
|
|
48
|
-
const NLS_MATCHES_COUNT_LIMIT_TITLE = nls.localize(
|
|
49
|
-
export const NLS_MATCHES_LOCATION = nls.localize(
|
|
50
|
-
export const NLS_NO_RESULTS = nls.localize(
|
|
29
|
+
const findCollapsedIcon = registerIcon('find-collapsed', Codicon.chevronRight, nls.localize(967, 'Icon to indicate that the editor find widget is collapsed.'));
|
|
30
|
+
const findExpandedIcon = registerIcon('find-expanded', Codicon.chevronDown, nls.localize(968, 'Icon to indicate that the editor find widget is expanded.'));
|
|
31
|
+
export const findSelectionIcon = registerIcon('find-selection', Codicon.selection, nls.localize(969, 'Icon for \'Find in Selection\' in the editor find widget.'));
|
|
32
|
+
export const findReplaceIcon = registerIcon('find-replace', Codicon.replace, nls.localize(970, 'Icon for \'Replace\' in the editor find widget.'));
|
|
33
|
+
export const findReplaceAllIcon = registerIcon('find-replace-all', Codicon.replaceAll, nls.localize(971, 'Icon for \'Replace All\' in the editor find widget.'));
|
|
34
|
+
export const findPreviousMatchIcon = registerIcon('find-previous-match', Codicon.arrowUp, nls.localize(972, 'Icon for \'Find Previous\' in the editor find widget.'));
|
|
35
|
+
export const findNextMatchIcon = registerIcon('find-next-match', Codicon.arrowDown, nls.localize(973, 'Icon for \'Find Next\' in the editor find widget.'));
|
|
36
|
+
const NLS_FIND_DIALOG_LABEL = nls.localize(974, "Find / Replace");
|
|
37
|
+
const NLS_FIND_INPUT_LABEL = nls.localize(975, "Find");
|
|
38
|
+
const NLS_FIND_INPUT_PLACEHOLDER = nls.localize(976, "Find");
|
|
39
|
+
const NLS_PREVIOUS_MATCH_BTN_LABEL = nls.localize(977, "Previous Match");
|
|
40
|
+
const NLS_NEXT_MATCH_BTN_LABEL = nls.localize(978, "Next Match");
|
|
41
|
+
const NLS_TOGGLE_SELECTION_FIND_TITLE = nls.localize(979, "Find in Selection");
|
|
42
|
+
const NLS_CLOSE_BTN_LABEL = nls.localize(980, "Close");
|
|
43
|
+
const NLS_REPLACE_INPUT_LABEL = nls.localize(981, "Replace");
|
|
44
|
+
const NLS_REPLACE_INPUT_PLACEHOLDER = nls.localize(982, "Replace");
|
|
45
|
+
const NLS_REPLACE_BTN_LABEL = nls.localize(983, "Replace");
|
|
46
|
+
const NLS_REPLACE_ALL_BTN_LABEL = nls.localize(984, "Replace All");
|
|
47
|
+
const NLS_TOGGLE_REPLACE_MODE_BTN_LABEL = nls.localize(985, "Toggle Replace");
|
|
48
|
+
const NLS_MATCHES_COUNT_LIMIT_TITLE = nls.localize(986, "Only the first {0} results are highlighted, but all find operations work on the entire text.", MATCHES_LIMIT);
|
|
49
|
+
export const NLS_MATCHES_LOCATION = nls.localize(987, "{0} of {1}");
|
|
50
|
+
export const NLS_NO_RESULTS = nls.localize(988, "No results");
|
|
51
51
|
const FIND_WIDGET_INITIAL_WIDTH = 419;
|
|
52
52
|
const PART_WIDTH = 275;
|
|
53
53
|
const FIND_INPUT_AREA_WIDTH = PART_WIDTH - 54;
|
|
@@ -324,11 +324,11 @@ export class FindWidget extends Widget {
|
|
|
324
324
|
_getAriaLabel(label, currentMatch, searchString) {
|
|
325
325
|
if (label === NLS_NO_RESULTS) {
|
|
326
326
|
return searchString === ''
|
|
327
|
-
? nls.localize(
|
|
328
|
-
: nls.localize(
|
|
327
|
+
? nls.localize(989, "{0} found", label)
|
|
328
|
+
: nls.localize(990, "{0} found for '{1}'", label, searchString);
|
|
329
329
|
}
|
|
330
330
|
if (currentMatch) {
|
|
331
|
-
const ariaLabel = nls.localize(
|
|
331
|
+
const ariaLabel = nls.localize(991, "{0} found for '{1}', at {2}", label, searchString, currentMatch.startLineNumber + ':' + currentMatch.startColumn);
|
|
332
332
|
const model = this._codeEditor.getModel();
|
|
333
333
|
if (model && (currentMatch.startLineNumber <= model.getLineCount()) && (currentMatch.startLineNumber >= 1)) {
|
|
334
334
|
const lineContent = model.getLineContent(currentMatch.startLineNumber);
|
|
@@ -336,7 +336,7 @@ export class FindWidget extends Widget {
|
|
|
336
336
|
}
|
|
337
337
|
return ariaLabel;
|
|
338
338
|
}
|
|
339
|
-
return nls.localize(
|
|
339
|
+
return nls.localize(992, "{0} found for '{1}'", label, searchString);
|
|
340
340
|
}
|
|
341
341
|
/**
|
|
342
342
|
* If 'selection find' is ON we should not disable the button (its function is to cancel 'selection find').
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
justify-content: center;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
.action-item.primary > .action-label
|
|
43
|
+
.action-item.primary > .action-label,
|
|
44
|
+
.action-item.primary > .action-label.action-label.codicon:not(.separator) {
|
|
44
45
|
background-color: var(--vscode-button-background);
|
|
45
46
|
color: var(--vscode-button-foreground);
|
|
46
47
|
}
|
|
@@ -12,9 +12,9 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
14
|
import { h } from '../../../../base/browser/dom.js';
|
|
15
|
-
import { Disposable } from '../../../../base/common/lifecycle.js';
|
|
15
|
+
import { Disposable, toDisposable } from '../../../../base/common/lifecycle.js';
|
|
16
|
+
import { getActionBarActions, MenuEntryActionViewItem } from '../../../../platform/actions/browser/menuEntryActionViewItem.js';
|
|
16
17
|
import { autorun, constObservable, derived, observableFromEvent } from '../../../../base/common/observable.js';
|
|
17
|
-
import { MenuEntryActionViewItem } from '../../../../platform/actions/browser/menuEntryActionViewItem.js';
|
|
18
18
|
import { MenuWorkbenchToolBar } from '../../../../platform/actions/browser/toolbar.js';
|
|
19
19
|
import { IMenuService, MenuId, MenuItemAction } from '../../../../platform/actions/common/actions.js';
|
|
20
20
|
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
|
|
@@ -25,39 +25,57 @@ let FloatingEditorToolbar = class FloatingEditorToolbar extends Disposable {
|
|
|
25
25
|
constructor(editor, instantiationService, keybindingService, menuService) {
|
|
26
26
|
super();
|
|
27
27
|
const editorObs = this._register(observableCodeEditor(editor));
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const navigationGroup = menuActions
|
|
37
|
-
.find((group) => group[0] === 'navigation');
|
|
38
|
-
// First action in navigation group
|
|
39
|
-
if (navigationGroup && navigationGroup[1].length > 0) {
|
|
40
|
-
return navigationGroup[1][0].id;
|
|
41
|
-
}
|
|
42
|
-
// Fallback to first group/action
|
|
43
|
-
for (const [, actions] of menuActions) {
|
|
44
|
-
if (actions.length > 0) {
|
|
45
|
-
return actions[0].id;
|
|
46
|
-
}
|
|
28
|
+
const editorUriObs = derived(reader => editorObs.model.read(reader)?.uri);
|
|
29
|
+
// Widget
|
|
30
|
+
const widget = this._register(instantiationService.createInstance(FloatingEditorToolbarWidget, MenuId.EditorContent, editor.contextKeyService, editorUriObs));
|
|
31
|
+
// Render widget
|
|
32
|
+
this._register(autorun(reader => {
|
|
33
|
+
const hasActions = widget.hasActions.read(reader);
|
|
34
|
+
if (!hasActions) {
|
|
35
|
+
return;
|
|
47
36
|
}
|
|
48
|
-
|
|
37
|
+
// Overlay widget
|
|
38
|
+
reader.store.add(editorObs.createOverlayWidget({
|
|
39
|
+
allowEditorOverflow: false,
|
|
40
|
+
domNode: widget.element,
|
|
41
|
+
minContentWidthInPx: constObservable(0),
|
|
42
|
+
position: constObservable({
|
|
43
|
+
preference: 1 /* OverlayWidgetPositionPreference.BOTTOM_RIGHT_CORNER */
|
|
44
|
+
})
|
|
45
|
+
}));
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
FloatingEditorToolbar = __decorate([
|
|
50
|
+
__param(1, IInstantiationService),
|
|
51
|
+
__param(2, IKeybindingService),
|
|
52
|
+
__param(3, IMenuService)
|
|
53
|
+
], FloatingEditorToolbar);
|
|
54
|
+
export { FloatingEditorToolbar };
|
|
55
|
+
let FloatingEditorToolbarWidget = class FloatingEditorToolbarWidget extends Disposable {
|
|
56
|
+
constructor(_menuId, _scopedContextKeyService, _toolbarContext, instantiationService, keybindingService, menuService) {
|
|
57
|
+
super();
|
|
58
|
+
const menu = this._register(menuService.createMenu(_menuId, _scopedContextKeyService));
|
|
59
|
+
const menuGroupsObs = observableFromEvent(this, menu.onDidChange, () => menu.getActions());
|
|
60
|
+
const menuPrimaryActionIdObs = derived(reader => {
|
|
61
|
+
const menuGroups = menuGroupsObs.read(reader);
|
|
62
|
+
const { primary } = getActionBarActions(menuGroups, () => true);
|
|
63
|
+
return primary.length > 0 ? primary[0].id : undefined;
|
|
49
64
|
});
|
|
65
|
+
this.hasActions = derived(reader => menuGroupsObs.read(reader).length > 0);
|
|
66
|
+
this.element = h('div.floating-menu-overlay-widget').root;
|
|
67
|
+
this._register(toDisposable(() => this.element.remove()));
|
|
68
|
+
// Set height explicitly to ensure that the floating menu element
|
|
69
|
+
// is rendered in the lower right corner at the correct position.
|
|
70
|
+
this.element.style.height = '26px';
|
|
50
71
|
this._register(autorun(reader => {
|
|
72
|
+
const hasActions = this.hasActions.read(reader);
|
|
51
73
|
const menuPrimaryActionId = menuPrimaryActionIdObs.read(reader);
|
|
52
|
-
if (!
|
|
74
|
+
if (!hasActions) {
|
|
53
75
|
return;
|
|
54
76
|
}
|
|
55
|
-
const container = h('div.floating-menu-overlay-widget');
|
|
56
|
-
// Set height explicitly to ensure that the floating menu element
|
|
57
|
-
// is rendered in the lower right corner at the correct position.
|
|
58
|
-
container.root.style.height = '26px';
|
|
59
77
|
// Toolbar
|
|
60
|
-
const toolbar = instantiationService.createInstance(MenuWorkbenchToolBar,
|
|
78
|
+
const toolbar = instantiationService.createInstance(MenuWorkbenchToolBar, this.element, _menuId, {
|
|
61
79
|
actionViewItemProvider: (action, options) => {
|
|
62
80
|
if (!(action instanceof MenuItemAction)) {
|
|
63
81
|
return undefined;
|
|
@@ -93,25 +111,16 @@ let FloatingEditorToolbar = class FloatingEditorToolbar extends Disposable {
|
|
|
93
111
|
});
|
|
94
112
|
reader.store.add(toolbar);
|
|
95
113
|
reader.store.add(autorun(reader => {
|
|
96
|
-
const
|
|
97
|
-
toolbar.context =
|
|
98
|
-
}));
|
|
99
|
-
// Overlay widget
|
|
100
|
-
reader.store.add(editorObs.createOverlayWidget({
|
|
101
|
-
allowEditorOverflow: false,
|
|
102
|
-
domNode: container.root,
|
|
103
|
-
minContentWidthInPx: constObservable(0),
|
|
104
|
-
position: constObservable({
|
|
105
|
-
preference: 1 /* OverlayWidgetPositionPreference.BOTTOM_RIGHT_CORNER */
|
|
106
|
-
})
|
|
114
|
+
const context = _toolbarContext.read(reader);
|
|
115
|
+
toolbar.context = context;
|
|
107
116
|
}));
|
|
108
117
|
}));
|
|
109
118
|
}
|
|
110
119
|
};
|
|
111
|
-
|
|
112
|
-
__param(
|
|
113
|
-
__param(
|
|
114
|
-
__param(
|
|
115
|
-
],
|
|
116
|
-
export {
|
|
120
|
+
FloatingEditorToolbarWidget = __decorate([
|
|
121
|
+
__param(3, IInstantiationService),
|
|
122
|
+
__param(4, IKeybindingService),
|
|
123
|
+
__param(5, IMenuService)
|
|
124
|
+
], FloatingEditorToolbarWidget);
|
|
125
|
+
export { FloatingEditorToolbarWidget };
|
|
117
126
|
//# sourceMappingURL=floatingMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/floatingMenu/browser/floatingMenu.ts","vs/editor/contrib/floatingMenu/browser/floatingMenu.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,CAAC,EAAE,MAAM,iCAAiC,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC/G,OAAO,EAAE,uBAAuB,EAAE,MAAM,iEAAiE,CAAC;AAC1G,OAAO,EAAsB,oBAAoB,EAAE,MAAM,iDAAiD,CAAC;AAC3G,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AACtG,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AACnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAE1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAGzE,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,UAAU;aACpC,OAAE,GAAG,gCAAH,AAAmC,CAAC;IAEtD,YACC,MAAmB,EACI,oBAA2C,EAC9C,iBAAqC,EAC3C,WAAyB;QAEvC,KAAK,EAAE,CAAC;QAER,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;QAE/D,MAAM,IAAI,GAAG,IAAI,CAAC,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ACD,EAAE,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,8BAA8B,EAAE,IAAI,EAAE,CAAC,CAAC;gBAClE,CAAC;gBACD,kBAAkB,mCAA2B;gBAC7C,WAAW,EAAE;oBACZ,iBAAiB,EAAE,IAAI;iBACvB;gBACD,eAAe,EAAE,uBAAuB;gBACxC,cAAc,EAAE;oBACf,YAAY,EAAE,GAAG,EAAE,CAAC,IAAI;oBACxB,6BAA6B,EAAE,IAAI;iBACnC;aACD,CAAC,CAAC;YAEH,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAC1B,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;gBACjC,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC3C,OAAO,CAAC,OAAO,GAAG,KAAK,EAAE,GAAG,CAAC;YAC9B,CAAC,CAAC,CAAC,CAAC;YAEJ,iBAAiB;YACjB,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,mBAAmB,CAAC;gBAC9C,mBAAmB,EAAE,KAAK;gBAC1B,OAAO,EAAE,SAAS,CAAC,IAAI;gBACvB,mBAAmB,EAAE,eAAe,CAAC,CAAC,CAAC;gBACvC,QAAQ,EAAE,eAAe,CAAC;oBACzB,UAAU,6DAAqD;iBAC/D,CAAC;aACF,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC,CAAC;IACL,CAAC;;AA5GW,qBAAqB;IAK/B,WAAA,qBAAqB,CAAA;IACrB,WAAA,kBAAkB,CAAA;IAClB,WAAA,YAAY,CAAA;GAPF,qBAAqB,CA6GjC","file":"floatingMenu.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { h } from '../../../../base/browser/dom.js';\nimport { Disposable } from '../../../../base/common/lifecycle.js';\nimport { autorun, constObservable, derived, observableFromEvent } from '../../../../base/common/observable.js';\nimport { MenuEntryActionViewItem } from '../../../../platform/actions/browser/menuEntryActionViewItem.js';\nimport { HiddenItemStrategy, MenuWorkbenchToolBar } from '../../../../platform/actions/browser/toolbar.js';\nimport { IMenuService, MenuId, MenuItemAction } from '../../../../platform/actions/common/actions.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ICodeEditor, OverlayWidgetPositionPreference } from '../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../browser/observableCodeEditor.js';\nimport { IEditorContribution } from '../../../common/editorCommon.js';\n\nexport class FloatingEditorToolbar extends Disposable implements IEditorContribution {\n\tstatic readonly ID = 'editor.contrib.floatingToolbar';\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IMenuService menuService: IMenuService\n\t) {\n\t\tsuper();\n\n\t\tconst editorObs = this._register(observableCodeEditor(editor));\n\n\t\tconst menu = this._register(menuService.createMenu(MenuId.EditorContent, editor.contextKeyService));\n\t\tconst menuActionsObs = observableFromEvent(this, menu.onDidChange, () => menu.getActions());\n\t\tconst menuPrimaryActionIdObs = derived(reader => {\n\t\t\tconst menuActions = menuActionsObs.read(reader);\n\t\t\tif (menuActions.length === 0) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Navigation group\n\t\t\tconst navigationGroup = menuActions\n\t\t\t\t.find((group) => group[0] === 'navigation');\n\n\t\t\t// First action in navigation group\n\t\t\tif (navigationGroup && navigationGroup[1].length > 0) {\n\t\t\t\treturn navigationGroup[1][0].id;\n\t\t\t}\n\n\t\t\t// Fallback to first group/action\n\t\t\tfor (const [, actions] of menuActions) {\n\t\t\t\tif (actions.length > 0) {\n\t\t\t\t\treturn actions[0].id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn undefined;\n\t\t});\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst menuPrimaryActionId = menuPrimaryActionIdObs.read(reader);\n\t\t\tif (!menuPrimaryActionId) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst container = h('div.floating-menu-overlay-widget');\n\n\t\t\t// Set height explicitly to ensure that the floating menu element\n\t\t\t// is rendered in the lower right corner at the correct position.\n\t\t\tcontainer.root.style.height = '26px';\n\n\t\t\t// Toolbar\n\t\t\tconst toolbar = instantiationService.createInstance(MenuWorkbenchToolBar, container.root, MenuId.EditorContent, {\n\t\t\t\tactionViewItemProvider: (action, options) => {\n\t\t\t\t\tif (!(action instanceof MenuItemAction)) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn instantiationService.createInstance(class extends MenuEntryActionViewItem {\n\t\t\t\t\t\toverride render(container: HTMLElement): void {\n\t\t\t\t\t\t\tsuper.render(container);\n\n\t\t\t\t\t\t\t// Highlight primary action\n\t\t\t\t\t\t\tif (action.id === menuPrimaryActionId) {\n\t\t\t\t\t\t\t\tthis.element?.classList.add('primary');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tprotected override updateLabel(): void {\n\t\t\t\t\t\t\tconst keybinding = keybindingService.lookupKeybinding(action.id);\n\t\t\t\t\t\t\tconst keybindingLabel = keybinding ? keybinding.getLabel() : undefined;\n\n\t\t\t\t\t\t\tif (this.options.label && this.label) {\n\t\t\t\t\t\t\t\tthis.label.textContent = keybindingLabel\n\t\t\t\t\t\t\t\t\t? `${this._commandAction.label} (${keybindingLabel})`\n\t\t\t\t\t\t\t\t\t: this._commandAction.label;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}, action, { ...options, keybindingNotRenderedWithLabel: true });\n\t\t\t\t},\n\t\t\t\thiddenItemStrategy: HiddenItemStrategy.Ignore,\n\t\t\t\tmenuOptions: {\n\t\t\t\t\tshouldForwardArgs: true\n\t\t\t\t},\n\t\t\t\ttelemetrySource: 'editor.overlayToolbar',\n\t\t\t\ttoolbarOptions: {\n\t\t\t\t\tprimaryGroup: () => true,\n\t\t\t\t\tuseSeparatorsInPrimaryActions: true\n\t\t\t\t},\n\t\t\t});\n\n\t\t\treader.store.add(toolbar);\n\t\t\treader.store.add(autorun(reader => {\n\t\t\t\tconst model = editorObs.model.read(reader);\n\t\t\t\ttoolbar.context = model?.uri;\n\t\t\t}));\n\n\t\t\t// Overlay widget\n\t\t\treader.store.add(editorObs.createOverlayWidget({\n\t\t\t\tallowEditorOverflow: false,\n\t\t\t\tdomNode: container.root,\n\t\t\t\tminContentWidthInPx: constObservable(0),\n\t\t\t\tposition: constObservable({\n\t\t\t\t\tpreference: OverlayWidgetPositionPreference.BOTTOM_RIGHT_CORNER\n\t\t\t\t})\n\t\t\t}));\n\t\t}));\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { h } from '../../../../base/browser/dom.js';\nimport { Disposable } from '../../../../base/common/lifecycle.js';\nimport { autorun, constObservable, derived, observableFromEvent } from '../../../../base/common/observable.js';\nimport { MenuEntryActionViewItem } from '../../../../platform/actions/browser/menuEntryActionViewItem.js';\nimport { HiddenItemStrategy, MenuWorkbenchToolBar } from '../../../../platform/actions/browser/toolbar.js';\nimport { IMenuService, MenuId, MenuItemAction } from '../../../../platform/actions/common/actions.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ICodeEditor, OverlayWidgetPositionPreference } from '../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../browser/observableCodeEditor.js';\nimport { IEditorContribution } from '../../../common/editorCommon.js';\n\nexport class FloatingEditorToolbar extends Disposable implements IEditorContribution {\n\tstatic readonly ID = 'editor.contrib.floatingToolbar';\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IMenuService menuService: IMenuService\n\t) {\n\t\tsuper();\n\n\t\tconst editorObs = this._register(observableCodeEditor(editor));\n\n\t\tconst menu = this._register(menuService.createMenu(MenuId.EditorContent, editor.contextKeyService));\n\t\tconst menuActionsObs = observableFromEvent(this, menu.onDidChange, () => menu.getActions());\n\t\tconst menuPrimaryActionIdObs = derived(reader => {\n\t\t\tconst menuActions = menuActionsObs.read(reader);\n\t\t\tif (menuActions.length === 0) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Navigation group\n\t\t\tconst navigationGroup = menuActions\n\t\t\t\t.find((group) => group[0] === 'navigation');\n\n\t\t\t// First action in navigation group\n\t\t\tif (navigationGroup && navigationGroup[1].length > 0) {\n\t\t\t\treturn navigationGroup[1][0].id;\n\t\t\t}\n\n\t\t\t// Fallback to first group/action\n\t\t\tfor (const [, actions] of menuActions) {\n\t\t\t\tif (actions.length > 0) {\n\t\t\t\t\treturn actions[0].id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn undefined;\n\t\t});\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst menuPrimaryActionId = menuPrimaryActionIdObs.read(reader);\n\t\t\tif (!menuPrimaryActionId) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst container = h('div.floating-menu-overlay-widget');\n\n\t\t\t// Set height explicitly to ensure that the floating menu element\n\t\t\t// is rendered in the lower right corner at the correct position.\n\t\t\tcontainer.root.style.height = '26px';\n\n\t\t\t// Toolbar\n\t\t\tconst toolbar = instantiationService.createInstance(MenuWorkbenchToolBar, container.root, MenuId.EditorContent, {\n\t\t\t\tactionViewItemProvider: (action, options) => {\n\t\t\t\t\tif (!(action instanceof MenuItemAction)) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn instantiationService.createInstance(class extends MenuEntryActionViewItem {\n\t\t\t\t\t\toverride render(container: HTMLElement): void {\n\t\t\t\t\t\t\tsuper.render(container);\n\n\t\t\t\t\t\t\t// Highlight primary action\n\t\t\t\t\t\t\tif (action.id === menuPrimaryActionId) {\n\t\t\t\t\t\t\t\tthis.element?.classList.add('primary');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tprotected override updateLabel(): void {\n\t\t\t\t\t\t\tconst keybinding = keybindingService.lookupKeybinding(action.id);\n\t\t\t\t\t\t\tconst keybindingLabel = keybinding ? keybinding.getLabel() : undefined;\n\n\t\t\t\t\t\t\tif (this.options.label && this.label) {\n\t\t\t\t\t\t\t\tthis.label.textContent = keybindingLabel\n\t\t\t\t\t\t\t\t\t? `${this._commandAction.label} (${keybindingLabel})`\n\t\t\t\t\t\t\t\t\t: this._commandAction.label;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}, action, { ...options, keybindingNotRenderedWithLabel: true });\n\t\t\t\t},\n\t\t\t\thiddenItemStrategy: HiddenItemStrategy.Ignore,\n\t\t\t\tmenuOptions: {\n\t\t\t\t\tshouldForwardArgs: true\n\t\t\t\t},\n\t\t\t\ttelemetrySource: 'editor.overlayToolbar',\n\t\t\t\ttoolbarOptions: {\n\t\t\t\t\tprimaryGroup: () => true,\n\t\t\t\t\tuseSeparatorsInPrimaryActions: true\n\t\t\t\t},\n\t\t\t});\n\n\t\t\treader.store.add(toolbar);\n\t\t\treader.store.add(autorun(reader => {\n\t\t\t\tconst model = editorObs.model.read(reader);\n\t\t\t\ttoolbar.context = model?.uri;\n\t\t\t}));\n\n\t\t\t// Overlay widget\n\t\t\treader.store.add(editorObs.createOverlayWidget({\n\t\t\t\tallowEditorOverflow: false,\n\t\t\t\tdomNode: container.root,\n\t\t\t\tminContentWidthInPx: constObservable(0),\n\t\t\t\tposition: constObservable({\n\t\t\t\t\tpreference: OverlayWidgetPositionPreference.BOTTOM_RIGHT_CORNER\n\t\t\t\t})\n\t\t\t}));\n\t\t}));\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/floatingMenu/browser/floatingMenu.ts","vs/editor/contrib/floatingMenu/browser/floatingMenu.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,CAAC,EAAE,MAAM,iCAAiC,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,iEAAiE,CAAC;AAC/H,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAe,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAE5H,OAAO,EAAsB,oBAAoB,EAAE,MAAM,iDAAiD,CAAC;AAC3G,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAEtG,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AACnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAE1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAGzE,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,UAAU;aACpC,OAAE,GAAG,gCAAH,AAAmC,CAAC;IAEtD,YACC,MAAmB,EACI,oBAA2C,EAC9C,iBAAqC,EAC3C,WAAyB;QAEvC,KAAK,EAAE,CAAC;QAER,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;QAC/D,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,S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EAAE,GAAG,EAAE,CAAC,IAAI;oBACxB,6BAA6B,EAAE,IAAI;iBACnC;aACD,CAAC,CAAC;YAEH,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAC1B,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;gBACjC,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC7C,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;YAC3B,CAAC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC,CAAC;IACL,CAAC;CACD,CAAA;AAxFY,2BAA2B;IAQrC,WAAA,qBAAqB,CAAA;IACrB,WAAA,kBAAkB,CAAA;IAClB,WAAA,YAAY,CAAA;GAVF,2BAA2B,CAwFvC","file":"floatingMenu.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { h } from '../../../../base/browser/dom.js';\nimport { Disposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { getActionBarActions, MenuEntryActionViewItem } from '../../../../platform/actions/browser/menuEntryActionViewItem.js';\nimport { autorun, constObservable, derived, IObservable, observableFromEvent } from '../../../../base/common/observable.js';\nimport { URI } from '../../../../base/common/uri.js';\nimport { HiddenItemStrategy, MenuWorkbenchToolBar } from '../../../../platform/actions/browser/toolbar.js';\nimport { IMenuService, MenuId, MenuItemAction } from '../../../../platform/actions/common/actions.js';\nimport { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ICodeEditor, OverlayWidgetPositionPreference } from '../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../browser/observableCodeEditor.js';\nimport { IEditorContribution } from '../../../common/editorCommon.js';\n\nexport class FloatingEditorToolbar extends Disposable implements IEditorContribution {\n\tstatic readonly ID = 'editor.contrib.floatingToolbar';\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IMenuService menuService: IMenuService\n\t) {\n\t\tsuper();\n\n\t\tconst editorObs = this._register(observableCodeEditor(editor));\n\t\tconst editorUriObs = derived(reader => editorObs.model.read(reader)?.uri);\n\n\t\t// Widget\n\t\tconst widget = this._register(instantiationService.createInstance(\n\t\t\tFloatingEditorToolbarWidget,\n\t\t\tMenuId.EditorContent,\n\t\t\teditor.contextKeyService,\n\t\t\teditorUriObs));\n\n\t\t// Render widget\n\t\tthis._register(autorun(reader => {\n\t\t\tconst hasActions = widget.hasActions.read(reader);\n\t\t\tif (!hasActions) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Overlay widget\n\t\t\treader.store.add(editorObs.createOverlayWidget({\n\t\t\t\tallowEditorOverflow: false,\n\t\t\t\tdomNode: widget.element,\n\t\t\t\tminContentWidthInPx: constObservable(0),\n\t\t\t\tposition: constObservable({\n\t\t\t\t\tpreference: OverlayWidgetPositionPreference.BOTTOM_RIGHT_CORNER\n\t\t\t\t})\n\t\t\t}));\n\t\t}));\n\t}\n}\n\nexport class FloatingEditorToolbarWidget extends Disposable {\n\treadonly element: HTMLElement;\n\treadonly hasActions: IObservable<boolean>;\n\n\tconstructor(\n\t\t_menuId: MenuId,\n\t\t_scopedContextKeyService: IContextKeyService,\n\t\t_toolbarContext: IObservable<URI | undefined>,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IMenuService menuService: IMenuService\n\t) {\n\t\tsuper();\n\n\t\tconst menu = this._register(menuService.createMenu(_menuId, _scopedContextKeyService));\n\t\tconst menuGroupsObs = observableFromEvent(this, menu.onDidChange, () => menu.getActions());\n\n\t\tconst menuPrimaryActionIdObs = derived(reader => {\n\t\t\tconst menuGroups = menuGroupsObs.read(reader);\n\n\t\t\tconst { primary } = getActionBarActions(menuGroups, () => true);\n\t\t\treturn primary.length > 0 ? primary[0].id : undefined;\n\t\t});\n\n\t\tthis.hasActions = derived(reader => menuGroupsObs.read(reader).length > 0);\n\n\t\tthis.element = h('div.floating-menu-overlay-widget').root;\n\t\tthis._register(toDisposable(() => this.element.remove()));\n\n\t\t// Set height explicitly to ensure that the floating menu element\n\t\t// is rendered in the lower right corner at the correct position.\n\t\tthis.element.style.height = '26px';\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst hasActions = this.hasActions.read(reader);\n\t\t\tconst menuPrimaryActionId = menuPrimaryActionIdObs.read(reader);\n\n\t\t\tif (!hasActions) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Toolbar\n\t\t\tconst toolbar = instantiationService.createInstance(MenuWorkbenchToolBar, this.element, _menuId, {\n\t\t\t\tactionViewItemProvider: (action, options) => {\n\t\t\t\t\tif (!(action instanceof MenuItemAction)) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn instantiationService.createInstance(class extends MenuEntryActionViewItem {\n\t\t\t\t\t\toverride render(container: HTMLElement): void {\n\t\t\t\t\t\t\tsuper.render(container);\n\n\t\t\t\t\t\t\t// Highlight primary action\n\t\t\t\t\t\t\tif (action.id === menuPrimaryActionId) {\n\t\t\t\t\t\t\t\tthis.element?.classList.add('primary');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tprotected override updateLabel(): void {\n\t\t\t\t\t\t\tconst keybinding = keybindingService.lookupKeybinding(action.id);\n\t\t\t\t\t\t\tconst keybindingLabel = keybinding ? keybinding.getLabel() : undefined;\n\n\t\t\t\t\t\t\tif (this.options.label && this.label) {\n\t\t\t\t\t\t\t\tthis.label.textContent = keybindingLabel\n\t\t\t\t\t\t\t\t\t? `${this._commandAction.label} (${keybindingLabel})`\n\t\t\t\t\t\t\t\t\t: this._commandAction.label;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}, action, { ...options, keybindingNotRenderedWithLabel: true });\n\t\t\t\t},\n\t\t\t\thiddenItemStrategy: HiddenItemStrategy.Ignore,\n\t\t\t\tmenuOptions: {\n\t\t\t\t\tshouldForwardArgs: true\n\t\t\t\t},\n\t\t\t\ttelemetrySource: 'editor.overlayToolbar',\n\t\t\t\ttoolbarOptions: {\n\t\t\t\t\tprimaryGroup: () => true,\n\t\t\t\t\tuseSeparatorsInPrimaryActions: true\n\t\t\t\t},\n\t\t\t});\n\n\t\t\treader.store.add(toolbar);\n\t\t\treader.store.add(autorun(reader => {\n\t\t\t\tconst context = _toolbarContext.read(reader);\n\t\t\t\ttoolbar.context = context;\n\t\t\t}));\n\t\t}));\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { h } from '../../../../base/browser/dom.js';\nimport { Disposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { getActionBarActions, MenuEntryActionViewItem } from '../../../../platform/actions/browser/menuEntryActionViewItem.js';\nimport { autorun, constObservable, derived, IObservable, observableFromEvent } from '../../../../base/common/observable.js';\nimport { URI } from '../../../../base/common/uri.js';\nimport { HiddenItemStrategy, MenuWorkbenchToolBar } from '../../../../platform/actions/browser/toolbar.js';\nimport { IMenuService, MenuId, MenuItemAction } from '../../../../platform/actions/common/actions.js';\nimport { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ICodeEditor, OverlayWidgetPositionPreference } from '../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../browser/observableCodeEditor.js';\nimport { IEditorContribution } from '../../../common/editorCommon.js';\n\nexport class FloatingEditorToolbar extends Disposable implements IEditorContribution {\n\tstatic readonly ID = 'editor.contrib.floatingToolbar';\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IMenuService menuService: IMenuService\n\t) {\n\t\tsuper();\n\n\t\tconst editorObs = this._register(observableCodeEditor(editor));\n\t\tconst editorUriObs = derived(reader => editorObs.model.read(reader)?.uri);\n\n\t\t// Widget\n\t\tconst widget = this._register(instantiationService.createInstance(\n\t\t\tFloatingEditorToolbarWidget,\n\t\t\tMenuId.EditorContent,\n\t\t\teditor.contextKeyService,\n\t\t\teditorUriObs));\n\n\t\t// Render widget\n\t\tthis._register(autorun(reader => {\n\t\t\tconst hasActions = widget.hasActions.read(reader);\n\t\t\tif (!hasActions) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Overlay widget\n\t\t\treader.store.add(editorObs.createOverlayWidget({\n\t\t\t\tallowEditorOverflow: false,\n\t\t\t\tdomNode: widget.element,\n\t\t\t\tminContentWidthInPx: constObservable(0),\n\t\t\t\tposition: constObservable({\n\t\t\t\t\tpreference: OverlayWidgetPositionPreference.BOTTOM_RIGHT_CORNER\n\t\t\t\t})\n\t\t\t}));\n\t\t}));\n\t}\n}\n\nexport class FloatingEditorToolbarWidget extends Disposable {\n\treadonly element: HTMLElement;\n\treadonly hasActions: IObservable<boolean>;\n\n\tconstructor(\n\t\t_menuId: MenuId,\n\t\t_scopedContextKeyService: IContextKeyService,\n\t\t_toolbarContext: IObservable<URI | undefined>,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IMenuService menuService: IMenuService\n\t) {\n\t\tsuper();\n\n\t\tconst menu = this._register(menuService.createMenu(_menuId, _scopedContextKeyService));\n\t\tconst menuGroupsObs = observableFromEvent(this, menu.onDidChange, () => menu.getActions());\n\n\t\tconst menuPrimaryActionIdObs = derived(reader => {\n\t\t\tconst menuGroups = menuGroupsObs.read(reader);\n\n\t\t\tconst { primary } = getActionBarActions(menuGroups, () => true);\n\t\t\treturn primary.length > 0 ? primary[0].id : undefined;\n\t\t});\n\n\t\tthis.hasActions = derived(reader => menuGroupsObs.read(reader).length > 0);\n\n\t\tthis.element = h('div.floating-menu-overlay-widget').root;\n\t\tthis._register(toDisposable(() => this.element.remove()));\n\n\t\t// Set height explicitly to ensure that the floating menu element\n\t\t// is rendered in the lower right corner at the correct position.\n\t\tthis.element.style.height = '26px';\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst hasActions = this.hasActions.read(reader);\n\t\t\tconst menuPrimaryActionId = menuPrimaryActionIdObs.read(reader);\n\n\t\t\tif (!hasActions) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Toolbar\n\t\t\tconst toolbar = instantiationService.createInstance(MenuWorkbenchToolBar, this.element, _menuId, {\n\t\t\t\tactionViewItemProvider: (action, options) => {\n\t\t\t\t\tif (!(action instanceof MenuItemAction)) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn instantiationService.createInstance(class extends MenuEntryActionViewItem {\n\t\t\t\t\t\toverride render(container: HTMLElement): void {\n\t\t\t\t\t\t\tsuper.render(container);\n\n\t\t\t\t\t\t\t// Highlight primary action\n\t\t\t\t\t\t\tif (action.id === menuPrimaryActionId) {\n\t\t\t\t\t\t\t\tthis.element?.classList.add('primary');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tprotected override updateLabel(): void {\n\t\t\t\t\t\t\tconst keybinding = keybindingService.lookupKeybinding(action.id);\n\t\t\t\t\t\t\tconst keybindingLabel = keybinding ? keybinding.getLabel() : undefined;\n\n\t\t\t\t\t\t\tif (this.options.label && this.label) {\n\t\t\t\t\t\t\t\tthis.label.textContent = keybindingLabel\n\t\t\t\t\t\t\t\t\t? `${this._commandAction.label} (${keybindingLabel})`\n\t\t\t\t\t\t\t\t\t: this._commandAction.label;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}, action, { ...options, keybindingNotRenderedWithLabel: true });\n\t\t\t\t},\n\t\t\t\thiddenItemStrategy: HiddenItemStrategy.Ignore,\n\t\t\t\tmenuOptions: {\n\t\t\t\t\tshouldForwardArgs: true\n\t\t\t\t},\n\t\t\t\ttelemetrySource: 'editor.overlayToolbar',\n\t\t\t\ttoolbarOptions: {\n\t\t\t\t\tprimaryGroup: () => true,\n\t\t\t\t\tuseSeparatorsInPrimaryActions: true\n\t\t\t\t},\n\t\t\t});\n\n\t\t\treader.store.add(toolbar);\n\t\t\treader.store.add(autorun(reader => {\n\t\t\t\tconst context = _toolbarContext.read(reader);\n\t\t\t\ttoolbar.context = context;\n\t\t\t}));\n\t\t}));\n\t}\n}\n"]}
|