monaco-editor-core 0.55.0-dev-20251014 → 0.55.0-dev-20251016
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 +9 -0
- 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 +9 -0
- package/esm/nls.messages.pt-br.js +9 -0
- package/esm/nls.messages.ru.js +2 -2
- package/esm/nls.messages.tr.js +9 -0
- package/esm/nls.messages.zh-cn.js +2 -2
- package/esm/nls.messages.zh-tw.js +2 -2
- package/esm/nls.metadata.json +10 -0
- package/esm/vs/base/browser/canIUse.js +0 -1
- package/esm/vs/base/browser/canIUse.js.map +1 -1
- package/esm/vs/base/browser/domSanitize.js +31 -23
- package/esm/vs/base/browser/domSanitize.js.map +1 -1
- package/esm/vs/base/browser/dompurify/dompurify.js +188 -385
- package/esm/vs/base/browser/markdownRenderer.js +6 -1
- package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/base/browser/trustedTypes.js.map +1 -1
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/toggle/toggle.js +6 -0
- package/esm/vs/base/browser/ui/toggle/toggle.js.map +1 -1
- package/esm/vs/base/common/codiconsLibrary.js +1 -0
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/base/common/objects.js +0 -1
- package/esm/vs/base/common/objects.js.map +1 -1
- package/esm/vs/editor/browser/controller/mouseTarget.js +2 -1
- package/esm/vs/editor/browser/controller/mouseTarget.js.map +1 -1
- package/esm/vs/editor/browser/coreCommands.js +4 -2
- package/esm/vs/editor/browser/coreCommands.js.map +1 -1
- package/esm/vs/editor/browser/services/abstractCodeEditorService.js +5 -0
- package/esm/vs/editor/browser/services/abstractCodeEditorService.js.map +1 -1
- package/esm/vs/editor/browser/services/codeEditorService.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/copySelection.js +104 -0
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/copySelection.js.map +1 -0
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +3 -3
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +25 -24
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +5 -5
- package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +7 -3
- package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js.map +1 -1
- 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/diffEditor/style.css +11 -0
- 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/common/config/editorConfigurationSchema.js +54 -54
- package/esm/vs/editor/common/config/editorOptions.js +406 -406
- package/esm/vs/editor/common/core/editorColorRegistry.js +68 -68
- package/esm/vs/editor/common/cursor/cursorMoveCommands.js +10 -1
- package/esm/vs/editor/common/cursor/cursorMoveCommands.js.map +1 -1
- 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/standaloneStrings.js +10 -10
- 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 +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/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/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 +13 -14
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js.map +1 -1
- 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.js +26 -26
- package/esm/vs/editor/contrib/folding/browser/folding.js +20 -20
- 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/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/markdownHoverParticipant.js +9 -9
- 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 +19 -19
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +12 -12
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +15 -10
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js.map +1 -1
- 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/view/inlineEdits/components/gutterIndicatorMenu.js +6 -6
- 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 +47 -37
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js.map +1 -1
- 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 +56 -10
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js.map +1 -1
- 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/stickyScroll/browser/stickyScrollWidget.js +2 -2
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +8 -8
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +10 -10
- 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 +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/actions.js +0 -1
- 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/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 +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/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/package.json +3 -3
- package/version.txt +1 -1
|
@@ -54,6 +54,11 @@ let AbstractCodeEditorService = class AbstractCodeEditorService extends Disposab
|
|
|
54
54
|
this._diffEditors[editor.getId()] = editor;
|
|
55
55
|
this._onDiffEditorAdd.fire(editor);
|
|
56
56
|
}
|
|
57
|
+
removeDiffEditor(editor) {
|
|
58
|
+
if (delete this._diffEditors[editor.getId()]) {
|
|
59
|
+
this._onDiffEditorRemove.fire(editor);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
57
62
|
listDiffEditors() {
|
|
58
63
|
return Object.keys(this._diffEditors).map(id => this._diffEditors[id]);
|
|
59
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/services/abstractCodeEditorService.ts","vs/editor/browser/services/abstractCodeEditorService.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,OAAO,EAAS,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAe,UAAU,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAKhE,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,C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I,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;QACjC,IAAI,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;YAClD,OAAO,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC;QACD,OAAO,SAAS,CAAC;IAClB,CAAC;IAID,KAAK,CAAC,cAAc,CAAC,KAA2B,EAAE,MAA0B,EAAE,UAAoB;QACjG,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,uBAAuB,EAAE,CAAC;YACpD,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;YAC3D,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;gBACxB,OAAO,SAAS,CAAC;YAClB,CAAC;QACF,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAED,6BAA6B,CAAC,OAA+B;QAC5D,MAAM,EAAE,GAAG,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACzD,OAAO,YAAY,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC;CACD,CAAA;AAzIqB,yBAAyB;IA2B5C,WAAA,aAAa,CAAA;GA3BM,yBAAyB,CAyI9C;;AAED,MAAM,OAAO,gBAAgB;IAG5B,YAAY,UAA4B;QACvC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAC/B,CAAC;CACD","file":"abstractCodeEditorService.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["\nimport { Emitter, Event } from '../../../base/common/event.js';\nimport { IDisposable, Disposable, toDisposable } from '../../../base/common/lifecycle.js';\nimport { LinkedList } from '../../../base/common/linkedList.js';\nimport { URI } from '../../../base/common/uri.js';\nimport { ICodeEditor, IDiffEditor } from '../editorBrowser.js';\nimport { ICodeEditorOpenHandler, ICodeEditorService } from './codeEditorService.js';\nimport { IResourceEditorInput } from '../../../platform/editor/common/editor.js';\nimport { IThemeService } from '../../../platform/theme/common/themeService.js';\n\nexport abstract class AbstractCodeEditorService extends Disposable implements ICodeEditorService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _onWillCreateCodeEditor = this._register(new Emitter<void>());\n\n\tprivate readonly _onCodeEditorAdd: Emitter<ICodeEditor> = this._register(new Emitter<ICodeEditor>());\n\tpublic readonly onCodeEditorAdd: Event<ICodeEditor> = this._onCodeEditorAdd.event;\n\n\tprivate readonly _onCodeEditorRemove: Emitter<ICodeEditor> = this._register(new Emitter<ICodeEditor>());\n\tpublic readonly onCodeEditorRemove: Event<ICodeEditor> = this._onCodeEditorRemove.event;\n\n\tprivate readonly _onWillCreateDiffEditor = this._register(new Emitter<void>());\n\n\tprivate readonly _onDiffEditorAdd: Emitter<IDiffEditor> = this._register(new Emitter<IDiffEditor>());\n\tpublic readonly onDiffEditorAdd: Event<IDiffEditor> = this._onDiffEditorAdd.event;\n\n\tprivate readonly _onDiffEditorRemove: Emitter<IDiffEditor> = this._register(new Emitter<IDiffEditor>());\n\tpublic readonly onDiffEditorRemove: Event<IDiffEditor> = this._onDiffEditorRemove.event;\n\n\tprivate readonly _codeEditors: { [editorId: string]: ICodeEditor };\n\tprivate readonly _diffEditors: { [editorId: string]: IDiffEditor };\n\tprotected _globalStyleSheet: GlobalStyleSheet | null;\n\tprivate readonly _decorationOptionProviders = new Map<string, IModelDecorationOptionsProvider>();\n\tprivate readonly _codeEditorOpenHandlers = new LinkedList<ICodeEditorOpenHandler>();\n\n\tconstructor(\n\t\t@IThemeService private readonly _themeService: IThemeService,\n\t) {\n\t\tsuper();\n\t\tthis._codeEditors = Object.create(null);\n\t\tthis._diffEditors = Object.create(null);\n\t\tthis._globalStyleSheet = null;\n\t}\n\n\twillCreateCodeEditor(): void {\n\t\tthis._onWillCreateCodeEditor.fire();\n\t}\n\n\taddCodeEditor(editor: ICodeEditor): void {\n\t\tthis._codeEditors[editor.getId()] = editor;\n\t\tthis._onCodeEditorAdd.fire(editor);\n\t}\n\n\tremoveCodeEditor(editor: ICodeEditor): void {\n\t\tif (delete this._codeEditors[editor.getId()]) {\n\t\t\tthis._onCodeEditorRemove.fire(editor);\n\t\t}\n\t}\n\n\tlistCodeEditors(): ICodeEditor[] {\n\t\treturn Object.keys(this._codeEditors).map(id => this._codeEditors[id]);\n\t}\n\n\twillCreateDiffEditor(): void {\n\t\tthis._onWillCreateDiffEditor.fire();\n\t}\n\n\taddDiffEditor(editor: IDiffEditor): void {\n\t\tthis._diffEditors[editor.getId()] = editor;\n\t\tthis._onDiffEditorAdd.fire(editor);\n\t}\n\n\tlistDiffEditors(): IDiffEditor[] {\n\t\treturn Object.keys(this._diffEditors).map(id => this._diffEditors[id]);\n\t}\n\n\tgetFocusedCodeEditor(): ICodeEditor | null {\n\t\tlet editorWithWidgetFocus: ICodeEditor | null = null;\n\n\t\tconst editors = this.listCodeEditors();\n\t\tfor (const editor of editors) {\n\n\t\t\tif (editor.hasTextFocus()) {\n\t\t\t\t// bingo!\n\t\t\t\treturn editor;\n\t\t\t}\n\n\t\t\tif (editor.hasWidgetFocus()) {\n\t\t\t\teditorWithWidgetFocus = editor;\n\t\t\t}\n\t\t}\n\n\t\treturn editorWithWidgetFocus;\n\t}\n\n\tpublic removeDecorationType(key: string): void {\n\t\tconst provider = this._decorationOptionProviders.get(key);\n\t\tif (provider) {\n\t\t\tprovider.refCount--;\n\t\t\tif (provider.refCount <= 0) {\n\t\t\t\tthis._decorationOptionProviders.delete(key);\n\t\t\t\tprovider.dispose();\n\t\t\t\tthis.listCodeEditors().forEach((ed) => ed.removeDecorationsByType(key));\n\t\t\t}\n\t\t}\n\t}\n\tprivate readonly _modelProperties = new Map<string, Map<string, unknown>>();\n\n\tpublic setModelProperty(resource: URI, key: string, value: unknown): void {\n\t\tconst key1 = resource.toString();\n\t\tlet dest: Map<string, unknown>;\n\t\tif (this._modelProperties.has(key1)) {\n\t\t\tdest = this._modelProperties.get(key1)!;\n\t\t} else {\n\t\t\tdest = new Map<string, unknown>();\n\t\t\tthis._modelProperties.set(key1, dest);\n\t\t}\n\n\t\tdest.set(key, value);\n\t}\n\n\tpublic getModelProperty(resource: URI, key: string): unknown {\n\t\tconst key1 = resource.toString();\n\t\tif (this._modelProperties.has(key1)) {\n\t\t\tconst innerMap = this._modelProperties.get(key1)!;\n\t\t\treturn innerMap.get(key);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tabstract getActiveCodeEditor(): ICodeEditor | null;\n\n\tasync openCodeEditor(input: IResourceEditorInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null> {\n\t\tfor (const handler of this._codeEditorOpenHandlers) {\n\t\t\tconst candidate = await handler(input, source, sideBySide);\n\t\t\tif (candidate !== null) {\n\t\t\t\treturn candidate;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tregisterCodeEditorOpenHandler(handler: ICodeEditorOpenHandler): IDisposable {\n\t\tconst rm = this._codeEditorOpenHandlers.unshift(handler);\n\t\treturn toDisposable(rm);\n\t}\n}\n\nexport class GlobalStyleSheet {\n\tprivate readonly _styleSheet: HTMLStyleElement;\n\n\tconstructor(styleSheet: HTMLStyleElement) {\n\t\tthis._styleSheet = styleSheet;\n\t}\n}\n\ninterface IModelDecorationOptionsProvider extends IDisposable {\n\trefCount: number;\n}\n","\nimport { Emitter, Event } from '../../../base/common/event.js';\nimport { IDisposable, Disposable, toDisposable } from '../../../base/common/lifecycle.js';\nimport { LinkedList } from '../../../base/common/linkedList.js';\nimport { URI } from '../../../base/common/uri.js';\nimport { ICodeEditor, IDiffEditor } from '../editorBrowser.js';\nimport { ICodeEditorOpenHandler, ICodeEditorService } from './codeEditorService.js';\nimport { IResourceEditorInput } from '../../../platform/editor/common/editor.js';\nimport { IThemeService } from '../../../platform/theme/common/themeService.js';\n\nexport abstract class AbstractCodeEditorService extends Disposable implements ICodeEditorService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _onWillCreateCodeEditor = this._register(new Emitter<void>());\n\n\tprivate readonly _onCodeEditorAdd: Emitter<ICodeEditor> = this._register(new Emitter<ICodeEditor>());\n\tpublic readonly onCodeEditorAdd: Event<ICodeEditor> = this._onCodeEditorAdd.event;\n\n\tprivate readonly _onCodeEditorRemove: Emitter<ICodeEditor> = this._register(new Emitter<ICodeEditor>());\n\tpublic readonly onCodeEditorRemove: Event<ICodeEditor> = this._onCodeEditorRemove.event;\n\n\tprivate readonly _onWillCreateDiffEditor = this._register(new Emitter<void>());\n\n\tprivate readonly _onDiffEditorAdd: Emitter<IDiffEditor> = this._register(new Emitter<IDiffEditor>());\n\tpublic readonly onDiffEditorAdd: Event<IDiffEditor> = this._onDiffEditorAdd.event;\n\n\tprivate readonly _onDiffEditorRemove: Emitter<IDiffEditor> = this._register(new Emitter<IDiffEditor>());\n\tpublic readonly onDiffEditorRemove: Event<IDiffEditor> = this._onDiffEditorRemove.event;\n\n\tprivate readonly _codeEditors: { [editorId: string]: ICodeEditor };\n\tprivate readonly _diffEditors: { [editorId: string]: IDiffEditor };\n\tprotected _globalStyleSheet: GlobalStyleSheet | null;\n\tprivate readonly _decorationOptionProviders = new Map<string, IModelDecorationOptionsProvider>();\n\tprivate readonly _codeEditorOpenHandlers = new LinkedList<ICodeEditorOpenHandler>();\n\n\tconstructor(\n\t\t@IThemeService private readonly _themeService: IThemeService,\n\t) {\n\t\tsuper();\n\t\tthis._codeEditors = Object.create(null);\n\t\tthis._diffEditors = Object.create(null);\n\t\tthis._globalStyleSheet = null;\n\t}\n\n\twillCreateCodeEditor(): void {\n\t\tthis._onWillCreateCodeEditor.fire();\n\t}\n\n\taddCodeEditor(editor: ICodeEditor): void {\n\t\tthis._codeEditors[editor.getId()] = editor;\n\t\tthis._onCodeEditorAdd.fire(editor);\n\t}\n\n\tremoveCodeEditor(editor: ICodeEditor): void {\n\t\tif (delete this._codeEditors[editor.getId()]) {\n\t\t\tthis._onCodeEditorRemove.fire(editor);\n\t\t}\n\t}\n\n\tlistCodeEditors(): ICodeEditor[] {\n\t\treturn Object.keys(this._codeEditors).map(id => this._codeEditors[id]);\n\t}\n\n\twillCreateDiffEditor(): void {\n\t\tthis._onWillCreateDiffEditor.fire();\n\t}\n\n\taddDiffEditor(editor: IDiffEditor): void {\n\t\tthis._diffEditors[editor.getId()] = editor;\n\t\tthis._onDiffEditorAdd.fire(editor);\n\t}\n\n\tlistDiffEditors(): IDiffEditor[] {\n\t\treturn Object.keys(this._diffEditors).map(id => this._diffEditors[id]);\n\t}\n\n\tgetFocusedCodeEditor(): ICodeEditor | null {\n\t\tlet editorWithWidgetFocus: ICodeEditor | null = null;\n\n\t\tconst editors = this.listCodeEditors();\n\t\tfor (const editor of editors) {\n\n\t\t\tif (editor.hasTextFocus()) {\n\t\t\t\t// bingo!\n\t\t\t\treturn editor;\n\t\t\t}\n\n\t\t\tif (editor.hasWidgetFocus()) {\n\t\t\t\teditorWithWidgetFocus = editor;\n\t\t\t}\n\t\t}\n\n\t\treturn editorWithWidgetFocus;\n\t}\n\n\tpublic removeDecorationType(key: string): void {\n\t\tconst provider = this._decorationOptionProviders.get(key);\n\t\tif (provider) {\n\t\t\tprovider.refCount--;\n\t\t\tif (provider.refCount <= 0) {\n\t\t\t\tthis._decorationOptionProviders.delete(key);\n\t\t\t\tprovider.dispose();\n\t\t\t\tthis.listCodeEditors().forEach((ed) => ed.removeDecorationsByType(key));\n\t\t\t}\n\t\t}\n\t}\n\tprivate readonly _modelProperties = new Map<string, Map<string, unknown>>();\n\n\tpublic setModelProperty(resource: URI, key: string, value: unknown): void {\n\t\tconst key1 = resource.toString();\n\t\tlet dest: Map<string, unknown>;\n\t\tif (this._modelProperties.has(key1)) {\n\t\t\tdest = this._modelProperties.get(key1)!;\n\t\t} else {\n\t\t\tdest = new Map<string, unknown>();\n\t\t\tthis._modelProperties.set(key1, dest);\n\t\t}\n\n\t\tdest.set(key, value);\n\t}\n\n\tpublic getModelProperty(resource: URI, key: string): unknown {\n\t\tconst key1 = resource.toString();\n\t\tif (this._modelProperties.has(key1)) {\n\t\t\tconst innerMap = this._modelProperties.get(key1)!;\n\t\t\treturn innerMap.get(key);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tabstract getActiveCodeEditor(): ICodeEditor | null;\n\n\tasync openCodeEditor(input: IResourceEditorInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null> {\n\t\tfor (const handler of this._codeEditorOpenHandlers) {\n\t\t\tconst candidate = await handler(input, source, sideBySide);\n\t\t\tif (candidate !== null) {\n\t\t\t\treturn candidate;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tregisterCodeEditorOpenHandler(handler: ICodeEditorOpenHandler): IDisposable {\n\t\tconst rm = this._codeEditorOpenHandlers.unshift(handler);\n\t\treturn toDisposable(rm);\n\t}\n}\n\nexport class GlobalStyleSheet {\n\tprivate readonly _styleSheet: HTMLStyleElement;\n\n\tconstructor(styleSheet: HTMLStyleElement) {\n\t\tthis._styleSheet = styleSheet;\n\t}\n}\n\ninterface IModelDecorationOptionsProvider extends IDisposable {\n\trefCount: number;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/services/abstractCodeEditorService.ts","vs/editor/browser/services/abstractCodeEditorService.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,OAAO,EAAS,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAe,UAAU,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAKhE,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAExE,IAAe,yBAAyB,GAAxC,MAAe,yBAA0B,SAAQ,UAAU;IA0BjE,YACgB,aAA6C;QAE5D,KAAK,EAAE,C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AAG,EAAE,KAAK,CAAC,CAAC;IACtB,CAAC;IAEM,gBAAgB,CAAC,QAAa,EAAE,GAAW;QACjD,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;QACjC,IAAI,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;YAClD,OAAO,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC;QACD,OAAO,SAAS,CAAC;IAClB,CAAC;IAID,KAAK,CAAC,cAAc,CAAC,KAA2B,EAAE,MAA0B,EAAE,UAAoB;QACjG,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,uBAAuB,EAAE,CAAC;YACpD,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;YAC3D,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;gBACxB,OAAO,SAAS,CAAC;YAClB,CAAC;QACF,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAED,6BAA6B,CAAC,OAA+B;QAC5D,MAAM,EAAE,GAAG,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACzD,OAAO,YAAY,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC;CACD,CAAA;AA/IqB,yBAAyB;IA2B5C,WAAA,aAAa,CAAA;GA3BM,yBAAyB,CA+I9C;;AAED,MAAM,OAAO,gBAAgB;IAG5B,YAAY,UAA4B;QACvC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAC/B,CAAC;CACD","file":"abstractCodeEditorService.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["\nimport { Emitter, Event } from '../../../base/common/event.js';\nimport { IDisposable, Disposable, toDisposable } from '../../../base/common/lifecycle.js';\nimport { LinkedList } from '../../../base/common/linkedList.js';\nimport { URI } from '../../../base/common/uri.js';\nimport { ICodeEditor, IDiffEditor } from '../editorBrowser.js';\nimport { ICodeEditorOpenHandler, ICodeEditorService } from './codeEditorService.js';\nimport { IResourceEditorInput } from '../../../platform/editor/common/editor.js';\nimport { IThemeService } from '../../../platform/theme/common/themeService.js';\n\nexport abstract class AbstractCodeEditorService extends Disposable implements ICodeEditorService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _onWillCreateCodeEditor = this._register(new Emitter<void>());\n\n\tprivate readonly _onCodeEditorAdd: Emitter<ICodeEditor> = this._register(new Emitter<ICodeEditor>());\n\tpublic readonly onCodeEditorAdd: Event<ICodeEditor> = this._onCodeEditorAdd.event;\n\n\tprivate readonly _onCodeEditorRemove: Emitter<ICodeEditor> = this._register(new Emitter<ICodeEditor>());\n\tpublic readonly onCodeEditorRemove: Event<ICodeEditor> = this._onCodeEditorRemove.event;\n\n\tprivate readonly _onWillCreateDiffEditor = this._register(new Emitter<void>());\n\n\tprivate readonly _onDiffEditorAdd: Emitter<IDiffEditor> = this._register(new Emitter<IDiffEditor>());\n\tpublic readonly onDiffEditorAdd: Event<IDiffEditor> = this._onDiffEditorAdd.event;\n\n\tprivate readonly _onDiffEditorRemove: Emitter<IDiffEditor> = this._register(new Emitter<IDiffEditor>());\n\tpublic readonly onDiffEditorRemove: Event<IDiffEditor> = this._onDiffEditorRemove.event;\n\n\tprivate readonly _codeEditors: { [editorId: string]: ICodeEditor };\n\tprivate readonly _diffEditors: { [editorId: string]: IDiffEditor };\n\tprotected _globalStyleSheet: GlobalStyleSheet | null;\n\tprivate readonly _decorationOptionProviders = new Map<string, IModelDecorationOptionsProvider>();\n\tprivate readonly _codeEditorOpenHandlers = new LinkedList<ICodeEditorOpenHandler>();\n\n\tconstructor(\n\t\t@IThemeService private readonly _themeService: IThemeService,\n\t) {\n\t\tsuper();\n\t\tthis._codeEditors = Object.create(null);\n\t\tthis._diffEditors = Object.create(null);\n\t\tthis._globalStyleSheet = null;\n\t}\n\n\twillCreateCodeEditor(): void {\n\t\tthis._onWillCreateCodeEditor.fire();\n\t}\n\n\taddCodeEditor(editor: ICodeEditor): void {\n\t\tthis._codeEditors[editor.getId()] = editor;\n\t\tthis._onCodeEditorAdd.fire(editor);\n\t}\n\n\tremoveCodeEditor(editor: ICodeEditor): void {\n\t\tif (delete this._codeEditors[editor.getId()]) {\n\t\t\tthis._onCodeEditorRemove.fire(editor);\n\t\t}\n\t}\n\n\tlistCodeEditors(): ICodeEditor[] {\n\t\treturn Object.keys(this._codeEditors).map(id => this._codeEditors[id]);\n\t}\n\n\twillCreateDiffEditor(): void {\n\t\tthis._onWillCreateDiffEditor.fire();\n\t}\n\n\taddDiffEditor(editor: IDiffEditor): void {\n\t\tthis._diffEditors[editor.getId()] = editor;\n\t\tthis._onDiffEditorAdd.fire(editor);\n\t}\n\n\tremoveDiffEditor(editor: IDiffEditor): void {\n\t\tif (delete this._diffEditors[editor.getId()]) {\n\t\t\tthis._onDiffEditorRemove.fire(editor);\n\t\t}\n\t}\n\n\tlistDiffEditors(): IDiffEditor[] {\n\t\treturn Object.keys(this._diffEditors).map(id => this._diffEditors[id]);\n\t}\n\n\tgetFocusedCodeEditor(): ICodeEditor | null {\n\t\tlet editorWithWidgetFocus: ICodeEditor | null = null;\n\n\t\tconst editors = this.listCodeEditors();\n\t\tfor (const editor of editors) {\n\n\t\t\tif (editor.hasTextFocus()) {\n\t\t\t\t// bingo!\n\t\t\t\treturn editor;\n\t\t\t}\n\n\t\t\tif (editor.hasWidgetFocus()) {\n\t\t\t\teditorWithWidgetFocus = editor;\n\t\t\t}\n\t\t}\n\n\t\treturn editorWithWidgetFocus;\n\t}\n\n\tpublic removeDecorationType(key: string): void {\n\t\tconst provider = this._decorationOptionProviders.get(key);\n\t\tif (provider) {\n\t\t\tprovider.refCount--;\n\t\t\tif (provider.refCount <= 0) {\n\t\t\t\tthis._decorationOptionProviders.delete(key);\n\t\t\t\tprovider.dispose();\n\t\t\t\tthis.listCodeEditors().forEach((ed) => ed.removeDecorationsByType(key));\n\t\t\t}\n\t\t}\n\t}\n\tprivate readonly _modelProperties = new Map<string, Map<string, unknown>>();\n\n\tpublic setModelProperty(resource: URI, key: string, value: unknown): void {\n\t\tconst key1 = resource.toString();\n\t\tlet dest: Map<string, unknown>;\n\t\tif (this._modelProperties.has(key1)) {\n\t\t\tdest = this._modelProperties.get(key1)!;\n\t\t} else {\n\t\t\tdest = new Map<string, unknown>();\n\t\t\tthis._modelProperties.set(key1, dest);\n\t\t}\n\n\t\tdest.set(key, value);\n\t}\n\n\tpublic getModelProperty(resource: URI, key: string): unknown {\n\t\tconst key1 = resource.toString();\n\t\tif (this._modelProperties.has(key1)) {\n\t\t\tconst innerMap = this._modelProperties.get(key1)!;\n\t\t\treturn innerMap.get(key);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tabstract getActiveCodeEditor(): ICodeEditor | null;\n\n\tasync openCodeEditor(input: IResourceEditorInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null> {\n\t\tfor (const handler of this._codeEditorOpenHandlers) {\n\t\t\tconst candidate = await handler(input, source, sideBySide);\n\t\t\tif (candidate !== null) {\n\t\t\t\treturn candidate;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tregisterCodeEditorOpenHandler(handler: ICodeEditorOpenHandler): IDisposable {\n\t\tconst rm = this._codeEditorOpenHandlers.unshift(handler);\n\t\treturn toDisposable(rm);\n\t}\n}\n\nexport class GlobalStyleSheet {\n\tprivate readonly _styleSheet: HTMLStyleElement;\n\n\tconstructor(styleSheet: HTMLStyleElement) {\n\t\tthis._styleSheet = styleSheet;\n\t}\n}\n\ninterface IModelDecorationOptionsProvider extends IDisposable {\n\trefCount: number;\n}\n","\nimport { Emitter, Event } from '../../../base/common/event.js';\nimport { IDisposable, Disposable, toDisposable } from '../../../base/common/lifecycle.js';\nimport { LinkedList } from '../../../base/common/linkedList.js';\nimport { URI } from '../../../base/common/uri.js';\nimport { ICodeEditor, IDiffEditor } from '../editorBrowser.js';\nimport { ICodeEditorOpenHandler, ICodeEditorService } from './codeEditorService.js';\nimport { IResourceEditorInput } from '../../../platform/editor/common/editor.js';\nimport { IThemeService } from '../../../platform/theme/common/themeService.js';\n\nexport abstract class AbstractCodeEditorService extends Disposable implements ICodeEditorService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _onWillCreateCodeEditor = this._register(new Emitter<void>());\n\n\tprivate readonly _onCodeEditorAdd: Emitter<ICodeEditor> = this._register(new Emitter<ICodeEditor>());\n\tpublic readonly onCodeEditorAdd: Event<ICodeEditor> = this._onCodeEditorAdd.event;\n\n\tprivate readonly _onCodeEditorRemove: Emitter<ICodeEditor> = this._register(new Emitter<ICodeEditor>());\n\tpublic readonly onCodeEditorRemove: Event<ICodeEditor> = this._onCodeEditorRemove.event;\n\n\tprivate readonly _onWillCreateDiffEditor = this._register(new Emitter<void>());\n\n\tprivate readonly _onDiffEditorAdd: Emitter<IDiffEditor> = this._register(new Emitter<IDiffEditor>());\n\tpublic readonly onDiffEditorAdd: Event<IDiffEditor> = this._onDiffEditorAdd.event;\n\n\tprivate readonly _onDiffEditorRemove: Emitter<IDiffEditor> = this._register(new Emitter<IDiffEditor>());\n\tpublic readonly onDiffEditorRemove: Event<IDiffEditor> = this._onDiffEditorRemove.event;\n\n\tprivate readonly _codeEditors: { [editorId: string]: ICodeEditor };\n\tprivate readonly _diffEditors: { [editorId: string]: IDiffEditor };\n\tprotected _globalStyleSheet: GlobalStyleSheet | null;\n\tprivate readonly _decorationOptionProviders = new Map<string, IModelDecorationOptionsProvider>();\n\tprivate readonly _codeEditorOpenHandlers = new LinkedList<ICodeEditorOpenHandler>();\n\n\tconstructor(\n\t\t@IThemeService private readonly _themeService: IThemeService,\n\t) {\n\t\tsuper();\n\t\tthis._codeEditors = Object.create(null);\n\t\tthis._diffEditors = Object.create(null);\n\t\tthis._globalStyleSheet = null;\n\t}\n\n\twillCreateCodeEditor(): void {\n\t\tthis._onWillCreateCodeEditor.fire();\n\t}\n\n\taddCodeEditor(editor: ICodeEditor): void {\n\t\tthis._codeEditors[editor.getId()] = editor;\n\t\tthis._onCodeEditorAdd.fire(editor);\n\t}\n\n\tremoveCodeEditor(editor: ICodeEditor): void {\n\t\tif (delete this._codeEditors[editor.getId()]) {\n\t\t\tthis._onCodeEditorRemove.fire(editor);\n\t\t}\n\t}\n\n\tlistCodeEditors(): ICodeEditor[] {\n\t\treturn Object.keys(this._codeEditors).map(id => this._codeEditors[id]);\n\t}\n\n\twillCreateDiffEditor(): void {\n\t\tthis._onWillCreateDiffEditor.fire();\n\t}\n\n\taddDiffEditor(editor: IDiffEditor): void {\n\t\tthis._diffEditors[editor.getId()] = editor;\n\t\tthis._onDiffEditorAdd.fire(editor);\n\t}\n\n\tremoveDiffEditor(editor: IDiffEditor): void {\n\t\tif (delete this._diffEditors[editor.getId()]) {\n\t\t\tthis._onDiffEditorRemove.fire(editor);\n\t\t}\n\t}\n\n\tlistDiffEditors(): IDiffEditor[] {\n\t\treturn Object.keys(this._diffEditors).map(id => this._diffEditors[id]);\n\t}\n\n\tgetFocusedCodeEditor(): ICodeEditor | null {\n\t\tlet editorWithWidgetFocus: ICodeEditor | null = null;\n\n\t\tconst editors = this.listCodeEditors();\n\t\tfor (const editor of editors) {\n\n\t\t\tif (editor.hasTextFocus()) {\n\t\t\t\t// bingo!\n\t\t\t\treturn editor;\n\t\t\t}\n\n\t\t\tif (editor.hasWidgetFocus()) {\n\t\t\t\teditorWithWidgetFocus = editor;\n\t\t\t}\n\t\t}\n\n\t\treturn editorWithWidgetFocus;\n\t}\n\n\tpublic removeDecorationType(key: string): void {\n\t\tconst provider = this._decorationOptionProviders.get(key);\n\t\tif (provider) {\n\t\t\tprovider.refCount--;\n\t\t\tif (provider.refCount <= 0) {\n\t\t\t\tthis._decorationOptionProviders.delete(key);\n\t\t\t\tprovider.dispose();\n\t\t\t\tthis.listCodeEditors().forEach((ed) => ed.removeDecorationsByType(key));\n\t\t\t}\n\t\t}\n\t}\n\tprivate readonly _modelProperties = new Map<string, Map<string, unknown>>();\n\n\tpublic setModelProperty(resource: URI, key: string, value: unknown): void {\n\t\tconst key1 = resource.toString();\n\t\tlet dest: Map<string, unknown>;\n\t\tif (this._modelProperties.has(key1)) {\n\t\t\tdest = this._modelProperties.get(key1)!;\n\t\t} else {\n\t\t\tdest = new Map<string, unknown>();\n\t\t\tthis._modelProperties.set(key1, dest);\n\t\t}\n\n\t\tdest.set(key, value);\n\t}\n\n\tpublic getModelProperty(resource: URI, key: string): unknown {\n\t\tconst key1 = resource.toString();\n\t\tif (this._modelProperties.has(key1)) {\n\t\t\tconst innerMap = this._modelProperties.get(key1)!;\n\t\t\treturn innerMap.get(key);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tabstract getActiveCodeEditor(): ICodeEditor | null;\n\n\tasync openCodeEditor(input: IResourceEditorInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null> {\n\t\tfor (const handler of this._codeEditorOpenHandlers) {\n\t\t\tconst candidate = await handler(input, source, sideBySide);\n\t\t\tif (candidate !== null) {\n\t\t\t\treturn candidate;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tregisterCodeEditorOpenHandler(handler: ICodeEditorOpenHandler): IDisposable {\n\t\tconst rm = this._codeEditorOpenHandlers.unshift(handler);\n\t\treturn toDisposable(rm);\n\t}\n}\n\nexport class GlobalStyleSheet {\n\tprivate readonly _styleSheet: HTMLStyleElement;\n\n\tconstructor(styleSheet: HTMLStyleElement) {\n\t\tthis._styleSheet = styleSheet;\n\t}\n}\n\ninterface IModelDecorationOptionsProvider extends IDisposable {\n\trefCount: number;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/services/codeEditorService.ts","vs/editor/browser/services/codeEditorService.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAKhG,OAAO,EAAE,eAAe,EAAE,MAAM,yDAAyD,CAAC;AAI1F,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAqB,mBAAmB,CAAC,CAAC","file":"codeEditorService.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 { Event } from '../../../base/common/event.js';\nimport { ICodeEditor, IDiffEditor } from '../editorBrowser.js';\nimport { ITextResourceEditorInput } from '../../../platform/editor/common/editor.js';\nimport { createDecorator } from '../../../platform/instantiation/common/instantiation.js';\nimport { URI } from '../../../base/common/uri.js';\nimport { IDisposable } from '../../../base/common/lifecycle.js';\n\nexport const ICodeEditorService = createDecorator<ICodeEditorService>('codeEditorService');\n\nexport interface ICodeEditorService {\n\treadonly _serviceBrand: undefined;\n\treadonly onCodeEditorAdd: Event<ICodeEditor>;\n\treadonly onCodeEditorRemove: Event<ICodeEditor>;\n\treadonly onDiffEditorAdd: Event<IDiffEditor>;\n\treadonly onDiffEditorRemove: Event<IDiffEditor>;\n\n\twillCreateCodeEditor(): void;\n\taddCodeEditor(editor: ICodeEditor): void;\n\tremoveCodeEditor(editor: ICodeEditor): void;\n\tlistCodeEditors(): readonly ICodeEditor[];\n\n\twillCreateDiffEditor(): void;\n\taddDiffEditor(editor: IDiffEditor): void;\n\tlistDiffEditors(): readonly IDiffEditor[];\n\n\t/**\n\t * Returns the current focused code editor (if the focus is in the editor or in an editor widget) or null.\n\t */\n\tgetFocusedCodeEditor(): ICodeEditor | null;\n\tremoveDecorationType(key: string): void;\n\n\tsetModelProperty(resource: URI, key: string, value: unknown): void;\n\tgetModelProperty(resource: URI, key: string): unknown;\n\n\tgetActiveCodeEditor(): ICodeEditor | null;\n\topenCodeEditor(input: ITextResourceEditorInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null>;\n\tregisterCodeEditorOpenHandler(handler: ICodeEditorOpenHandler): IDisposable;\n}\n\nexport interface ICodeEditorOpenHandler {\n\t(input: ITextResourceEditorInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null>;\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 { Event } from '../../../base/common/event.js';\nimport { ICodeEditor, IDiffEditor } from '../editorBrowser.js';\nimport { ITextResourceEditorInput } from '../../../platform/editor/common/editor.js';\nimport { createDecorator } from '../../../platform/instantiation/common/instantiation.js';\nimport { URI } from '../../../base/common/uri.js';\nimport { IDisposable } from '../../../base/common/lifecycle.js';\n\nexport const ICodeEditorService = createDecorator<ICodeEditorService>('codeEditorService');\n\nexport interface ICodeEditorService {\n\treadonly _serviceBrand: undefined;\n\treadonly onCodeEditorAdd: Event<ICodeEditor>;\n\treadonly onCodeEditorRemove: Event<ICodeEditor>;\n\treadonly onDiffEditorAdd: Event<IDiffEditor>;\n\treadonly onDiffEditorRemove: Event<IDiffEditor>;\n\n\twillCreateCodeEditor(): void;\n\taddCodeEditor(editor: ICodeEditor): void;\n\tremoveCodeEditor(editor: ICodeEditor): void;\n\tlistCodeEditors(): readonly ICodeEditor[];\n\n\twillCreateDiffEditor(): void;\n\taddDiffEditor(editor: IDiffEditor): void;\n\tlistDiffEditors(): readonly IDiffEditor[];\n\n\t/**\n\t * Returns the current focused code editor (if the focus is in the editor or in an editor widget) or null.\n\t */\n\tgetFocusedCodeEditor(): ICodeEditor | null;\n\tremoveDecorationType(key: string): void;\n\n\tsetModelProperty(resource: URI, key: string, value: unknown): void;\n\tgetModelProperty(resource: URI, key: string): unknown;\n\n\tgetActiveCodeEditor(): ICodeEditor | null;\n\topenCodeEditor(input: ITextResourceEditorInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null>;\n\tregisterCodeEditorOpenHandler(handler: ICodeEditorOpenHandler): IDisposable;\n}\n\nexport interface ICodeEditorOpenHandler {\n\t(input: ITextResourceEditorInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null>;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/services/codeEditorService.ts","vs/editor/browser/services/codeEditorService.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAKhG,OAAO,EAAE,eAAe,EAAE,MAAM,yDAAyD,CAAC;AAI1F,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAqB,mBAAmB,CAAC,CAAC","file":"codeEditorService.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 { Event } from '../../../base/common/event.js';\nimport { ICodeEditor, IDiffEditor } from '../editorBrowser.js';\nimport { ITextResourceEditorInput } from '../../../platform/editor/common/editor.js';\nimport { createDecorator } from '../../../platform/instantiation/common/instantiation.js';\nimport { URI } from '../../../base/common/uri.js';\nimport { IDisposable } from '../../../base/common/lifecycle.js';\n\nexport const ICodeEditorService = createDecorator<ICodeEditorService>('codeEditorService');\n\nexport interface ICodeEditorService {\n\treadonly _serviceBrand: undefined;\n\treadonly onCodeEditorAdd: Event<ICodeEditor>;\n\treadonly onCodeEditorRemove: Event<ICodeEditor>;\n\treadonly onDiffEditorAdd: Event<IDiffEditor>;\n\treadonly onDiffEditorRemove: Event<IDiffEditor>;\n\n\twillCreateCodeEditor(): void;\n\taddCodeEditor(editor: ICodeEditor): void;\n\tremoveCodeEditor(editor: ICodeEditor): void;\n\tlistCodeEditors(): readonly ICodeEditor[];\n\n\twillCreateDiffEditor(): void;\n\taddDiffEditor(editor: IDiffEditor): void;\n\tremoveDiffEditor(editor: IDiffEditor): void;\n\tlistDiffEditors(): readonly IDiffEditor[];\n\n\t/**\n\t * Returns the current focused code editor (if the focus is in the editor or in an editor widget) or null.\n\t */\n\tgetFocusedCodeEditor(): ICodeEditor | null;\n\tremoveDecorationType(key: string): void;\n\n\tsetModelProperty(resource: URI, key: string, value: unknown): void;\n\tgetModelProperty(resource: URI, key: string): unknown;\n\n\tgetActiveCodeEditor(): ICodeEditor | null;\n\topenCodeEditor(input: ITextResourceEditorInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null>;\n\tregisterCodeEditorOpenHandler(handler: ICodeEditorOpenHandler): IDisposable;\n}\n\nexport interface ICodeEditorOpenHandler {\n\t(input: ITextResourceEditorInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null>;\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 { Event } from '../../../base/common/event.js';\nimport { ICodeEditor, IDiffEditor } from '../editorBrowser.js';\nimport { ITextResourceEditorInput } from '../../../platform/editor/common/editor.js';\nimport { createDecorator } from '../../../platform/instantiation/common/instantiation.js';\nimport { URI } from '../../../base/common/uri.js';\nimport { IDisposable } from '../../../base/common/lifecycle.js';\n\nexport const ICodeEditorService = createDecorator<ICodeEditorService>('codeEditorService');\n\nexport interface ICodeEditorService {\n\treadonly _serviceBrand: undefined;\n\treadonly onCodeEditorAdd: Event<ICodeEditor>;\n\treadonly onCodeEditorRemove: Event<ICodeEditor>;\n\treadonly onDiffEditorAdd: Event<IDiffEditor>;\n\treadonly onDiffEditorRemove: Event<IDiffEditor>;\n\n\twillCreateCodeEditor(): void;\n\taddCodeEditor(editor: ICodeEditor): void;\n\tremoveCodeEditor(editor: ICodeEditor): void;\n\tlistCodeEditors(): readonly ICodeEditor[];\n\n\twillCreateDiffEditor(): void;\n\taddDiffEditor(editor: IDiffEditor): void;\n\tremoveDiffEditor(editor: IDiffEditor): void;\n\tlistDiffEditors(): readonly IDiffEditor[];\n\n\t/**\n\t * Returns the current focused code editor (if the focus is in the editor or in an editor widget) or null.\n\t */\n\tgetFocusedCodeEditor(): ICodeEditor | null;\n\tremoveDecorationType(key: string): void;\n\n\tsetModelProperty(resource: URI, key: string, value: unknown): void;\n\tgetModelProperty(resource: URI, key: string): unknown;\n\n\tgetActiveCodeEditor(): ICodeEditor | null;\n\topenCodeEditor(input: ITextResourceEditorInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null>;\n\tregisterCodeEditorOpenHandler(handler: ICodeEditorOpenHandler): IDisposable;\n}\n\nexport interface ICodeEditorOpenHandler {\n\t(input: ITextResourceEditorInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null>;\n}\n"]}
|
package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/copySelection.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { addDisposableListener, getDomNodePagePosition } from '../../../../../../base/browser/dom.js';
|
|
6
|
+
import { Action } from '../../../../../../base/common/actions.js';
|
|
7
|
+
import { DisposableStore } from '../../../../../../base/common/lifecycle.js';
|
|
8
|
+
import { Position } from '../../../../../common/core/position.js';
|
|
9
|
+
import { Range } from '../../../../../common/core/range.js';
|
|
10
|
+
import { localize } from '../../../../../../nls.js';
|
|
11
|
+
export function enableCopySelection(options) {
|
|
12
|
+
const { domNode, getViewZoneId, diffEntry, originalModel, editorLineHeight, viewLineCounts, editor, showContextMenu, clipboardService, } = options;
|
|
13
|
+
let lastMouseDownPosition;
|
|
14
|
+
const viewZoneDisposable = new DisposableStore();
|
|
15
|
+
viewZoneDisposable.add(editor.onMouseDown(e => {
|
|
16
|
+
if (!e.event.leftButton) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (e.target.type !== 8 /* MouseTargetType.CONTENT_VIEW_ZONE */ &&
|
|
20
|
+
e.target.type !== 5 /* MouseTargetType.GUTTER_VIEW_ZONE */) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (e.target.detail.viewZoneId !== getViewZoneId()) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const lineNumberOffset = calculateLineNumberOffset(e.event.browserEvent.y, domNode, editorLineHeight, viewLineCounts);
|
|
27
|
+
const lineNumber = diffEntry.original.startLineNumber + lineNumberOffset;
|
|
28
|
+
lastMouseDownPosition = new Position(lineNumber, getRealColumnNumber(e.target.mouseColumn, lineNumber, originalModel));
|
|
29
|
+
}));
|
|
30
|
+
viewZoneDisposable.add(editor.onMouseUp(e => {
|
|
31
|
+
if (!lastMouseDownPosition) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const mouseDownPosition = lastMouseDownPosition;
|
|
35
|
+
lastMouseDownPosition = undefined;
|
|
36
|
+
if (!e.event.leftButton) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if ((e.target.type !== 8 /* MouseTargetType.CONTENT_VIEW_ZONE */ &&
|
|
40
|
+
e.target.type !== 5 /* MouseTargetType.GUTTER_VIEW_ZONE */) ||
|
|
41
|
+
e.target.detail.viewZoneId !== getViewZoneId()) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const lineNumberOffset = calculateLineNumberOffset(e.event.browserEvent.y, domNode, editorLineHeight, viewLineCounts);
|
|
45
|
+
const lineNumber = diffEntry.original.startLineNumber + lineNumberOffset;
|
|
46
|
+
const mouseUpPosition = new Position(lineNumber, getRealColumnNumber(e.target.mouseColumn, lineNumber, originalModel));
|
|
47
|
+
const range = mouseUpPosition.isBefore(mouseDownPosition) ?
|
|
48
|
+
Range.fromPositions(mouseUpPosition, mouseDownPosition) :
|
|
49
|
+
Range.fromPositions(mouseDownPosition, mouseUpPosition);
|
|
50
|
+
const selectedText = originalModel.getValueInRange(range);
|
|
51
|
+
const onCopy = viewZoneDisposable.add(addDisposableListener(domNode, 'copy', (e) => {
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
clipboardService.writeText(selectedText);
|
|
54
|
+
}));
|
|
55
|
+
showContextMenu({ x: e.event.posx, y: e.event.posy + editorLineHeight }, selectedText ?
|
|
56
|
+
[new Action('diff.clipboard.copySelectedDeletedContent', localize(109, 'Copy Selection'), undefined, true, async () => clipboardService.writeText(selectedText))] :
|
|
57
|
+
[], () => {
|
|
58
|
+
onCopy.dispose();
|
|
59
|
+
});
|
|
60
|
+
}));
|
|
61
|
+
return viewZoneDisposable;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Calculate the line number offset of the given browser event y-coordinate in a
|
|
65
|
+
* view zone.
|
|
66
|
+
*
|
|
67
|
+
* @param y The y-coordinate position of the browser event.
|
|
68
|
+
* @param viewZoneNode The view zone HTML element.
|
|
69
|
+
* @param editorLineHeight The line height of the editor.
|
|
70
|
+
* @param viewLineCounts The actual view lines for each editor line (considers
|
|
71
|
+
* line-wrapping).
|
|
72
|
+
* @return The line number offset in the given view zone.
|
|
73
|
+
*/
|
|
74
|
+
function calculateLineNumberOffset(y, viewZoneNode, editorLineHeight, viewLineCounts) {
|
|
75
|
+
const { top } = getDomNodePagePosition(viewZoneNode);
|
|
76
|
+
const offset = y - top;
|
|
77
|
+
const lineNumberOffset = Math.floor(offset / editorLineHeight);
|
|
78
|
+
let acc = 0;
|
|
79
|
+
for (let i = 0; i < viewLineCounts.length; i++) {
|
|
80
|
+
acc += viewLineCounts[i];
|
|
81
|
+
if (lineNumberOffset < acc) {
|
|
82
|
+
return i;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return lineNumberOffset;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Get the real column number of the given mouse column in a view zone. This
|
|
89
|
+
* compensates for different tab sizes.
|
|
90
|
+
*
|
|
91
|
+
* @param mouseColumn The mouse column position of the browser event.
|
|
92
|
+
* @param lineNumber The line number of the original text model.
|
|
93
|
+
* @param textModel The original text model.
|
|
94
|
+
* @return The real column number of the given mouse column in the view zone.
|
|
95
|
+
*/
|
|
96
|
+
function getRealColumnNumber(mouseColumn, lineNumber, textModel) {
|
|
97
|
+
const lineContent = textModel.getLineContent(lineNumber);
|
|
98
|
+
let i = 0;
|
|
99
|
+
while (i < lineContent.length && lineContent[i] === '\t') {
|
|
100
|
+
i++;
|
|
101
|
+
}
|
|
102
|
+
return Math.max(1, mouseColumn - i * (textModel.getOptions().tabSize - 1));
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=copySelection.js.map
|
package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/copySelection.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/copySelection.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AACtG,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAE7E,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAG5D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AA0CpD,MAAM,UAAU,mBAAmB,CAAC,OAA4C;IAC/E,MAAM,EACL,OAAO,EACP,aAAa,EACb,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,MAAM,EACN,eAAe,EACf,gBAAgB,GAChB,GAAG,OAA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E,WAAW,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;AAC5E,CAAC","file":"copySelection.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 { addDisposableListener, getDomNodePagePosition } from '../../../../../../base/browser/dom.js';\nimport { Action } from '../../../../../../base/common/actions.js';\nimport { DisposableStore } from '../../../../../../base/common/lifecycle.js';\nimport { ICodeEditor, MouseTargetType } from '../../../../../browser/editorBrowser.js';\nimport { Position } from '../../../../../common/core/position.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { DetailedLineRangeMapping } from '../../../../../common/diff/rangeMapping.js';\nimport { ITextModel } from '../../../../../common/model.js';\nimport { localize } from '../../../../../../nls.js';\nimport { IClipboardService } from '../../../../../../platform/clipboard/common/clipboardService.js';\n\nexport interface IEnableViewZoneCopySelectionOptions {\n\t/** The view zone HTML element that contains the deleted codes. */\n\tdomNode: HTMLElement;\n\n\t/** Returns the current view zone ID. */\n\tgetViewZoneId: () => string;\n\n\t/** The diff entry for the current view zone. */\n\tdiffEntry: DetailedLineRangeMapping;\n\n\t/** The original text model, to get the original text based on selection. */\n\toriginalModel: ITextModel;\n\n\t/** The line height of the editor, to calculate the line number offset. */\n\teditorLineHeight: number;\n\n\t/** The actual view lines for each editor line (considers line-wrapping). */\n\tviewLineCounts: number[];\n\n\t/** The editor to listen to mouse events on. */\n\teditor: ICodeEditor;\n\n\t/**\n\t * The function to show the context menu.\n\t *\n\t * @param anchor The anchor position for the context menu.\n\t * @param baseActions The base actions to show in the context menu, which will\n\t * include the \"Copy Selection\" option if any text is selected in this\n\t * view zone.\n\t * @param onHide The function to call when the context menu is dismissed.\n\t */\n\tshowContextMenu:\n\t(anchor: { x: number; y: number }, baseActions?: Action[],\n\t\tonHide?: () => void) => void;\n\n\t/** The clipboard service to write the selected text to. */\n\tclipboardService: IClipboardService;\n}\n\nexport function enableCopySelection(options: IEnableViewZoneCopySelectionOptions): DisposableStore {\n\tconst {\n\t\tdomNode,\n\t\tgetViewZoneId,\n\t\tdiffEntry,\n\t\toriginalModel,\n\t\teditorLineHeight,\n\t\tviewLineCounts,\n\t\teditor,\n\t\tshowContextMenu,\n\t\tclipboardService,\n\t} = options;\n\tlet lastMouseDownPosition: Position | undefined;\n\tconst viewZoneDisposable = new DisposableStore();\n\n\tviewZoneDisposable.add(editor.onMouseDown(e => {\n\t\tif (!e.event.leftButton) {\n\t\t\treturn;\n\t\t}\n\t\tif (e.target.type !== MouseTargetType.CONTENT_VIEW_ZONE &&\n\t\t\te.target.type !== MouseTargetType.GUTTER_VIEW_ZONE) {\n\t\t\treturn;\n\t\t}\n\t\tif (e.target.detail.viewZoneId !== getViewZoneId()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst lineNumberOffset = calculateLineNumberOffset(e.event.browserEvent.y, domNode, editorLineHeight, viewLineCounts);\n\t\tconst lineNumber = diffEntry.original.startLineNumber + lineNumberOffset;\n\t\tlastMouseDownPosition = new Position(lineNumber, getRealColumnNumber(e.target.mouseColumn, lineNumber, originalModel));\n\t}));\n\n\tviewZoneDisposable.add(editor.onMouseUp(e => {\n\t\tif (!lastMouseDownPosition) {\n\t\t\treturn;\n\t\t}\n\t\tconst mouseDownPosition = lastMouseDownPosition;\n\t\tlastMouseDownPosition = undefined;\n\n\t\tif (!e.event.leftButton) {\n\t\t\treturn;\n\t\t}\n\t\tif ((e.target.type !== MouseTargetType.CONTENT_VIEW_ZONE &&\n\t\t\te.target.type !== MouseTargetType.GUTTER_VIEW_ZONE) ||\n\t\t\te.target.detail.viewZoneId !== getViewZoneId()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst lineNumberOffset = calculateLineNumberOffset(e.event.browserEvent.y, domNode, editorLineHeight, viewLineCounts);\n\t\tconst lineNumber = diffEntry.original.startLineNumber + lineNumberOffset;\n\t\tconst mouseUpPosition = new Position(lineNumber, getRealColumnNumber(e.target.mouseColumn, lineNumber, originalModel));\n\n\t\tconst range = mouseUpPosition.isBefore(mouseDownPosition) ?\n\t\t\tRange.fromPositions(mouseUpPosition, mouseDownPosition) :\n\t\t\tRange.fromPositions(mouseDownPosition, mouseUpPosition);\n\t\tconst selectedText = originalModel.getValueInRange(range);\n\t\tconst onCopy =\n\t\t\tviewZoneDisposable.add(addDisposableListener(domNode, 'copy', (e) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tclipboardService.writeText(selectedText);\n\t\t\t}));\n\n\t\tshowContextMenu(\n\t\t\t{ x: e.event.posx, y: e.event.posy + editorLineHeight },\n\t\t\tselectedText ?\n\t\t\t\t[new Action(\n\t\t\t\t\t'diff.clipboard.copySelectedDeletedContent',\n\t\t\t\t\tlocalize(\n\t\t\t\t\t\t'diff.clipboard.copySelectedDeletedContent.label',\n\t\t\t\t\t\t'Copy Selection'),\n\t\t\t\t\tundefined, true,\n\t\t\t\t\tasync () => clipboardService.writeText(selectedText))] :\n\t\t\t\t[],\n\t\t\t() => {\n\t\t\t\tonCopy.dispose();\n\t\t\t});\n\t}));\n\treturn viewZoneDisposable;\n}\n\n/**\n * Calculate the line number offset of the given browser event y-coordinate in a\n * view zone.\n *\n * @param y The y-coordinate position of the browser event.\n * @param viewZoneNode The view zone HTML element.\n * @param editorLineHeight The line height of the editor.\n * @param viewLineCounts The actual view lines for each editor line (considers\n * line-wrapping).\n * @return The line number offset in the given view zone.\n */\nfunction calculateLineNumberOffset(\n\ty: number,\n\tviewZoneNode: HTMLElement,\n\teditorLineHeight: number,\n\tviewLineCounts: number[],\n): number {\n\tconst { top } = getDomNodePagePosition(viewZoneNode);\n\tconst offset = y - top;\n\tconst lineNumberOffset = Math.floor(offset / editorLineHeight);\n\n\tlet acc = 0;\n\tfor (let i = 0; i < viewLineCounts.length; i++) {\n\t\tacc += viewLineCounts[i];\n\t\tif (lineNumberOffset < acc) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn lineNumberOffset;\n}\n\n/**\n * Get the real column number of the given mouse column in a view zone. This\n * compensates for different tab sizes.\n *\n * @param mouseColumn The mouse column position of the browser event.\n * @param lineNumber The line number of the original text model.\n * @param textModel The original text model.\n * @return The real column number of the given mouse column in the view zone.\n */\nfunction getRealColumnNumber(\n\tmouseColumn: number,\n\tlineNumber: number,\n\ttextModel: ITextModel,\n) {\n\tconst lineContent = textModel.getLineContent(lineNumber);\n\tlet i = 0;\n\twhile (i < lineContent.length && lineContent[i] === '\\t') { i++; }\n\treturn Math.max(1, mouseColumn - i * (textModel.getOptions().tabSize - 1));\n}\n"]}
|
|
@@ -162,7 +162,7 @@ let DiffEditorViewZones = class DiffEditorViewZones extends Disposable {
|
|
|
162
162
|
if (!a.originalRange.isEmpty) {
|
|
163
163
|
originalModelTokenizationCompleted.read(reader); // Update view-zones once tokenization completes
|
|
164
164
|
const deletedCodeDomNode = document.createElement('div');
|
|
165
|
-
deletedCodeDomNode.classList.add('view-lines', 'line-delete', 'monaco-mouse-cursor-text');
|
|
165
|
+
deletedCodeDomNode.classList.add('view-lines', 'line-delete', 'line-delete-selectable', 'monaco-mouse-cursor-text');
|
|
166
166
|
const originalModel = this._editors.original.getModel();
|
|
167
167
|
// `a.originalRange` can be out of bound when the diff has not been updated yet.
|
|
168
168
|
// In this case, we do an early return.
|
|
@@ -188,7 +188,7 @@ let DiffEditorViewZones = class DiffEditorViewZones extends Disposable {
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
let zoneId = undefined;
|
|
191
|
-
alignmentViewZonesDisposables.add(new InlineDiffDeletedCodeMargin(() => assertReturnsDefined(zoneId), marginDomNode, this._editors.modified, a.diff, this._diffEditorWidget, result.viewLineCounts, this._editors.original.getModel(), this._contextMenuService, this._clipboardService));
|
|
191
|
+
alignmentViewZonesDisposables.add(new InlineDiffDeletedCodeMargin(() => assertReturnsDefined(zoneId), marginDomNode, deletedCodeDomNode, this._editors.modified, a.diff, this._diffEditorWidget, result.viewLineCounts, this._editors.original.getModel(), this._contextMenuService, this._clipboardService));
|
|
192
192
|
for (let i = 0; i < result.viewLineCounts.length; i++) {
|
|
193
193
|
const count = result.viewLineCounts[i];
|
|
194
194
|
// Account for wrapped lines in the (collapsed) original editor (which doesn't wrap lines).
|
|
@@ -210,7 +210,7 @@ let DiffEditorViewZones = class DiffEditorViewZones extends Disposable {
|
|
|
210
210
|
marginDomNode,
|
|
211
211
|
setZoneId(id) { zoneId = id; },
|
|
212
212
|
showInHiddenAreas: true,
|
|
213
|
-
suppressMouseDown:
|
|
213
|
+
suppressMouseDown: false,
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
216
|
const marginDomNode = document.createElement('div');
|