monaco-editor-core 0.54.0-dev-20250910 → 0.54.0-dev-20250911
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.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.ru.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 +8 -2
- package/esm/vs/base/browser/domSanitize.js +32 -21
- package/esm/vs/base/browser/domSanitize.js.map +1 -1
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/common/codiconsLibrary.js +2 -0
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/editor/browser/config/editorConfiguration.js +1 -1
- package/esm/vs/editor/browser/controller/dragScrolling.js +4 -4
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +3 -3
- package/esm/vs/editor/browser/controller/editContext/native/screenReaderContentRich.js +3 -3
- package/esm/vs/editor/browser/controller/editContext/native/screenReaderSupport.js +6 -6
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +9 -9
- package/esm/vs/editor/browser/controller/mouseHandler.js +6 -6
- package/esm/vs/editor/browser/controller/mouseTarget.js +3 -3
- package/esm/vs/editor/browser/coreCommands.js +2 -2
- package/esm/vs/editor/browser/gpu/rectangleRenderer.js +1 -1
- package/esm/vs/editor/browser/gpu/viewGpuContext.js +1 -1
- package/esm/vs/editor/browser/observableCodeEditor.js +1 -1
- package/esm/vs/editor/browser/view/viewController.js +2 -2
- package/esm/vs/editor/browser/view/viewLayer.js +1 -1
- package/esm/vs/editor/browser/view/viewOverlays.js +4 -4
- package/esm/vs/editor/browser/view.js +5 -5
- package/esm/vs/editor/browser/viewParts/blockDecorations/blockDecorations.js +1 -1
- package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +3 -3
- package/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js +6 -6
- package/esm/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.js +8 -8
- package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +2 -2
- package/esm/vs/editor/browser/viewParts/indentGuides/indentGuides.js +2 -2
- package/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.js +2 -2
- package/esm/vs/editor/browser/viewParts/linesDecorations/linesDecorations.js +2 -2
- package/esm/vs/editor/browser/viewParts/margin/margin.js +2 -2
- package/esm/vs/editor/browser/viewParts/minimap/minimap.js +5 -5
- package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js +2 -2
- package/esm/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.js +4 -4
- package/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js +3 -3
- package/esm/vs/editor/browser/viewParts/rulers/rulers.js +2 -2
- package/esm/vs/editor/browser/viewParts/rulersGpu/rulersGpu.js +1 -1
- package/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js +3 -3
- package/esm/vs/editor/browser/viewParts/selections/selections.js +2 -2
- package/esm/vs/editor/browser/viewParts/viewCursors/viewCursor.js +2 -2
- package/esm/vs/editor/browser/viewParts/viewCursors/viewCursors.js +6 -6
- package/esm/vs/editor/browser/viewParts/viewLines/viewLineOptions.js +4 -4
- package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js +11 -11
- package/esm/vs/editor/browser/viewParts/viewLinesGpu/viewLinesGpu.js +1 -1
- package/esm/vs/editor/browser/viewParts/viewZones/viewZones.js +2 -2
- package/esm/vs/editor/browser/viewParts/whitespace/whitespace.js +4 -4
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +12 -12
- package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +4 -4
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +3 -3
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/features/gutterFeature.js +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/features/overviewRulerFeature.js +1 -1
- package/esm/vs/editor/common/config/editorOptions.js +155 -154
- package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
- package/esm/vs/editor/common/core/editorColorRegistry.js +68 -68
- package/esm/vs/editor/common/cursorCommon.js +19 -19
- package/esm/vs/editor/common/editorContextKeys.js +46 -46
- 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/standalone/standaloneEnums.js +86 -85
- package/esm/vs/editor/common/standalone/standaloneEnums.js.map +1 -1
- package/esm/vs/editor/common/standaloneStrings.js +10 -10
- package/esm/vs/editor/common/viewLayout/viewLayout.js +15 -15
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
- package/esm/vs/editor/common/viewModel/monospaceLineBreaksComputer.js +1 -1
- package/esm/vs/editor/common/viewModel/viewModelImpl.js +14 -14
- 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 +20 -20
- package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
- package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
- 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/codeActionModel.js +1 -1
- 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/colorDetector.js +3 -3
- 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/hoverColorPickerContribution.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +2 -2
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerParticipant.js +1 -1
- package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +12 -12
- 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 +12 -12
- 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 +17 -17
- package/esm/vs/editor/contrib/find/browser/findModel.js +6 -6
- package/esm/vs/editor/contrib/find/browser/findWidget.js +32 -32
- package/esm/vs/editor/contrib/folding/browser/folding.js +23 -23
- package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
- package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js.map +1 -1
- 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/clickLinkGesture.js +21 -11
- package/esm/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.js.map +1 -1
- package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +2 -2
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +4 -4
- 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/markdownHoverParticipant.js +10 -10
- package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +6 -6
- 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/inlayHintsController.js +5 -5
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +19 -19
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +12 -12
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +5 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +5 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
- 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 +32 -32
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +4 -4
- package/esm/vs/editor/contrib/links/browser/links.js +11 -11
- package/esm/vs/editor/contrib/links/browser/links.js.map +1 -1
- package/esm/vs/editor/contrib/longLinesHelper/browser/longLinesHelper.js +1 -1
- package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/esm/vs/editor/contrib/middleScroll/browser/middleScrollController.js +1 -1
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +36 -36
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsModel.js +3 -3
- 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/placeholderText/browser/placeholderTextContribution.js +1 -1
- package/esm/vs/editor/contrib/placeholderText/browser/placeholderTextContribution.js.map +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +5 -5
- package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
- package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +3 -3
- 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 +5 -5
- package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetSession.js +2 -2
- 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/stickyScroll/browser/stickyScrollController.js +17 -24
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js.map +1 -1
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.js +1 -1
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.js +12 -3
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.js.map +1 -1
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +5 -5
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +8 -8
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +14 -14
- package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/suggestModel.js +11 -11
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +23 -23
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +5 -5
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +5 -5
- package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +3 -3
- package/esm/vs/editor/contrib/suggest/browser/wordDistance.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 +27 -27
- package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +7 -7
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +4 -4
- package/esm/vs/editor/editor.api.d.ts +93 -85
- package/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js +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 +4 -4
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
- package/esm/vs/platform/actions/browser/toolbar.js +2 -2
- 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/keybinding/common/abstractKeybindingService.js +4 -4
- 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 +7 -7
- package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInput.js +20 -12
- package/esm/vs/platform/quickinput/browser/quickInput.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputActions.js +42 -8
- package/esm/vs/platform/quickinput/browser/quickInputActions.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -64
- package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
- 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/common/quickInput.js.map +1 -1
- package/esm/vs/platform/theme/common/colorUtils.js +2 -2
- package/esm/vs/platform/theme/common/colors/baseColors.js +17 -17
- 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 +15 -15
- 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/monaco.d.ts +93 -85
- package/package.json +2 -2
- package/version.txt +1 -1
|
@@ -8,63 +8,63 @@ import { localize } from '../../../../../../nls.js';
|
|
|
8
8
|
import { buttonBackground, buttonForeground, buttonSecondaryBackground, buttonSecondaryForeground, diffInserted, diffInsertedLine, diffRemoved, editorBackground } from '../../../../../../platform/theme/common/colorRegistry.js';
|
|
9
9
|
import { darken, registerColor, transparent } from '../../../../../../platform/theme/common/colorUtils.js';
|
|
10
10
|
import { InlineEditTabAction } from './inlineEditsViewInterface.js';
|
|
11
|
-
export const originalBackgroundColor = registerColor('inlineEdit.originalBackground', transparent(diffRemoved, 0.2), localize(
|
|
12
|
-
export const modifiedBackgroundColor = registerColor('inlineEdit.modifiedBackground', transparent(diffInserted, 0.3), localize(
|
|
13
|
-
export const originalChangedLineBackgroundColor = registerColor('inlineEdit.originalChangedLineBackground', transparent(diffRemoved, 0.8), localize(
|
|
14
|
-
export const originalChangedTextOverlayColor = registerColor('inlineEdit.originalChangedTextBackground', transparent(diffRemoved, 0.8), localize(
|
|
11
|
+
export const originalBackgroundColor = registerColor('inlineEdit.originalBackground', transparent(diffRemoved, 0.2), localize(1208, 'Background color for the original text in inline edits.'), true);
|
|
12
|
+
export const modifiedBackgroundColor = registerColor('inlineEdit.modifiedBackground', transparent(diffInserted, 0.3), localize(1209, 'Background color for the modified text in inline edits.'), true);
|
|
13
|
+
export const originalChangedLineBackgroundColor = registerColor('inlineEdit.originalChangedLineBackground', transparent(diffRemoved, 0.8), localize(1210, 'Background color for the changed lines in the original text of inline edits.'), true);
|
|
14
|
+
export const originalChangedTextOverlayColor = registerColor('inlineEdit.originalChangedTextBackground', transparent(diffRemoved, 0.8), localize(1211, 'Overlay color for the changed text in the original text of inline edits.'), true);
|
|
15
15
|
export const modifiedChangedLineBackgroundColor = registerColor('inlineEdit.modifiedChangedLineBackground', {
|
|
16
16
|
light: transparent(diffInsertedLine, 0.7),
|
|
17
17
|
dark: transparent(diffInsertedLine, 0.7),
|
|
18
18
|
hcDark: diffInsertedLine,
|
|
19
19
|
hcLight: diffInsertedLine
|
|
20
|
-
}, localize(
|
|
21
|
-
export const modifiedChangedTextOverlayColor = registerColor('inlineEdit.modifiedChangedTextBackground', transparent(diffInserted, 0.7), localize(
|
|
20
|
+
}, localize(1212, 'Background color for the changed lines in the modified text of inline edits.'), true);
|
|
21
|
+
export const modifiedChangedTextOverlayColor = registerColor('inlineEdit.modifiedChangedTextBackground', transparent(diffInserted, 0.7), localize(1213, 'Overlay color for the changed text in the modified text of inline edits.'), true);
|
|
22
22
|
// ------- GUTTER INDICATOR -------
|
|
23
|
-
export const inlineEditIndicatorPrimaryForeground = registerColor('inlineEdit.gutterIndicator.primaryForeground', buttonForeground, localize(
|
|
24
|
-
export const inlineEditIndicatorPrimaryBorder = registerColor('inlineEdit.gutterIndicator.primaryBorder', buttonBackground, localize(
|
|
23
|
+
export const inlineEditIndicatorPrimaryForeground = registerColor('inlineEdit.gutterIndicator.primaryForeground', buttonForeground, localize(1214, 'Foreground color for the primary inline edit gutter indicator.'));
|
|
24
|
+
export const inlineEditIndicatorPrimaryBorder = registerColor('inlineEdit.gutterIndicator.primaryBorder', buttonBackground, localize(1215, 'Border color for the primary inline edit gutter indicator.'));
|
|
25
25
|
export const inlineEditIndicatorPrimaryBackground = registerColor('inlineEdit.gutterIndicator.primaryBackground', {
|
|
26
26
|
light: transparent(inlineEditIndicatorPrimaryBorder, 0.5),
|
|
27
27
|
dark: transparent(inlineEditIndicatorPrimaryBorder, 0.4),
|
|
28
28
|
hcDark: transparent(inlineEditIndicatorPrimaryBorder, 0.4),
|
|
29
29
|
hcLight: transparent(inlineEditIndicatorPrimaryBorder, 0.5),
|
|
30
|
-
}, localize(
|
|
31
|
-
export const inlineEditIndicatorSecondaryForeground = registerColor('inlineEdit.gutterIndicator.secondaryForeground', buttonSecondaryForeground, localize(
|
|
32
|
-
export const inlineEditIndicatorSecondaryBorder = registerColor('inlineEdit.gutterIndicator.secondaryBorder', buttonSecondaryBackground, localize(
|
|
33
|
-
export const inlineEditIndicatorSecondaryBackground = registerColor('inlineEdit.gutterIndicator.secondaryBackground', inlineEditIndicatorSecondaryBorder, localize(
|
|
34
|
-
export const inlineEditIndicatorsuccessfulForeground = registerColor('inlineEdit.gutterIndicator.successfulForeground', buttonForeground, localize(
|
|
35
|
-
export const inlineEditIndicatorsuccessfulBorder = registerColor('inlineEdit.gutterIndicator.successfulBorder', buttonBackground, localize(
|
|
36
|
-
export const inlineEditIndicatorsuccessfulBackground = registerColor('inlineEdit.gutterIndicator.successfulBackground', inlineEditIndicatorsuccessfulBorder, localize(
|
|
30
|
+
}, localize(1216, 'Background color for the primary inline edit gutter indicator.'));
|
|
31
|
+
export const inlineEditIndicatorSecondaryForeground = registerColor('inlineEdit.gutterIndicator.secondaryForeground', buttonSecondaryForeground, localize(1217, 'Foreground color for the secondary inline edit gutter indicator.'));
|
|
32
|
+
export const inlineEditIndicatorSecondaryBorder = registerColor('inlineEdit.gutterIndicator.secondaryBorder', buttonSecondaryBackground, localize(1218, 'Border color for the secondary inline edit gutter indicator.'));
|
|
33
|
+
export const inlineEditIndicatorSecondaryBackground = registerColor('inlineEdit.gutterIndicator.secondaryBackground', inlineEditIndicatorSecondaryBorder, localize(1219, 'Background color for the secondary inline edit gutter indicator.'));
|
|
34
|
+
export const inlineEditIndicatorsuccessfulForeground = registerColor('inlineEdit.gutterIndicator.successfulForeground', buttonForeground, localize(1220, 'Foreground color for the successful inline edit gutter indicator.'));
|
|
35
|
+
export const inlineEditIndicatorsuccessfulBorder = registerColor('inlineEdit.gutterIndicator.successfulBorder', buttonBackground, localize(1221, 'Border color for the successful inline edit gutter indicator.'));
|
|
36
|
+
export const inlineEditIndicatorsuccessfulBackground = registerColor('inlineEdit.gutterIndicator.successfulBackground', inlineEditIndicatorsuccessfulBorder, localize(1222, 'Background color for the successful inline edit gutter indicator.'));
|
|
37
37
|
export const inlineEditIndicatorBackground = registerColor('inlineEdit.gutterIndicator.background', {
|
|
38
38
|
hcDark: transparent('tab.inactiveBackground', 0.5),
|
|
39
39
|
hcLight: transparent('tab.inactiveBackground', 0.5),
|
|
40
40
|
dark: transparent('tab.inactiveBackground', 0.5),
|
|
41
41
|
light: '#5f5f5f18',
|
|
42
|
-
}, localize(
|
|
42
|
+
}, localize(1223, 'Background color for the inline edit gutter indicator.'));
|
|
43
43
|
// ------- BORDER COLORS -------
|
|
44
44
|
const originalBorder = registerColor('inlineEdit.originalBorder', {
|
|
45
45
|
light: diffRemoved,
|
|
46
46
|
dark: diffRemoved,
|
|
47
47
|
hcDark: diffRemoved,
|
|
48
48
|
hcLight: diffRemoved
|
|
49
|
-
}, localize(
|
|
49
|
+
}, localize(1224, 'Border color for the original text in inline edits.'));
|
|
50
50
|
const modifiedBorder = registerColor('inlineEdit.modifiedBorder', {
|
|
51
51
|
light: darken(diffInserted, 0.6),
|
|
52
52
|
dark: diffInserted,
|
|
53
53
|
hcDark: diffInserted,
|
|
54
54
|
hcLight: diffInserted
|
|
55
|
-
}, localize(
|
|
55
|
+
}, localize(1225, 'Border color for the modified text in inline edits.'));
|
|
56
56
|
const tabWillAcceptModifiedBorder = registerColor('inlineEdit.tabWillAcceptModifiedBorder', {
|
|
57
57
|
light: darken(modifiedBorder, 0),
|
|
58
58
|
dark: darken(modifiedBorder, 0),
|
|
59
59
|
hcDark: darken(modifiedBorder, 0),
|
|
60
60
|
hcLight: darken(modifiedBorder, 0)
|
|
61
|
-
}, localize(
|
|
61
|
+
}, localize(1226, 'Modified border color for the inline edits widget when tab will accept it.'));
|
|
62
62
|
const tabWillAcceptOriginalBorder = registerColor('inlineEdit.tabWillAcceptOriginalBorder', {
|
|
63
63
|
light: darken(originalBorder, 0),
|
|
64
64
|
dark: darken(originalBorder, 0),
|
|
65
65
|
hcDark: darken(originalBorder, 0),
|
|
66
66
|
hcLight: darken(originalBorder, 0)
|
|
67
|
-
}, localize(
|
|
67
|
+
}, localize(1227, 'Original border color for the inline edits widget over the original text when tab will accept it.'));
|
|
68
68
|
export function getModifiedBorderColor(tabAction) {
|
|
69
69
|
return tabAction.map(a => a === InlineEditTabAction.Accept ? tabWillAcceptModifiedBorder : modifiedBorder);
|
|
70
70
|
}
|
|
@@ -11,7 +11,7 @@ export class InsertFinalNewLineAction extends EditorAction {
|
|
|
11
11
|
constructor() {
|
|
12
12
|
super({
|
|
13
13
|
id: InsertFinalNewLineAction.ID,
|
|
14
|
-
label: nls.localize2(
|
|
14
|
+
label: nls.localize2(1230, "Insert Final New Line"),
|
|
15
15
|
precondition: EditorContextKeys.writable
|
|
16
16
|
});
|
|
17
17
|
}
|
|
@@ -10,7 +10,7 @@ export class ExpandLineSelectionAction extends EditorAction {
|
|
|
10
10
|
constructor() {
|
|
11
11
|
super({
|
|
12
12
|
id: 'expandLineSelection',
|
|
13
|
-
label: nls.localize2(
|
|
13
|
+
label: nls.localize2(1231, "Expand Line Selection"),
|
|
14
14
|
precondition: undefined,
|
|
15
15
|
kbOpts: {
|
|
16
16
|
weight: 0 /* KeybindingWeight.EditorCore */,
|
|
@@ -63,7 +63,7 @@ class CopyLinesUpAction extends AbstractCopyLinesAction {
|
|
|
63
63
|
constructor() {
|
|
64
64
|
super(false, {
|
|
65
65
|
id: 'editor.action.copyLinesUpAction',
|
|
66
|
-
label: nls.localize2(
|
|
66
|
+
label: nls.localize2(1237, "Copy Line Up"),
|
|
67
67
|
precondition: EditorContextKeys.writable,
|
|
68
68
|
kbOpts: {
|
|
69
69
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -74,7 +74,7 @@ class CopyLinesUpAction extends AbstractCopyLinesAction {
|
|
|
74
74
|
menuOpts: {
|
|
75
75
|
menuId: MenuId.MenubarSelectionMenu,
|
|
76
76
|
group: '2_line',
|
|
77
|
-
title: nls.localize(
|
|
77
|
+
title: nls.localize(1232, "&&Copy Line Up"),
|
|
78
78
|
order: 1
|
|
79
79
|
}
|
|
80
80
|
});
|
|
@@ -84,7 +84,7 @@ class CopyLinesDownAction extends AbstractCopyLinesAction {
|
|
|
84
84
|
constructor() {
|
|
85
85
|
super(true, {
|
|
86
86
|
id: 'editor.action.copyLinesDownAction',
|
|
87
|
-
label: nls.localize2(
|
|
87
|
+
label: nls.localize2(1238, "Copy Line Down"),
|
|
88
88
|
precondition: EditorContextKeys.writable,
|
|
89
89
|
kbOpts: {
|
|
90
90
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -95,7 +95,7 @@ class CopyLinesDownAction extends AbstractCopyLinesAction {
|
|
|
95
95
|
menuOpts: {
|
|
96
96
|
menuId: MenuId.MenubarSelectionMenu,
|
|
97
97
|
group: '2_line',
|
|
98
|
-
title: nls.localize(
|
|
98
|
+
title: nls.localize(1233, "Co&&py Line Down"),
|
|
99
99
|
order: 2
|
|
100
100
|
}
|
|
101
101
|
});
|
|
@@ -105,12 +105,12 @@ export class DuplicateSelectionAction extends EditorAction {
|
|
|
105
105
|
constructor() {
|
|
106
106
|
super({
|
|
107
107
|
id: 'editor.action.duplicateSelection',
|
|
108
|
-
label: nls.localize2(
|
|
108
|
+
label: nls.localize2(1239, "Duplicate Selection"),
|
|
109
109
|
precondition: EditorContextKeys.writable,
|
|
110
110
|
menuOpts: {
|
|
111
111
|
menuId: MenuId.MenubarSelectionMenu,
|
|
112
112
|
group: '2_line',
|
|
113
|
-
title: nls.localize(
|
|
113
|
+
title: nls.localize(1234, "&&Duplicate Selection"),
|
|
114
114
|
order: 5
|
|
115
115
|
}
|
|
116
116
|
});
|
|
@@ -159,7 +159,7 @@ class MoveLinesUpAction extends AbstractMoveLinesAction {
|
|
|
159
159
|
constructor() {
|
|
160
160
|
super(false, {
|
|
161
161
|
id: 'editor.action.moveLinesUpAction',
|
|
162
|
-
label: nls.localize2(
|
|
162
|
+
label: nls.localize2(1240, "Move Line Up"),
|
|
163
163
|
precondition: EditorContextKeys.writable,
|
|
164
164
|
kbOpts: {
|
|
165
165
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -170,7 +170,7 @@ class MoveLinesUpAction extends AbstractMoveLinesAction {
|
|
|
170
170
|
menuOpts: {
|
|
171
171
|
menuId: MenuId.MenubarSelectionMenu,
|
|
172
172
|
group: '2_line',
|
|
173
|
-
title: nls.localize(
|
|
173
|
+
title: nls.localize(1235, "Mo&&ve Line Up"),
|
|
174
174
|
order: 3
|
|
175
175
|
}
|
|
176
176
|
});
|
|
@@ -180,7 +180,7 @@ class MoveLinesDownAction extends AbstractMoveLinesAction {
|
|
|
180
180
|
constructor() {
|
|
181
181
|
super(true, {
|
|
182
182
|
id: 'editor.action.moveLinesDownAction',
|
|
183
|
-
label: nls.localize2(
|
|
183
|
+
label: nls.localize2(1241, "Move Line Down"),
|
|
184
184
|
precondition: EditorContextKeys.writable,
|
|
185
185
|
kbOpts: {
|
|
186
186
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -191,7 +191,7 @@ class MoveLinesDownAction extends AbstractMoveLinesAction {
|
|
|
191
191
|
menuOpts: {
|
|
192
192
|
menuId: MenuId.MenubarSelectionMenu,
|
|
193
193
|
group: '2_line',
|
|
194
|
-
title: nls.localize(
|
|
194
|
+
title: nls.localize(1236, "Move &&Line Down"),
|
|
195
195
|
order: 4
|
|
196
196
|
}
|
|
197
197
|
});
|
|
@@ -230,7 +230,7 @@ export class SortLinesAscendingAction extends AbstractSortLinesAction {
|
|
|
230
230
|
constructor() {
|
|
231
231
|
super(false, {
|
|
232
232
|
id: 'editor.action.sortLinesAscending',
|
|
233
|
-
label: nls.localize2(
|
|
233
|
+
label: nls.localize2(1242, "Sort Lines Ascending"),
|
|
234
234
|
precondition: EditorContextKeys.writable
|
|
235
235
|
});
|
|
236
236
|
}
|
|
@@ -239,7 +239,7 @@ export class SortLinesDescendingAction extends AbstractSortLinesAction {
|
|
|
239
239
|
constructor() {
|
|
240
240
|
super(true, {
|
|
241
241
|
id: 'editor.action.sortLinesDescending',
|
|
242
|
-
label: nls.localize2(
|
|
242
|
+
label: nls.localize2(1243, "Sort Lines Descending"),
|
|
243
243
|
precondition: EditorContextKeys.writable
|
|
244
244
|
});
|
|
245
245
|
}
|
|
@@ -248,7 +248,7 @@ export class DeleteDuplicateLinesAction extends EditorAction {
|
|
|
248
248
|
constructor() {
|
|
249
249
|
super({
|
|
250
250
|
id: 'editor.action.removeDuplicateLines',
|
|
251
|
-
label: nls.localize2(
|
|
251
|
+
label: nls.localize2(1244, "Delete Duplicate Lines"),
|
|
252
252
|
precondition: EditorContextKeys.writable
|
|
253
253
|
});
|
|
254
254
|
}
|
|
@@ -297,7 +297,7 @@ export class ReverseLinesAction extends EditorAction {
|
|
|
297
297
|
constructor() {
|
|
298
298
|
super({
|
|
299
299
|
id: 'editor.action.reverseLines',
|
|
300
|
-
label: nls.localize2(
|
|
300
|
+
label: nls.localize2(1245, "Reverse lines"),
|
|
301
301
|
precondition: EditorContextKeys.writable
|
|
302
302
|
});
|
|
303
303
|
}
|
|
@@ -363,7 +363,7 @@ export class TrimTrailingWhitespaceAction extends EditorAction {
|
|
|
363
363
|
constructor() {
|
|
364
364
|
super({
|
|
365
365
|
id: TrimTrailingWhitespaceAction.ID,
|
|
366
|
-
label: nls.localize2(
|
|
366
|
+
label: nls.localize2(1246, "Trim Trailing Whitespace"),
|
|
367
367
|
precondition: EditorContextKeys.writable,
|
|
368
368
|
kbOpts: {
|
|
369
369
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -397,7 +397,7 @@ export class DeleteLinesAction extends EditorAction {
|
|
|
397
397
|
constructor() {
|
|
398
398
|
super({
|
|
399
399
|
id: 'editor.action.deleteLines',
|
|
400
|
-
label: nls.localize2(
|
|
400
|
+
label: nls.localize2(1247, "Delete Line"),
|
|
401
401
|
precondition: EditorContextKeys.writable,
|
|
402
402
|
kbOpts: {
|
|
403
403
|
kbExpr: EditorContextKeys.textInputFocus,
|
|
@@ -485,7 +485,7 @@ export class IndentLinesAction extends EditorAction {
|
|
|
485
485
|
constructor() {
|
|
486
486
|
super({
|
|
487
487
|
id: 'editor.action.indentLines',
|
|
488
|
-
label: nls.localize2(
|
|
488
|
+
label: nls.localize2(1248, "Indent Line"),
|
|
489
489
|
precondition: EditorContextKeys.writable,
|
|
490
490
|
kbOpts: {
|
|
491
491
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -508,7 +508,7 @@ class OutdentLinesAction extends EditorAction {
|
|
|
508
508
|
constructor() {
|
|
509
509
|
super({
|
|
510
510
|
id: 'editor.action.outdentLines',
|
|
511
|
-
label: nls.localize2(
|
|
511
|
+
label: nls.localize2(1249, "Outdent Line"),
|
|
512
512
|
precondition: EditorContextKeys.writable,
|
|
513
513
|
kbOpts: {
|
|
514
514
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -525,7 +525,7 @@ export class InsertLineBeforeAction extends EditorAction {
|
|
|
525
525
|
constructor() {
|
|
526
526
|
super({
|
|
527
527
|
id: 'editor.action.insertLineBefore',
|
|
528
|
-
label: nls.localize2(
|
|
528
|
+
label: nls.localize2(1250, "Insert Line Above"),
|
|
529
529
|
precondition: EditorContextKeys.writable,
|
|
530
530
|
kbOpts: {
|
|
531
531
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -547,7 +547,7 @@ export class InsertLineAfterAction extends EditorAction {
|
|
|
547
547
|
constructor() {
|
|
548
548
|
super({
|
|
549
549
|
id: 'editor.action.insertLineAfter',
|
|
550
|
-
label: nls.localize2(
|
|
550
|
+
label: nls.localize2(1251, "Insert Line Below"),
|
|
551
551
|
precondition: EditorContextKeys.writable,
|
|
552
552
|
kbOpts: {
|
|
553
553
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -598,7 +598,7 @@ export class DeleteAllLeftAction extends AbstractDeleteAllToBoundaryAction {
|
|
|
598
598
|
constructor() {
|
|
599
599
|
super({
|
|
600
600
|
id: 'deleteAllLeft',
|
|
601
|
-
label: nls.localize2(
|
|
601
|
+
label: nls.localize2(1252, "Delete All Left"),
|
|
602
602
|
precondition: EditorContextKeys.writable,
|
|
603
603
|
kbOpts: {
|
|
604
604
|
kbExpr: EditorContextKeys.textInputFocus,
|
|
@@ -667,7 +667,7 @@ export class DeleteAllRightAction extends AbstractDeleteAllToBoundaryAction {
|
|
|
667
667
|
constructor() {
|
|
668
668
|
super({
|
|
669
669
|
id: 'deleteAllRight',
|
|
670
|
-
label: nls.localize2(
|
|
670
|
+
label: nls.localize2(1253, "Delete All Right"),
|
|
671
671
|
precondition: EditorContextKeys.writable,
|
|
672
672
|
kbOpts: {
|
|
673
673
|
kbExpr: EditorContextKeys.textInputFocus,
|
|
@@ -724,7 +724,7 @@ export class JoinLinesAction extends EditorAction {
|
|
|
724
724
|
constructor() {
|
|
725
725
|
super({
|
|
726
726
|
id: 'editor.action.joinLines',
|
|
727
|
-
label: nls.localize2(
|
|
727
|
+
label: nls.localize2(1254, "Join Lines"),
|
|
728
728
|
precondition: EditorContextKeys.writable,
|
|
729
729
|
kbOpts: {
|
|
730
730
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -865,7 +865,7 @@ export class TransposeAction extends EditorAction {
|
|
|
865
865
|
constructor() {
|
|
866
866
|
super({
|
|
867
867
|
id: 'editor.action.transpose',
|
|
868
|
-
label: nls.localize2(
|
|
868
|
+
label: nls.localize2(1255, "Transpose Characters around the Cursor"),
|
|
869
869
|
precondition: EditorContextKeys.writable
|
|
870
870
|
});
|
|
871
871
|
}
|
|
@@ -917,7 +917,7 @@ export class AbstractCaseAction extends EditorAction {
|
|
|
917
917
|
if (model === null) {
|
|
918
918
|
return;
|
|
919
919
|
}
|
|
920
|
-
const wordSeparators = editor.getOption(
|
|
920
|
+
const wordSeparators = editor.getOption(148 /* EditorOption.wordSeparators */);
|
|
921
921
|
const textEdits = [];
|
|
922
922
|
for (const selection of selections) {
|
|
923
923
|
if (selection.isEmpty()) {
|
|
@@ -944,7 +944,7 @@ export class UpperCaseAction extends AbstractCaseAction {
|
|
|
944
944
|
constructor() {
|
|
945
945
|
super({
|
|
946
946
|
id: 'editor.action.transformToUppercase',
|
|
947
|
-
label: nls.localize2(
|
|
947
|
+
label: nls.localize2(1256, "Transform to Uppercase"),
|
|
948
948
|
precondition: EditorContextKeys.writable
|
|
949
949
|
});
|
|
950
950
|
}
|
|
@@ -956,7 +956,7 @@ export class LowerCaseAction extends AbstractCaseAction {
|
|
|
956
956
|
constructor() {
|
|
957
957
|
super({
|
|
958
958
|
id: 'editor.action.transformToLowercase',
|
|
959
|
-
label: nls.localize2(
|
|
959
|
+
label: nls.localize2(1257, "Transform to Lowercase"),
|
|
960
960
|
precondition: EditorContextKeys.writable
|
|
961
961
|
});
|
|
962
962
|
}
|
|
@@ -992,7 +992,7 @@ export class TitleCaseAction extends AbstractCaseAction {
|
|
|
992
992
|
constructor() {
|
|
993
993
|
super({
|
|
994
994
|
id: 'editor.action.transformToTitlecase',
|
|
995
|
-
label: nls.localize2(
|
|
995
|
+
label: nls.localize2(1258, "Transform to Title Case"),
|
|
996
996
|
precondition: EditorContextKeys.writable
|
|
997
997
|
});
|
|
998
998
|
}
|
|
@@ -1013,7 +1013,7 @@ export class SnakeCaseAction extends AbstractCaseAction {
|
|
|
1013
1013
|
constructor() {
|
|
1014
1014
|
super({
|
|
1015
1015
|
id: 'editor.action.transformToSnakecase',
|
|
1016
|
-
label: nls.localize2(
|
|
1016
|
+
label: nls.localize2(1259, "Transform to Snake Case"),
|
|
1017
1017
|
precondition: EditorContextKeys.writable
|
|
1018
1018
|
});
|
|
1019
1019
|
}
|
|
@@ -1037,7 +1037,7 @@ export class CamelCaseAction extends AbstractCaseAction {
|
|
|
1037
1037
|
constructor() {
|
|
1038
1038
|
super({
|
|
1039
1039
|
id: 'editor.action.transformToCamelcase',
|
|
1040
|
-
label: nls.localize2(
|
|
1040
|
+
label: nls.localize2(1260, "Transform to Camel Case"),
|
|
1041
1041
|
precondition: EditorContextKeys.writable
|
|
1042
1042
|
});
|
|
1043
1043
|
}
|
|
@@ -1060,7 +1060,7 @@ export class PascalCaseAction extends AbstractCaseAction {
|
|
|
1060
1060
|
constructor() {
|
|
1061
1061
|
super({
|
|
1062
1062
|
id: 'editor.action.transformToPascalcase',
|
|
1063
|
-
label: nls.localize2(
|
|
1063
|
+
label: nls.localize2(1261, "Transform to Pascal Case"),
|
|
1064
1064
|
precondition: EditorContextKeys.writable
|
|
1065
1065
|
});
|
|
1066
1066
|
}
|
|
@@ -1092,7 +1092,7 @@ export class KebabCaseAction extends AbstractCaseAction {
|
|
|
1092
1092
|
constructor() {
|
|
1093
1093
|
super({
|
|
1094
1094
|
id: 'editor.action.transformToKebabcase',
|
|
1095
|
-
label: nls.localize2(
|
|
1095
|
+
label: nls.localize2(1262, 'Transform to Kebab Case'),
|
|
1096
1096
|
precondition: EditorContextKeys.writable
|
|
1097
1097
|
});
|
|
1098
1098
|
}
|
|
@@ -70,7 +70,7 @@ let LinkedEditingContribution = class LinkedEditingContribution extends Disposab
|
|
|
70
70
|
this._currentRequestModelVersion = null;
|
|
71
71
|
this._register(this._editor.onDidChangeModel(() => this.reinitialize(true)));
|
|
72
72
|
this._register(this._editor.onDidChangeConfiguration(e => {
|
|
73
|
-
if (e.hasChanged(78 /* EditorOption.linkedEditing */) || e.hasChanged(
|
|
73
|
+
if (e.hasChanged(78 /* EditorOption.linkedEditing */) || e.hasChanged(106 /* EditorOption.renameOnType */)) {
|
|
74
74
|
this.reinitialize(false);
|
|
75
75
|
}
|
|
76
76
|
}));
|
|
@@ -80,7 +80,7 @@ let LinkedEditingContribution = class LinkedEditingContribution extends Disposab
|
|
|
80
80
|
}
|
|
81
81
|
reinitialize(forceRefresh) {
|
|
82
82
|
const model = this._editor.getModel();
|
|
83
|
-
const isEnabled = model !== null && (this._editor.getOption(78 /* EditorOption.linkedEditing */) || this._editor.getOption(
|
|
83
|
+
const isEnabled = model !== null && (this._editor.getOption(78 /* EditorOption.linkedEditing */) || this._editor.getOption(106 /* EditorOption.renameOnType */)) && this._providers.has(model);
|
|
84
84
|
if (isEnabled === this._enabled && !forceRefresh) {
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
@@ -299,7 +299,7 @@ export class LinkedEditingAction extends EditorAction {
|
|
|
299
299
|
constructor() {
|
|
300
300
|
super({
|
|
301
301
|
id: 'editor.action.linkedEditing',
|
|
302
|
-
label: nls.localize2(
|
|
302
|
+
label: nls.localize2(1264, "Start Linked Editing"),
|
|
303
303
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasRenameProvider),
|
|
304
304
|
kbOpts: {
|
|
305
305
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -360,7 +360,7 @@ function getLinkedEditingRanges(providers, model, position, token) {
|
|
|
360
360
|
}
|
|
361
361
|
}), result => !!result && arrays.isNonEmptyArray(result?.ranges));
|
|
362
362
|
}
|
|
363
|
-
export const editorLinkedEditingBackground = registerColor('editor.linkedEditingBackground', { dark: Color.fromHex('#f00').transparent(0.3), light: Color.fromHex('#f00').transparent(0.3), hcDark: Color.fromHex('#f00').transparent(0.3), hcLight: Color.white }, nls.localize(
|
|
363
|
+
export const editorLinkedEditingBackground = registerColor('editor.linkedEditingBackground', { dark: Color.fromHex('#f00').transparent(0.3), light: Color.fromHex('#f00').transparent(0.3), hcDark: Color.fromHex('#f00').transparent(0.3), hcLight: Color.white }, nls.localize(1263, 'Background color when the editor auto renames on type.'));
|
|
364
364
|
registerModelAndPositionCommand('_executeLinkedEditingProvider', (_accessor, model, position) => {
|
|
365
365
|
const { linkedEditingRangeProvider } = _accessor.get(ILanguageFeaturesService);
|
|
366
366
|
return getLinkedEditingRanges(linkedEditingRangeProvider, model, position, CancellationToken.None);
|
|
@@ -220,10 +220,10 @@ let LinkDetector = class LinkDetector extends Disposable {
|
|
|
220
220
|
const messageOrError = err instanceof Error ? err.message : err;
|
|
221
221
|
// different error cases
|
|
222
222
|
if (messageOrError === 'invalid') {
|
|
223
|
-
this.notificationService.warn(nls.localize(
|
|
223
|
+
this.notificationService.warn(nls.localize(1265, 'Failed to open this link because it is not well-formed: {0}', link.url.toString()));
|
|
224
224
|
}
|
|
225
225
|
else if (messageOrError === 'missing') {
|
|
226
|
-
this.notificationService.warn(nls.localize(
|
|
226
|
+
this.notificationService.warn(nls.localize(1266, 'Failed to open this link because its target is missing.'));
|
|
227
227
|
}
|
|
228
228
|
else {
|
|
229
229
|
onUnexpectedError(err);
|
|
@@ -250,7 +250,7 @@ let LinkDetector = class LinkDetector extends Disposable {
|
|
|
250
250
|
}
|
|
251
251
|
isEnabled(mouseEvent, withKey) {
|
|
252
252
|
return Boolean((mouseEvent.target.type === 6 /* MouseTargetType.CONTENT_TEXT */)
|
|
253
|
-
&& (mouseEvent.hasTriggerModifier || (withKey && withKey.keyCodeIsTriggerKey)));
|
|
253
|
+
&& ((mouseEvent.hasTriggerModifier || (withKey && withKey.keyCodeIsTriggerKey)) || mouseEvent.isMiddleClick && mouseEvent.mouseMiddleClickAction === 'openLink'));
|
|
254
254
|
}
|
|
255
255
|
stop() {
|
|
256
256
|
this.computeLinks.cancel();
|
|
@@ -317,15 +317,15 @@ function getHoverMessage(link, useMetaKey) {
|
|
|
317
317
|
const label = link.tooltip
|
|
318
318
|
? link.tooltip
|
|
319
319
|
: executeCmd
|
|
320
|
-
? nls.localize(
|
|
321
|
-
: nls.localize(
|
|
320
|
+
? nls.localize(1267, 'Execute command')
|
|
321
|
+
: nls.localize(1268, 'Follow link');
|
|
322
322
|
const kb = useMetaKey
|
|
323
323
|
? platform.isMacintosh
|
|
324
|
-
? nls.localize(
|
|
325
|
-
: nls.localize(
|
|
324
|
+
? nls.localize(1269, "cmd + click")
|
|
325
|
+
: nls.localize(1270, "ctrl + click")
|
|
326
326
|
: platform.isMacintosh
|
|
327
|
-
? nls.localize(
|
|
328
|
-
: nls.localize(
|
|
327
|
+
? nls.localize(1271, "option + click")
|
|
328
|
+
: nls.localize(1272, "alt + click");
|
|
329
329
|
if (link.url) {
|
|
330
330
|
let nativeLabel = '';
|
|
331
331
|
if (/^command:/i.test(link.url.toString())) {
|
|
@@ -333,7 +333,7 @@ function getHoverMessage(link, useMetaKey) {
|
|
|
333
333
|
const match = link.url.toString().match(/^command:([^?#]+)/);
|
|
334
334
|
if (match) {
|
|
335
335
|
const commandId = match[1];
|
|
336
|
-
nativeLabel = nls.localize(
|
|
336
|
+
nativeLabel = nls.localize(1273, "Execute command {0}", commandId);
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
const hoverMessage = new MarkdownString('', true)
|
|
@@ -349,7 +349,7 @@ class OpenLinkAction extends EditorAction {
|
|
|
349
349
|
constructor() {
|
|
350
350
|
super({
|
|
351
351
|
id: 'editor.action.openLink',
|
|
352
|
-
label: nls.localize2(
|
|
352
|
+
label: nls.localize2(1274, "Open Link"),
|
|
353
353
|
precondition: undefined
|
|
354
354
|
});
|
|
355
355
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["vs/editor/contrib/links/browser/links.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAE,uBAAuB,EAAqB,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAChH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAC7D,OAAO,KAAK,QAAQ,MAAM,qCAAqC,CAAC;AAChE,OAAO,KAAK,SAAS,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;AACrD,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAmC,oBAAoB,EAAE,0BAA0B,EAAoB,MAAM,sCAAsC,CAAC;AAOzK,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAA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E,CAAC;YACxB,OAAO;QACR,CAAC;QAED,MAAM,UAAU,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC;QAC1C,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;YAC9B,MAAM,IAAI,GAAG,YAAY,CAAC,iBAAiB,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC,CAAC;YAClE,IAAI,IAAI,EAAE,CAAC;gBACV,YAAY,CAAC,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YAC9C,CAAC;QACF,CAAC;IACF,CAAC;CACD;AAED,0BAA0B,CAAC,YAAY,CAAC,EAAE,EAAE,YAAY,2DAAmD,CAAC;AAC5G,oBAAoB,CAAC,cAAc,CAAC,CAAC","file":"links.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 { createCancelablePromise, CancelablePromise, RunOnceScheduler } from '../../../../base/common/async.js';\nimport { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { MarkdownString } from '../../../../base/common/htmlContent.js';\nimport { Disposable } from '../../../../base/common/lifecycle.js';\nimport { Schemas } from '../../../../base/common/network.js';\nimport * as platform from '../../../../base/common/platform.js';\nimport * as resources from '../../../../base/common/resources.js';\nimport { StopWatch } from '../../../../base/common/stopwatch.js';\nimport { URI } from '../../../../base/common/uri.js';\nimport './links.css';\nimport { ICodeEditor, MouseTargetType } from '../../../browser/editorBrowser.js';\nimport { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from '../../../browser/editorExtensions.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { Position } from '../../../common/core/position.js';\nimport { IEditorContribution } from '../../../common/editorCommon.js';\nimport { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js';\nimport { LinkProvider } from '../../../common/languages.js';\nimport { IModelDecorationsChangeAccessor, IModelDeltaDecoration, TrackedRangeStickiness } from '../../../common/model.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { ClickLinkGesture, ClickLinkKeyboardEvent, ClickLinkMouseEvent } from '../../gotoSymbol/browser/link/clickLinkGesture.js';\nimport { getLinks, Link, LinksList } from './getLinks.js';\nimport * as nls from '../../../../nls.js';\nimport { INotificationService } from '../../../../platform/notification/common/notification.js';\nimport { IOpenerService } from '../../../../platform/opener/common/opener.js';\n\nexport class LinkDetector extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID: string = 'editor.linkDetector';\n\n\tpublic static get(editor: ICodeEditor): LinkDetector | null {\n\t\treturn editor.getContribution<LinkDetector>(LinkDetector.ID);\n\t}\n\n\tprivate readonly providers: LanguageFeatureRegistry<LinkProvider>;\n\tprivate readonly debounceInformation: IFeatureDebounceInformation;\n\tprivate readonly computeLinks: RunOnceScheduler;\n\tprivate computePromise: CancelablePromise<LinksList> | null;\n\tprivate activeLinksList: LinksList | null;\n\tprivate activeLinkDecorationId: string | null;\n\tprivate currentOccurrences: { [decorationId: string]: LinkOccurrence };\n\n\tconstructor(\n\t\tprivate readonly editor: ICodeEditor,\n\t\t@IOpenerService private readonly openerService: IOpenerService,\n\t\t@INotificationService private readonly notificationService: INotificationService,\n\t\t@ILanguageFeaturesService private readonly languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService languageFeatureDebounceService: ILanguageFeatureDebounceService,\n\t) {\n\t\tsuper();\n\n\t\tthis.providers = this.languageFeaturesService.linkProvider;\n\t\tthis.debounceInformation = languageFeatureDebounceService.for(this.providers, 'Links', { min: 1000, max: 4000 });\n\t\tthis.computeLinks = this._register(new RunOnceScheduler(() => this.computeLinksNow(), 1000));\n\t\tthis.computePromise = null;\n\t\tthis.activeLinksList = null;\n\t\tthis.currentOccurrences = {};\n\t\tthis.activeLinkDecorationId = null;\n\n\t\tconst clickLinkGesture = this._register(new ClickLinkGesture(editor));\n\n\t\tthis._register(clickLinkGesture.onMouseMoveOrRelevantKeyDown(([mouseEvent, keyboardEvent]) => {\n\t\t\tthis._onEditorMouseMove(mouseEvent, keyboardEvent);\n\t\t}));\n\t\tthis._register(clickLinkGesture.onExecute((e) => {\n\t\t\tthis.onEditorMouseUp(e);\n\t\t}));\n\t\tthis._register(clickLinkGesture.onCancel((e) => {\n\t\t\tthis.cleanUpActiveLinkDecoration();\n\t\t}));\n\t\tthis._register(editor.onDidChangeConfiguration((e) => {\n\t\t\tif (!e.hasChanged(EditorOption.links)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Remove any links (for the getting disabled case)\n\t\t\tthis.updateDecorations([]);\n\n\t\t\t// Stop any computation (for the getting disabled case)\n\t\t\tthis.stop();\n\n\t\t\t// Start computing (for the getting enabled case)\n\t\t\tthis.computeLinks.schedule(0);\n\t\t}));\n\t\tthis._register(editor.onDidChangeModelContent((e) => {\n\t\t\tif (!this.editor.hasModel()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()));\n\t\t}));\n\t\tthis._register(editor.onDidChangeModel((e) => {\n\t\t\tthis.currentOccurrences = {};\n\t\t\tthis.activeLinkDecorationId = null;\n\t\t\tthis.stop();\n\t\t\tthis.computeLinks.schedule(0);\n\t\t}));\n\t\tthis._register(editor.onDidChangeModelLanguage((e) => {\n\t\t\tthis.stop();\n\t\t\tthis.computeLinks.schedule(0);\n\t\t}));\n\t\tthis._register(this.providers.onDidChange((e) => {\n\t\t\tthis.stop();\n\t\t\tthis.computeLinks.schedule(0);\n\t\t}));\n\n\t\tthis.computeLinks.schedule(0);\n\t}\n\n\tprivate async computeLinksNow(): Promise<void> {\n\t\tif (!this.editor.hasModel() || !this.editor.getOption(EditorOption.links)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this.editor.getModel();\n\n\t\tif (model.isTooLargeForSyncing()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.providers.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.activeLinksList) {\n\t\t\tthis.activeLinksList.dispose();\n\t\t\tthis.activeLinksList = null;\n\t\t}\n\n\t\tthis.computePromise = createCancelablePromise(token => getLinks(this.providers, model, token));\n\t\ttry {\n\t\t\tconst sw = new StopWatch(false);\n\t\t\tthis.activeLinksList = await this.computePromise;\n\t\t\tthis.debounceInformation.update(model, sw.elapsed());\n\t\t\tif (model.isDisposed()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.updateDecorations(this.activeLinksList.links);\n\t\t} catch (err) {\n\t\t\tonUnexpectedError(err);\n\t\t} finally {\n\t\t\tthis.computePromise = null;\n\t\t}\n\t}\n\n\tprivate updateDecorations(links: Link[]): void {\n\t\tconst useMetaKey = (this.editor.getOption(EditorOption.multiCursorModifier) === 'altKey');\n\t\tconst oldDecorations: string[] = [];\n\t\tconst keys = Object.keys(this.currentOccurrences);\n\t\tfor (const decorationId of keys) {\n\t\t\tconst occurence = this.currentOccurrences[decorationId];\n\t\t\toldDecorations.push(occurence.decorationId);\n\t\t}\n\n\t\tconst newDecorations: IModelDeltaDecoration[] = [];\n\t\tif (links) {\n\t\t\t// Not sure why this is sometimes null\n\t\t\tfor (const link of links) {\n\t\t\t\tnewDecorations.push(LinkOccurrence.decoration(link, useMetaKey));\n\t\t\t}\n\t\t}\n\n\t\tthis.editor.changeDecorations((changeAccessor) => {\n\t\t\tconst decorations = changeAccessor.deltaDecorations(oldDecorations, newDecorations);\n\n\t\t\tthis.currentOccurrences = {};\n\t\t\tthis.activeLinkDecorationId = null;\n\t\t\tfor (let i = 0, len = decorations.length; i < len; i++) {\n\t\t\t\tconst occurence = new LinkOccurrence(links[i], decorations[i]);\n\t\t\t\tthis.currentOccurrences[occurence.decorationId] = occurence;\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _onEditorMouseMove(mouseEvent: ClickLinkMouseEvent, withKey: ClickLinkKeyboardEvent | null): void {\n\t\tconst useMetaKey = (this.editor.getOption(EditorOption.multiCursorModifier) === 'altKey');\n\t\tif (this.isEnabled(mouseEvent, withKey)) {\n\t\t\tthis.cleanUpActiveLinkDecoration(); // always remove previous link decoration as their can only be one\n\t\t\tconst occurrence = this.getLinkOccurrence(mouseEvent.target.position);\n\t\t\tif (occurrence) {\n\t\t\t\tthis.editor.changeDecorations((changeAccessor) => {\n\t\t\t\t\toccurrence.activate(changeAccessor, useMetaKey);\n\t\t\t\t\tthis.activeLinkDecorationId = occurrence.decorationId;\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthis.cleanUpActiveLinkDecoration();\n\t\t}\n\t}\n\n\tprivate cleanUpActiveLinkDecoration(): void {\n\t\tconst useMetaKey = (this.editor.getOption(EditorOption.multiCursorModifier) === 'altKey');\n\t\tif (this.activeLinkDecorationId) {\n\t\t\tconst occurrence = this.currentOccurrences[this.activeLinkDecorationId];\n\t\t\tif (occurrence) {\n\t\t\t\tthis.editor.changeDecorations((changeAccessor) => {\n\t\t\t\t\toccurrence.deactivate(changeAccessor, useMetaKey);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tthis.activeLinkDecorationId = null;\n\t\t}\n\t}\n\n\tprivate onEditorMouseUp(mouseEvent: ClickLinkMouseEvent): void {\n\t\tif (!this.isEnabled(mouseEvent)) {\n\t\t\treturn;\n\t\t}\n\t\tconst occurrence = this.getLinkOccurrence(mouseEvent.target.position);\n\t\tif (!occurrence) {\n\t\t\treturn;\n\t\t}\n\t\tthis.openLinkOccurrence(occurrence, mouseEvent.hasSideBySideModifier, true /* from user gesture */);\n\t}\n\n\tpublic openLinkOccurrence(occurrence: LinkOccurrence, openToSide: boolean, fromUserGesture = false): void {\n\n\t\tif (!this.openerService) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { link } = occurrence;\n\n\t\tlink.resolve(CancellationToken.None).then(uri => {\n\n\t\t\t// Support for relative file URIs of the shape file://./relativeFile.txt or file:///./relativeFile.txt\n\t\t\tif (typeof uri === 'string' && this.editor.hasModel()) {\n\t\t\t\tconst modelUri = this.editor.getModel().uri;\n\t\t\t\tif (modelUri.scheme === Schemas.file && uri.startsWith(`${Schemas.file}:`)) {\n\t\t\t\t\tconst parsedUri = URI.parse(uri);\n\t\t\t\t\tif (parsedUri.scheme === Schemas.file) {\n\t\t\t\t\t\tconst fsPath = resources.originalFSPath(parsedUri);\n\n\t\t\t\t\t\tlet relativePath: string | null = null;\n\t\t\t\t\t\tif (fsPath.startsWith('/./') || fsPath.startsWith('\\\\.\\\\')) {\n\t\t\t\t\t\t\trelativePath = `.${fsPath.substr(1)}`;\n\t\t\t\t\t\t} else if (fsPath.startsWith('//./') || fsPath.startsWith('\\\\\\\\.\\\\')) {\n\t\t\t\t\t\t\trelativePath = `.${fsPath.substr(2)}`;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (relativePath) {\n\t\t\t\t\t\t\turi = resources.joinPath(modelUri, relativePath);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this.openerService.open(uri, { openToSide, fromUserGesture, allowContributedOpeners: true, allowCommands: true, fromWorkspace: true });\n\n\t\t}, err => {\n\t\t\tconst messageOrError =\n\t\t\t\terr instanceof Error ? (<Error>err).message : err;\n\t\t\t// different error cases\n\t\t\tif (messageOrError === 'invalid') {\n\t\t\t\tthis.notificationService.warn(nls.localize('invalid.url', 'Failed to open this link because it is not well-formed: {0}', link.url!.toString()));\n\t\t\t} else if (messageOrError === 'missing') {\n\t\t\t\tthis.notificationService.warn(nls.localize('missing.url', 'Failed to open this link because its target is missing.'));\n\t\t\t} else {\n\t\t\t\tonUnexpectedError(err);\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic getLinkOccurrence(position: Position | null): LinkOccurrence | null {\n\t\tif (!this.editor.hasModel() || !position) {\n\t\t\treturn null;\n\t\t}\n\t\tconst decorations = this.editor.getModel().getDecorationsInRange({\n\t\t\tstartLineNumber: position.lineNumber,\n\t\t\tstartColumn: position.column,\n\t\t\tendLineNumber: position.lineNumber,\n\t\t\tendColumn: position.column\n\t\t}, 0, true);\n\n\t\tfor (const decoration of decorations) {\n\t\t\tconst currentOccurrence = this.currentOccurrences[decoration.id];\n\t\t\tif (currentOccurrence) {\n\t\t\t\treturn currentOccurrence;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate isEnabled(mouseEvent: ClickLinkMouseEvent, withKey?: ClickLinkKeyboardEvent | null): boolean {\n\t\treturn Boolean(\n\t\t\t(mouseEvent.target.type === MouseTargetType.CONTENT_TEXT)\n\t\t\t&& (mouseEvent.hasTriggerModifier || (withKey && withKey.keyCodeIsTriggerKey))\n\t\t);\n\t}\n\n\tprivate stop(): void {\n\t\tthis.computeLinks.cancel();\n\t\tif (this.activeLinksList) {\n\t\t\tthis.activeLinksList?.dispose();\n\t\t\tthis.activeLinksList = null;\n\t\t}\n\t\tif (this.computePromise) {\n\t\t\tthis.computePromise.cancel();\n\t\t\tthis.computePromise = null;\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis.stop();\n\t}\n}\n\nconst decoration = {\n\tgeneral: ModelDecorationOptions.register({\n\t\tdescription: 'detected-link',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tcollapseOnReplaceEdit: true,\n\t\tinlineClassName: 'detected-link'\n\t}),\n\tactive: ModelDecorationOptions.register({\n\t\tdescription: 'detected-link-active',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tcollapseOnReplaceEdit: true,\n\t\tinlineClassName: 'detected-link-active'\n\t})\n};\n\nclass LinkOccurrence {\n\n\tpublic static decoration(link: Link, useMetaKey: boolean): IModelDeltaDecoration {\n\t\treturn {\n\t\t\trange: link.range,\n\t\t\toptions: LinkOccurrence._getOptions(link, useMetaKey, false)\n\t\t};\n\t}\n\n\tprivate static _getOptions(link: Link, useMetaKey: boolean, isActive: boolean): ModelDecorationOptions {\n\t\tconst options = { ... (isActive ? decoration.active : decoration.general) };\n\t\toptions.hoverMessage = getHoverMessage(link, useMetaKey);\n\t\treturn options;\n\t}\n\n\tpublic decorationId: string;\n\tpublic link: Link;\n\n\tconstructor(link: Link, decorationId: string) {\n\t\tthis.link = link;\n\t\tthis.decorationId = decorationId;\n\t}\n\n\tpublic activate(changeAccessor: IModelDecorationsChangeAccessor, useMetaKey: boolean): void {\n\t\tchangeAccessor.changeDecorationOptions(this.decorationId, LinkOccurrence._getOptions(this.link, useMetaKey, true));\n\t}\n\n\tpublic deactivate(changeAccessor: IModelDecorationsChangeAccessor, useMetaKey: boolean): void {\n\t\tchangeAccessor.changeDecorationOptions(this.decorationId, LinkOccurrence._getOptions(this.link, useMetaKey, false));\n\t}\n}\n\nfunction getHoverMessage(link: Link, useMetaKey: boolean): MarkdownString {\n\tconst executeCmd = link.url && /^command:/i.test(link.url.toString());\n\n\tconst label = link.tooltip\n\t\t? link.tooltip\n\t\t: executeCmd\n\t\t\t? nls.localize('links.navigate.executeCmd', 'Execute command')\n\t\t\t: nls.localize('links.navigate.follow', 'Follow link');\n\n\tconst kb = useMetaKey\n\t\t? platform.isMacintosh\n\t\t\t? nls.localize('links.navigate.kb.meta.mac', \"cmd + click\")\n\t\t\t: nls.localize('links.navigate.kb.meta', \"ctrl + click\")\n\t\t: platform.isMacintosh\n\t\t\t? nls.localize('links.navigate.kb.alt.mac', \"option + click\")\n\t\t\t: nls.localize('links.navigate.kb.alt', \"alt + click\");\n\n\tif (link.url) {\n\t\tlet nativeLabel = '';\n\t\tif (/^command:/i.test(link.url.toString())) {\n\t\t\t// Don't show complete command arguments in the native tooltip\n\t\t\tconst match = link.url.toString().match(/^command:([^?#]+)/);\n\t\t\tif (match) {\n\t\t\t\tconst commandId = match[1];\n\t\t\t\tnativeLabel = nls.localize('tooltip.explanation', \"Execute command {0}\", commandId);\n\t\t\t}\n\t\t}\n\t\tconst hoverMessage = new MarkdownString('', true)\n\t\t\t.appendLink(link.url.toString(true).replace(/ /g, '%20'), label, nativeLabel)\n\t\t\t.appendMarkdown(` (${kb})`);\n\t\treturn hoverMessage;\n\t} else {\n\t\treturn new MarkdownString().appendText(`${label} (${kb})`);\n\t}\n}\n\nclass OpenLinkAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.openLink',\n\t\t\tlabel: nls.localize2('label', \"Open Link\"),\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst linkDetector = LinkDetector.get(editor);\n\t\tif (!linkDetector) {\n\t\t\treturn;\n\t\t}\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst selections = editor.getSelections();\n\t\tfor (const sel of selections) {\n\t\t\tconst link = linkDetector.getLinkOccurrence(sel.getEndPosition());\n\t\t\tif (link) {\n\t\t\t\tlinkDetector.openLinkOccurrence(link, false);\n\t\t\t}\n\t\t}\n\t}\n}\n\nregisterEditorContribution(LinkDetector.ID, LinkDetector, EditorContributionInstantiation.AfterFirstRender);\nregisterEditorAction(OpenLinkAction);\n"]}
|
|
1
|
+
{"version":3,"sources":["vs/editor/contrib/links/browser/links.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAE,uBAAuB,EAAqB,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAChH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OA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AAM,CAAC;QACP,OAAO,IAAI,cAAc,EAAE,CAAC,UAAU,CAAC,GAAG,KAAK,KAAK,EAAE,GAAG,CAAC,CAAC;IAC5D,CAAC;AACF,CAAC;AAED,MAAM,cAAe,SAAQ,YAAY;IAExC;QACC,KAAK,CAAC;YACL,EAAE,EAAE,wBAAwB;YAC5B,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,IAAO,EAAE,WAAW,CAAC;YAC1C,YAAY,EAAE,SAAS;SACvB,CAAC,CAAC;IACJ,CAAC;IAEM,GAAG,CAAC,QAA0B,EAAE,MAAmB;QACzD,MAAM,YAAY,GAAG,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC9C,IAAI,CAAC,YAAY,EAAE,CAAC;YACnB,OAAO;QACR,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;YACxB,OAAO;QACR,CAAC;QAED,MAAM,UAAU,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC;QAC1C,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;YAC9B,MAAM,IAAI,GAAG,YAAY,CAAC,iBAAiB,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC,CAAC;YAClE,IAAI,IAAI,EAAE,CAAC;gBACV,YAAY,CAAC,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YAC9C,CAAC;QACF,CAAC;IACF,CAAC;CACD;AAED,0BAA0B,CAAC,YAAY,CAAC,EAAE,EAAE,YAAY,2DAAmD,CAAC;AAC5G,oBAAoB,CAAC,cAAc,CAAC,CAAC","file":"links.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 { createCancelablePromise, CancelablePromise, RunOnceScheduler } from '../../../../base/common/async.js';\nimport { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { MarkdownString } from '../../../../base/common/htmlContent.js';\nimport { Disposable } from '../../../../base/common/lifecycle.js';\nimport { Schemas } from '../../../../base/common/network.js';\nimport * as platform from '../../../../base/common/platform.js';\nimport * as resources from '../../../../base/common/resources.js';\nimport { StopWatch } from '../../../../base/common/stopwatch.js';\nimport { URI } from '../../../../base/common/uri.js';\nimport './links.css';\nimport { ICodeEditor, MouseTargetType } from '../../../browser/editorBrowser.js';\nimport { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from '../../../browser/editorExtensions.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { Position } from '../../../common/core/position.js';\nimport { IEditorContribution } from '../../../common/editorCommon.js';\nimport { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js';\nimport { LinkProvider } from '../../../common/languages.js';\nimport { IModelDecorationsChangeAccessor, IModelDeltaDecoration, TrackedRangeStickiness } from '../../../common/model.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { ClickLinkGesture, ClickLinkKeyboardEvent, ClickLinkMouseEvent } from '../../gotoSymbol/browser/link/clickLinkGesture.js';\nimport { getLinks, Link, LinksList } from './getLinks.js';\nimport * as nls from '../../../../nls.js';\nimport { INotificationService } from '../../../../platform/notification/common/notification.js';\nimport { IOpenerService } from '../../../../platform/opener/common/opener.js';\n\nexport class LinkDetector extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID: string = 'editor.linkDetector';\n\n\tpublic static get(editor: ICodeEditor): LinkDetector | null {\n\t\treturn editor.getContribution<LinkDetector>(LinkDetector.ID);\n\t}\n\n\tprivate readonly providers: LanguageFeatureRegistry<LinkProvider>;\n\tprivate readonly debounceInformation: IFeatureDebounceInformation;\n\tprivate readonly computeLinks: RunOnceScheduler;\n\tprivate computePromise: CancelablePromise<LinksList> | null;\n\tprivate activeLinksList: LinksList | null;\n\tprivate activeLinkDecorationId: string | null;\n\tprivate currentOccurrences: { [decorationId: string]: LinkOccurrence };\n\n\tconstructor(\n\t\tprivate readonly editor: ICodeEditor,\n\t\t@IOpenerService private readonly openerService: IOpenerService,\n\t\t@INotificationService private readonly notificationService: INotificationService,\n\t\t@ILanguageFeaturesService private readonly languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService languageFeatureDebounceService: ILanguageFeatureDebounceService,\n\t) {\n\t\tsuper();\n\n\t\tthis.providers = this.languageFeaturesService.linkProvider;\n\t\tthis.debounceInformation = languageFeatureDebounceService.for(this.providers, 'Links', { min: 1000, max: 4000 });\n\t\tthis.computeLinks = this._register(new RunOnceScheduler(() => this.computeLinksNow(), 1000));\n\t\tthis.computePromise = null;\n\t\tthis.activeLinksList = null;\n\t\tthis.currentOccurrences = {};\n\t\tthis.activeLinkDecorationId = null;\n\n\t\tconst clickLinkGesture = this._register(new ClickLinkGesture(editor));\n\n\t\tthis._register(clickLinkGesture.onMouseMoveOrRelevantKeyDown(([mouseEvent, keyboardEvent]) => {\n\t\t\tthis._onEditorMouseMove(mouseEvent, keyboardEvent);\n\t\t}));\n\t\tthis._register(clickLinkGesture.onExecute((e) => {\n\t\t\tthis.onEditorMouseUp(e);\n\t\t}));\n\t\tthis._register(clickLinkGesture.onCancel((e) => {\n\t\t\tthis.cleanUpActiveLinkDecoration();\n\t\t}));\n\t\tthis._register(editor.onDidChangeConfiguration((e) => {\n\t\t\tif (!e.hasChanged(EditorOption.links)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Remove any links (for the getting disabled case)\n\t\t\tthis.updateDecorations([]);\n\n\t\t\t// Stop any computation (for the getting disabled case)\n\t\t\tthis.stop();\n\n\t\t\t// Start computing (for the getting enabled case)\n\t\t\tthis.computeLinks.schedule(0);\n\t\t}));\n\t\tthis._register(editor.onDidChangeModelContent((e) => {\n\t\t\tif (!this.editor.hasModel()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()));\n\t\t}));\n\t\tthis._register(editor.onDidChangeModel((e) => {\n\t\t\tthis.currentOccurrences = {};\n\t\t\tthis.activeLinkDecorationId = null;\n\t\t\tthis.stop();\n\t\t\tthis.computeLinks.schedule(0);\n\t\t}));\n\t\tthis._register(editor.onDidChangeModelLanguage((e) => {\n\t\t\tthis.stop();\n\t\t\tthis.computeLinks.schedule(0);\n\t\t}));\n\t\tthis._register(this.providers.onDidChange((e) => {\n\t\t\tthis.stop();\n\t\t\tthis.computeLinks.schedule(0);\n\t\t}));\n\n\t\tthis.computeLinks.schedule(0);\n\t}\n\n\tprivate async computeLinksNow(): Promise<void> {\n\t\tif (!this.editor.hasModel() || !this.editor.getOption(EditorOption.links)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this.editor.getModel();\n\n\t\tif (model.isTooLargeForSyncing()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.providers.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.activeLinksList) {\n\t\t\tthis.activeLinksList.dispose();\n\t\t\tthis.activeLinksList = null;\n\t\t}\n\n\t\tthis.computePromise = createCancelablePromise(token => getLinks(this.providers, model, token));\n\t\ttry {\n\t\t\tconst sw = new StopWatch(false);\n\t\t\tthis.activeLinksList = await this.computePromise;\n\t\t\tthis.debounceInformation.update(model, sw.elapsed());\n\t\t\tif (model.isDisposed()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.updateDecorations(this.activeLinksList.links);\n\t\t} catch (err) {\n\t\t\tonUnexpectedError(err);\n\t\t} finally {\n\t\t\tthis.computePromise = null;\n\t\t}\n\t}\n\n\tprivate updateDecorations(links: Link[]): void {\n\t\tconst useMetaKey = (this.editor.getOption(EditorOption.multiCursorModifier) === 'altKey');\n\t\tconst oldDecorations: string[] = [];\n\t\tconst keys = Object.keys(this.currentOccurrences);\n\t\tfor (const decorationId of keys) {\n\t\t\tconst occurence = this.currentOccurrences[decorationId];\n\t\t\toldDecorations.push(occurence.decorationId);\n\t\t}\n\n\t\tconst newDecorations: IModelDeltaDecoration[] = [];\n\t\tif (links) {\n\t\t\t// Not sure why this is sometimes null\n\t\t\tfor (const link of links) {\n\t\t\t\tnewDecorations.push(LinkOccurrence.decoration(link, useMetaKey));\n\t\t\t}\n\t\t}\n\n\t\tthis.editor.changeDecorations((changeAccessor) => {\n\t\t\tconst decorations = changeAccessor.deltaDecorations(oldDecorations, newDecorations);\n\n\t\t\tthis.currentOccurrences = {};\n\t\t\tthis.activeLinkDecorationId = null;\n\t\t\tfor (let i = 0, len = decorations.length; i < len; i++) {\n\t\t\t\tconst occurence = new LinkOccurrence(links[i], decorations[i]);\n\t\t\t\tthis.currentOccurrences[occurence.decorationId] = occurence;\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _onEditorMouseMove(mouseEvent: ClickLinkMouseEvent, withKey: ClickLinkKeyboardEvent | null): void {\n\t\tconst useMetaKey = (this.editor.getOption(EditorOption.multiCursorModifier) === 'altKey');\n\t\tif (this.isEnabled(mouseEvent, withKey)) {\n\t\t\tthis.cleanUpActiveLinkDecoration(); // always remove previous link decoration as their can only be one\n\t\t\tconst occurrence = this.getLinkOccurrence(mouseEvent.target.position);\n\t\t\tif (occurrence) {\n\t\t\t\tthis.editor.changeDecorations((changeAccessor) => {\n\t\t\t\t\toccurrence.activate(changeAccessor, useMetaKey);\n\t\t\t\t\tthis.activeLinkDecorationId = occurrence.decorationId;\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthis.cleanUpActiveLinkDecoration();\n\t\t}\n\t}\n\n\tprivate cleanUpActiveLinkDecoration(): void {\n\t\tconst useMetaKey = (this.editor.getOption(EditorOption.multiCursorModifier) === 'altKey');\n\t\tif (this.activeLinkDecorationId) {\n\t\t\tconst occurrence = this.currentOccurrences[this.activeLinkDecorationId];\n\t\t\tif (occurrence) {\n\t\t\t\tthis.editor.changeDecorations((changeAccessor) => {\n\t\t\t\t\toccurrence.deactivate(changeAccessor, useMetaKey);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tthis.activeLinkDecorationId = null;\n\t\t}\n\t}\n\n\tprivate onEditorMouseUp(mouseEvent: ClickLinkMouseEvent): void {\n\t\tif (!this.isEnabled(mouseEvent)) {\n\t\t\treturn;\n\t\t}\n\t\tconst occurrence = this.getLinkOccurrence(mouseEvent.target.position);\n\t\tif (!occurrence) {\n\t\t\treturn;\n\t\t}\n\t\tthis.openLinkOccurrence(occurrence, mouseEvent.hasSideBySideModifier, true /* from user gesture */);\n\t}\n\n\tpublic openLinkOccurrence(occurrence: LinkOccurrence, openToSide: boolean, fromUserGesture = false): void {\n\n\t\tif (!this.openerService) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { link } = occurrence;\n\n\t\tlink.resolve(CancellationToken.None).then(uri => {\n\n\t\t\t// Support for relative file URIs of the shape file://./relativeFile.txt or file:///./relativeFile.txt\n\t\t\tif (typeof uri === 'string' && this.editor.hasModel()) {\n\t\t\t\tconst modelUri = this.editor.getModel().uri;\n\t\t\t\tif (modelUri.scheme === Schemas.file && uri.startsWith(`${Schemas.file}:`)) {\n\t\t\t\t\tconst parsedUri = URI.parse(uri);\n\t\t\t\t\tif (parsedUri.scheme === Schemas.file) {\n\t\t\t\t\t\tconst fsPath = resources.originalFSPath(parsedUri);\n\n\t\t\t\t\t\tlet relativePath: string | null = null;\n\t\t\t\t\t\tif (fsPath.startsWith('/./') || fsPath.startsWith('\\\\.\\\\')) {\n\t\t\t\t\t\t\trelativePath = `.${fsPath.substr(1)}`;\n\t\t\t\t\t\t} else if (fsPath.startsWith('//./') || fsPath.startsWith('\\\\\\\\.\\\\')) {\n\t\t\t\t\t\t\trelativePath = `.${fsPath.substr(2)}`;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (relativePath) {\n\t\t\t\t\t\t\turi = resources.joinPath(modelUri, relativePath);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this.openerService.open(uri, { openToSide, fromUserGesture, allowContributedOpeners: true, allowCommands: true, fromWorkspace: true });\n\n\t\t}, err => {\n\t\t\tconst messageOrError =\n\t\t\t\terr instanceof Error ? (<Error>err).message : err;\n\t\t\t// different error cases\n\t\t\tif (messageOrError === 'invalid') {\n\t\t\t\tthis.notificationService.warn(nls.localize('invalid.url', 'Failed to open this link because it is not well-formed: {0}', link.url!.toString()));\n\t\t\t} else if (messageOrError === 'missing') {\n\t\t\t\tthis.notificationService.warn(nls.localize('missing.url', 'Failed to open this link because its target is missing.'));\n\t\t\t} else {\n\t\t\t\tonUnexpectedError(err);\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic getLinkOccurrence(position: Position | null): LinkOccurrence | null {\n\t\tif (!this.editor.hasModel() || !position) {\n\t\t\treturn null;\n\t\t}\n\t\tconst decorations = this.editor.getModel().getDecorationsInRange({\n\t\t\tstartLineNumber: position.lineNumber,\n\t\t\tstartColumn: position.column,\n\t\t\tendLineNumber: position.lineNumber,\n\t\t\tendColumn: position.column\n\t\t}, 0, true);\n\n\t\tfor (const decoration of decorations) {\n\t\t\tconst currentOccurrence = this.currentOccurrences[decoration.id];\n\t\t\tif (currentOccurrence) {\n\t\t\t\treturn currentOccurrence;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate isEnabled(mouseEvent: ClickLinkMouseEvent, withKey?: ClickLinkKeyboardEvent | null): boolean {\n\t\treturn Boolean(\n\t\t\t(mouseEvent.target.type === MouseTargetType.CONTENT_TEXT)\n\t\t\t&& ((mouseEvent.hasTriggerModifier || (withKey && withKey.keyCodeIsTriggerKey)) || mouseEvent.isMiddleClick && mouseEvent.mouseMiddleClickAction === 'openLink')\n\t\t);\n\t}\n\n\tprivate stop(): void {\n\t\tthis.computeLinks.cancel();\n\t\tif (this.activeLinksList) {\n\t\t\tthis.activeLinksList?.dispose();\n\t\t\tthis.activeLinksList = null;\n\t\t}\n\t\tif (this.computePromise) {\n\t\t\tthis.computePromise.cancel();\n\t\t\tthis.computePromise = null;\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis.stop();\n\t}\n}\n\nconst decoration = {\n\tgeneral: ModelDecorationOptions.register({\n\t\tdescription: 'detected-link',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tcollapseOnReplaceEdit: true,\n\t\tinlineClassName: 'detected-link'\n\t}),\n\tactive: ModelDecorationOptions.register({\n\t\tdescription: 'detected-link-active',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tcollapseOnReplaceEdit: true,\n\t\tinlineClassName: 'detected-link-active'\n\t})\n};\n\nclass LinkOccurrence {\n\n\tpublic static decoration(link: Link, useMetaKey: boolean): IModelDeltaDecoration {\n\t\treturn {\n\t\t\trange: link.range,\n\t\t\toptions: LinkOccurrence._getOptions(link, useMetaKey, false)\n\t\t};\n\t}\n\n\tprivate static _getOptions(link: Link, useMetaKey: boolean, isActive: boolean): ModelDecorationOptions {\n\t\tconst options = { ... (isActive ? decoration.active : decoration.general) };\n\t\toptions.hoverMessage = getHoverMessage(link, useMetaKey);\n\t\treturn options;\n\t}\n\n\tpublic decorationId: string;\n\tpublic link: Link;\n\n\tconstructor(link: Link, decorationId: string) {\n\t\tthis.link = link;\n\t\tthis.decorationId = decorationId;\n\t}\n\n\tpublic activate(changeAccessor: IModelDecorationsChangeAccessor, useMetaKey: boolean): void {\n\t\tchangeAccessor.changeDecorationOptions(this.decorationId, LinkOccurrence._getOptions(this.link, useMetaKey, true));\n\t}\n\n\tpublic deactivate(changeAccessor: IModelDecorationsChangeAccessor, useMetaKey: boolean): void {\n\t\tchangeAccessor.changeDecorationOptions(this.decorationId, LinkOccurrence._getOptions(this.link, useMetaKey, false));\n\t}\n}\n\nfunction getHoverMessage(link: Link, useMetaKey: boolean): MarkdownString {\n\tconst executeCmd = link.url && /^command:/i.test(link.url.toString());\n\n\tconst label = link.tooltip\n\t\t? link.tooltip\n\t\t: executeCmd\n\t\t\t? nls.localize('links.navigate.executeCmd', 'Execute command')\n\t\t\t: nls.localize('links.navigate.follow', 'Follow link');\n\n\tconst kb = useMetaKey\n\t\t? platform.isMacintosh\n\t\t\t? nls.localize('links.navigate.kb.meta.mac', \"cmd + click\")\n\t\t\t: nls.localize('links.navigate.kb.meta', \"ctrl + click\")\n\t\t: platform.isMacintosh\n\t\t\t? nls.localize('links.navigate.kb.alt.mac', \"option + click\")\n\t\t\t: nls.localize('links.navigate.kb.alt', \"alt + click\");\n\n\tif (link.url) {\n\t\tlet nativeLabel = '';\n\t\tif (/^command:/i.test(link.url.toString())) {\n\t\t\t// Don't show complete command arguments in the native tooltip\n\t\t\tconst match = link.url.toString().match(/^command:([^?#]+)/);\n\t\t\tif (match) {\n\t\t\t\tconst commandId = match[1];\n\t\t\t\tnativeLabel = nls.localize('tooltip.explanation', \"Execute command {0}\", commandId);\n\t\t\t}\n\t\t}\n\t\tconst hoverMessage = new MarkdownString('', true)\n\t\t\t.appendLink(link.url.toString(true).replace(/ /g, '%20'), label, nativeLabel)\n\t\t\t.appendMarkdown(` (${kb})`);\n\t\treturn hoverMessage;\n\t} else {\n\t\treturn new MarkdownString().appendText(`${label} (${kb})`);\n\t}\n}\n\nclass OpenLinkAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.openLink',\n\t\t\tlabel: nls.localize2('label', \"Open Link\"),\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst linkDetector = LinkDetector.get(editor);\n\t\tif (!linkDetector) {\n\t\t\treturn;\n\t\t}\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst selections = editor.getSelections();\n\t\tfor (const sel of selections) {\n\t\t\tconst link = linkDetector.getLinkOccurrence(sel.getEndPosition());\n\t\t\tif (link) {\n\t\t\t\tlinkDetector.openLinkOccurrence(link, false);\n\t\t\t}\n\t\t}\n\t}\n}\n\nregisterEditorContribution(LinkDetector.ID, LinkDetector, EditorContributionInstantiation.AfterFirstRender);\nregisterEditorAction(OpenLinkAction);\n"]}
|