monaco-editor-core 0.55.0-dev-20251020 → 0.55.0-dev-20251021
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.messages.cs.js +1 -1
- package/esm/nls.messages.de.js +1 -1
- package/esm/nls.messages.es.js +1 -1
- package/esm/nls.messages.fr.js +1 -1
- package/esm/nls.messages.it.js +1 -1
- package/esm/nls.messages.ja.js +1 -1
- package/esm/nls.messages.ko.js +1 -1
- package/esm/nls.messages.pl.js +1 -1
- package/esm/nls.messages.pt-br.js +1 -1
- package/esm/nls.messages.ru.js +1 -1
- package/esm/nls.messages.tr.js +1 -1
- package/esm/nls.messages.zh-cn.js +1 -1
- package/esm/nls.messages.zh-tw.js +1 -1
- package/esm/vs/base/common/actions.js +5 -0
- package/esm/vs/base/common/actions.js.map +1 -1
- package/esm/vs/base/common/async.js +5 -5
- package/esm/vs/base/common/async.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +20 -12
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
- package/esm/vs/editor/browser/services/hoverService/hoverWidget.js +0 -2
- package/esm/vs/editor/browser/services/hoverService/hoverWidget.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +6 -0
- package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js +1 -0
- package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js +22 -2
- package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +0 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/telemetry.js.map +1 -1
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js +1 -4
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js.map +1 -1
- package/package.json +2 -2
- package/version.txt +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.ts","vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;gGAGgG;AAChG,OAAO,EAAE,CAAC,EAAE,MAAM,iCAAiC,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,8CAA8C,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAC7G,OAAO,EAAE,oBAAoB,EAAE,MAAM,iEAAiE,CAAC;AACvG,OAAO,EAAE,oBAAoB,EAAE,MAAM,iDAAiD,CAAC;AACvF,OAAO,EAAE,MAAM,EAAE,MAAM,gDAAgD,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAiC,MAAM,sDAAsD,CAAC;AACzH,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gEAAgE,CAAC;AAGnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAGrD,MAAM,OAAO,YAAY;IACxB,YACiB,SAAoC,EACpC,mBAA4C;QAD5C,cAAS,GAAT,SAAS,CAA2B;QACpC,wBAAmB,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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 *--------------------------------------------------------------------------------------------*/\nimport { h } from '../../../../base/browser/dom.js';\nimport { Button } from '../../../../base/browser/ui/button/button.js';\nimport { Codicon } from '../../../../base/common/codicons.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { autorun, derived, globalTransaction, observableValue } from '../../../../base/common/observable.js';\nimport { createActionViewItem } from '../../../../platform/actions/browser/menuEntryActionViewItem.js';\nimport { MenuWorkbenchToolBar } from '../../../../platform/actions/browser/toolbar.js';\nimport { MenuId } from '../../../../platform/actions/common/actions.js';\nimport { IContextKeyService, type IScopedContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js';\nimport { IDiffEditorOptions } from '../../../common/config/editorOptions.js';\nimport { OffsetRange } from '../../../common/core/ranges/offsetRange.js';\nimport { observableCodeEditor } from '../../observableCodeEditor.js';\nimport { DiffEditorWidget } from '../diffEditor/diffEditorWidget.js';\nimport { DocumentDiffItemViewModel } from './multiDiffEditorViewModel.js';\nimport { IObjectData, IPooledObject } from './objectPool.js';\nimport { ActionRunnerWithContext } from './utils.js';\nimport { IWorkbenchUIElementFactory } from './workbenchUIElementFactory.js';\n\nexport class TemplateData implements IObjectData {\n\tconstructor(\n\t\tpublic readonly viewModel: DocumentDiffItemViewModel,\n\t\tpublic readonly deltaScrollVertical: (delta: number) => void,\n\t) { }\n\n\n\tgetId(): unknown {\n\t\treturn this.viewModel;\n\t}\n}\n\nexport class DiffEditorItemTemplate extends Disposable implements IPooledObject<TemplateData> {\n\tprivate readonly _viewModel;\n\n\tprivate readonly _collapsed;\n\n\tprivate readonly _editorContentHeight;\n\tpublic readonly contentHeight;\n\n\tprivate readonly _modifiedContentWidth;\n\tprivate readonly _modifiedWidth;\n\tprivate readonly _originalContentWidth;\n\tprivate readonly _originalWidth;\n\n\tpublic readonly maxScroll;\n\n\tprivate readonly _elements;\n\n\tpublic readonly editor;\n\n\tprivate readonly isModifedFocused;\n\tprivate readonly isOriginalFocused;\n\tpublic readonly isFocused;\n\n\tprivate readonly _resourceLabel;\n\n\tprivate readonly _resourceLabel2;\n\n\tprivate readonly _outerEditorHeight: number;\n\tprivate readonly _contextKeyService: IScopedContextKeyService;\n\n\tconstructor(\n\t\tprivate readonly _container: HTMLElement,\n\t\tprivate readonly _overflowWidgetsDomNode: HTMLElement,\n\t\tprivate readonly _workbenchUIElementFactory: IWorkbenchUIElementFactory,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IContextKeyService _parentContextKeyService: IContextKeyService,\n\t) {\n\t\tsuper();\n\t\tthis._viewModel = observableValue<DocumentDiffItemViewModel | undefined>(this, undefined);\n\t\tthis._collapsed = derived(this, reader => this._viewModel.read(reader)?.collapsed.read(reader));\n\t\tthis._editorContentHeight = observableValue<number>(this, 500);\n\t\tthis.contentHeight = derived(this, reader => {\n\t\t\tconst h = this._collapsed.read(reader) ? 0 : this._editorContentHeight.read(reader);\n\t\t\treturn h + this._outerEditorHeight;\n\t\t});\n\t\tthis._modifiedContentWidth = observableValue<number>(this, 0);\n\t\tthis._modifiedWidth = observableValue<number>(this, 0);\n\t\tthis._originalContentWidth = observableValue<number>(this, 0);\n\t\tthis._originalWidth = observableValue<number>(this, 0);\n\t\tthis.maxScroll = derived(this, reader => {\n\t\t\tconst scroll1 = this._modifiedContentWidth.read(reader) - this._modifiedWidth.read(reader);\n\t\t\tconst scroll2 = this._originalContentWidth.read(reader) - this._originalWidth.read(reader);\n\t\t\tif (scroll1 > scroll2) {\n\t\t\t\treturn { maxScroll: scroll1, width: this._modifiedWidth.read(reader) };\n\t\t\t} else {\n\t\t\t\treturn { maxScroll: scroll2, width: this._originalWidth.read(reader) };\n\t\t\t}\n\t\t});\n\t\tthis._elements = h('div.multiDiffEntry', [\n\t\t\th('div.header@header', [\n\t\t\t\th('div.header-content', [\n\t\t\t\t\th('div.collapse-button@collapseButton'),\n\t\t\t\t\th('div.file-path', [\n\t\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\t\t\t\t\t\th('div.title.modified.show-file-icons@primaryPath', [] as any),\n\t\t\t\t\t\th('div.status.deleted@status', ['R']),\n\t\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\t\t\t\t\t\th('div.title.original.show-file-icons@secondaryPath', [] as any),\n\t\t\t\t\t]),\n\t\t\t\t\th('div.actions@actions'),\n\t\t\t\t]),\n\t\t\t]),\n\n\t\t\th('div.editorParent', [\n\t\t\t\th('div.editorContainer@editor'),\n\t\t\t])\n\t\t]) as Record<string, HTMLElement>;\n\t\tthis.editor = this._register(this._instantiationService.createInstance(DiffEditorWidget, this._elements.editor, {\n\t\t\toverflowWidgetsDomNode: this._overflowWidgetsDomNode,\n\t\t}, {}));\n\t\tthis.isModifedFocused = observableCodeEditor(this.editor.getModifiedEditor()).isFocused;\n\t\tthis.isOriginalFocused = observableCodeEditor(this.editor.getOriginalEditor()).isFocused;\n\t\tthis.isFocused = derived(this, reader => this.isModifedFocused.read(reader) || this.isOriginalFocused.read(reader));\n\t\tthis._resourceLabel = this._workbenchUIElementFactory.createResourceLabel\n\t\t\t? this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath))\n\t\t\t: undefined;\n\t\tthis._resourceLabel2 = this._workbenchUIElementFactory.createResourceLabel\n\t\t\t? this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath))\n\t\t\t: undefined;\n\t\tthis._dataStore = this._register(new DisposableStore());\n\t\tthis._headerHeight = 40;\n\t\tthis._lastScrollTop = -1;\n\t\tthis._isSettingScrollTop = false;\n\n\t\tconst btn = new Button(this._elements.collapseButton, {});\n\n\t\tthis._register(autorun(reader => {\n\t\t\tbtn.element.className = '';\n\t\t\tbtn.icon = this._collapsed.read(reader) ? Codicon.chevronRight : Codicon.chevronDown;\n\t\t}));\n\t\tthis._register(btn.onDidClick(() => {\n\t\t\tthis._viewModel.get()?.collapsed.set(!this._collapsed.get(), undefined);\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tthis._elements.editor.style.display = this._collapsed.read(reader) ? 'none' : 'block';\n\t\t}));\n\n\t\tthis._register(this.editor.getModifiedEditor().onDidLayoutChange(e => {\n\t\t\tconst width = this.editor.getModifiedEditor().getLayoutInfo().contentWidth;\n\t\t\tthis._modifiedWidth.set(width, undefined);\n\t\t}));\n\n\t\tthis._register(this.editor.getOriginalEditor().onDidLayoutChange(e => {\n\t\t\tconst width = this.editor.getOriginalEditor().getLayoutInfo().contentWidth;\n\t\t\tthis._originalWidth.set(width, undefined);\n\t\t}));\n\n\t\tthis._register(this.editor.onDidContentSizeChange(e => {\n\t\t\tglobalTransaction(tx => {\n\t\t\t\tthis._editorContentHeight.set(e.contentHeight, tx);\n\t\t\t\tthis._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(), tx);\n\t\t\t\tthis._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(), tx);\n\t\t\t});\n\t\t}));\n\n\t\tthis._register(this.editor.getOriginalEditor().onDidScrollChange(e => {\n\t\t\tif (this._isSettingScrollTop) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!e.scrollTopChanged || !this._data) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst delta = e.scrollTop - this._lastScrollTop;\n\t\t\tthis._data.deltaScrollVertical(delta);\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst isActive = this._viewModel.read(reader)?.isActive.read(reader);\n\t\t\tthis._elements.root.classList.toggle('active', isActive);\n\t\t}));\n\n\t\tthis._container.appendChild(this._elements.root);\n\t\tthis._outerEditorHeight = this._headerHeight;\n\n\t\tthis._contextKeyService = this._register(_parentContextKeyService.createScoped(this._elements.actions));\n\t\tconst instantiationService = this._register(this._instantiationService.createChild(new ServiceCollection([IContextKeyService, this._contextKeyService])));\n\t\tthis._register(instantiationService.createInstance(MenuWorkbenchToolBar, this._elements.actions, MenuId.MultiDiffEditorFileToolbar, {\n\t\t\tactionRunner: this._register(new ActionRunnerWithContext(() => (this._viewModel.get()?.modifiedUri))),\n\t\t\tmenuOptions: {\n\t\t\t\tshouldForwardArgs: true,\n\t\t\t},\n\t\t\ttoolbarOptions: { primaryGroup: g => g.startsWith('navigation') },\n\t\t\tactionViewItemProvider: (action, options) => createActionViewItem(instantiationService, action, options),\n\t\t}));\n\t}\n\n\tpublic setScrollLeft(left: number): void {\n\t\tif (this._modifiedContentWidth.get() - this._modifiedWidth.get() > this._originalContentWidth.get() - this._originalWidth.get()) {\n\t\t\tthis.editor.getModifiedEditor().setScrollLeft(left);\n\t\t} else {\n\t\t\tthis.editor.getOriginalEditor().setScrollLeft(left);\n\t\t}\n\t}\n\n\tprivate readonly _dataStore;\n\n\tprivate _data: TemplateData | undefined;\n\n\tpublic setData(data: TemplateData | undefined): void {\n\t\tthis._data = data;\n\t\tfunction updateOptions(options: IDiffEditorOptions): IDiffEditorOptions {\n\t\t\treturn {\n\t\t\t\t...options,\n\t\t\t\tscrollBeyondLastLine: false,\n\t\t\t\thideUnchangedRegions: {\n\t\t\t\t\tenabled: true,\n\t\t\t\t},\n\t\t\t\tscrollbar: {\n\t\t\t\t\tvertical: 'hidden',\n\t\t\t\t\thorizontal: 'hidden',\n\t\t\t\t\thandleMouseWheel: false,\n\t\t\t\t\tuseShadows: false,\n\t\t\t\t},\n\t\t\t\trenderOverviewRuler: false,\n\t\t\t\tfixedOverflowWidgets: true,\n\t\t\t\toverviewRulerBorder: false,\n\t\t\t};\n\t\t}\n\n\t\tif (!data) {\n\t\t\tglobalTransaction(tx => {\n\t\t\t\tthis._viewModel.set(undefined, tx);\n\t\t\t\tthis.editor.setDiffModel(null, tx);\n\t\t\t\tthis._dataStore.clear();\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tconst value = data.viewModel.documentDiffItem;\n\n\t\tglobalTransaction(tx => {\n\t\t\tthis._resourceLabel?.setUri(data.viewModel.modifiedUri ?? data.viewModel.originalUri!, { strikethrough: data.viewModel.modifiedUri === undefined });\n\n\t\t\tlet isRenamed = false;\n\t\t\tlet isDeleted = false;\n\t\t\tlet isAdded = false;\n\t\t\tlet flag = '';\n\t\t\tif (data.viewModel.modifiedUri && data.viewModel.originalUri && data.viewModel.modifiedUri.path !== data.viewModel.originalUri.path) {\n\t\t\t\tflag = 'R';\n\t\t\t\tisRenamed = true;\n\t\t\t} else if (!data.viewModel.modifiedUri) {\n\t\t\t\tflag = 'D';\n\t\t\t\tisDeleted = true;\n\t\t\t} else if (!data.viewModel.originalUri) {\n\t\t\t\tflag = 'A';\n\t\t\t\tisAdded = true;\n\t\t\t}\n\t\t\tthis._elements.status.classList.toggle('renamed', isRenamed);\n\t\t\tthis._elements.status.classList.toggle('deleted', isDeleted);\n\t\t\tthis._elements.status.classList.toggle('added', isAdded);\n\t\t\tthis._elements.status.innerText = flag;\n\n\t\t\tthis._resourceLabel2?.setUri(isRenamed ? data.viewModel.originalUri : undefined, { strikethrough: true });\n\n\t\t\tthis._dataStore.clear();\n\t\t\tthis._viewModel.set(data.viewModel, tx);\n\t\t\tthis.editor.setDiffModel(data.viewModel.diffEditorViewModelRef, tx);\n\t\t\tthis.editor.updateOptions(updateOptions(value.options ?? {}));\n\t\t});\n\t\tif (value.onOptionsDidChange) {\n\t\t\tthis._dataStore.add(value.onOptionsDidChange(() => {\n\t\t\t\tthis.editor.updateOptions(updateOptions(value.options ?? {}));\n\t\t\t}));\n\t\t}\n\t\tdata.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore, value => {\n\t\t\tif (!value) {\n\t\t\t\tthis.setData(undefined);\n\t\t\t}\n\t\t});\n\n\t\tif (data.viewModel.documentDiffItem.contextKeys) {\n\t\t\tfor (const [key, value] of Object.entries(data.viewModel.documentDiffItem.contextKeys)) {\n\t\t\t\tthis._contextKeyService.createKey(key, value);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate readonly _headerHeight;\n\n\tprivate _lastScrollTop;\n\tprivate _isSettingScrollTop;\n\n\tpublic render(verticalRange: OffsetRange, width: number, editorScroll: number, viewPort: OffsetRange): void {\n\t\tthis._elements.root.style.visibility = 'visible';\n\t\tthis._elements.root.style.top = `${verticalRange.start}px`;\n\t\tthis._elements.root.style.height = `${verticalRange.length}px`;\n\t\tthis._elements.root.style.width = `${width}px`;\n\t\tthis._elements.root.style.position = 'absolute';\n\n\t\t// For sticky scroll\n\t\tconst maxDelta = verticalRange.length - this._headerHeight;\n\t\tconst delta = Math.max(0, Math.min(viewPort.start - verticalRange.start, maxDelta));\n\t\tthis._elements.header.style.transform = `translateY(${delta}px)`;\n\n\t\tglobalTransaction(tx => {\n\t\t\tthis.editor.layout({\n\t\t\t\twidth: width - 2 * 8 - 2 * 1,\n\t\t\t\theight: verticalRange.length - this._outerEditorHeight,\n\t\t\t});\n\t\t});\n\t\ttry {\n\t\t\tthis._isSettingScrollTop = true;\n\t\t\tthis._lastScrollTop = editorScroll;\n\t\t\tthis.editor.getOriginalEditor().setScrollTop(editorScroll);\n\t\t} finally {\n\t\t\tthis._isSettingScrollTop = false;\n\t\t}\n\n\t\tthis._elements.header.classList.toggle('shadow', delta > 0 || editorScroll > 0);\n\t\tthis._elements.header.classList.toggle('collapsed', delta === maxDelta);\n\t}\n\n\tpublic hide(): void {\n\t\tthis._elements.root.style.top = `-100000px`;\n\t\tthis._elements.root.style.visibility = 'hidden'; // Some editor parts are still visible\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { h } from '../../../../base/browser/dom.js';\nimport { Button } from '../../../../base/browser/ui/button/button.js';\nimport { Codicon } from '../../../../base/common/codicons.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { autorun, derived, globalTransaction, observableValue } from '../../../../base/common/observable.js';\nimport { createActionViewItem } from '../../../../platform/actions/browser/menuEntryActionViewItem.js';\nimport { MenuWorkbenchToolBar } from '../../../../platform/actions/browser/toolbar.js';\nimport { MenuId } from '../../../../platform/actions/common/actions.js';\nimport { IContextKeyService, type IScopedContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js';\nimport { IDiffEditorOptions } from '../../../common/config/editorOptions.js';\nimport { OffsetRange } from '../../../common/core/ranges/offsetRange.js';\nimport { observableCodeEditor } from '../../observableCodeEditor.js';\nimport { DiffEditorWidget } from '../diffEditor/diffEditorWidget.js';\nimport { DocumentDiffItemViewModel } from './multiDiffEditorViewModel.js';\nimport { IObjectData, IPooledObject } from './objectPool.js';\nimport { ActionRunnerWithContext } from './utils.js';\nimport { IWorkbenchUIElementFactory } from './workbenchUIElementFactory.js';\n\nexport class TemplateData implements IObjectData {\n\tconstructor(\n\t\tpublic readonly viewModel: DocumentDiffItemViewModel,\n\t\tpublic readonly deltaScrollVertical: (delta: number) => void,\n\t) { }\n\n\n\tgetId(): unknown {\n\t\treturn this.viewModel;\n\t}\n}\n\nexport class DiffEditorItemTemplate extends Disposable implements IPooledObject<TemplateData> {\n\tprivate readonly _viewModel;\n\n\tprivate readonly _collapsed;\n\n\tprivate readonly _editorContentHeight;\n\tpublic readonly contentHeight;\n\n\tprivate readonly _modifiedContentWidth;\n\tprivate readonly _modifiedWidth;\n\tprivate readonly _originalContentWidth;\n\tprivate readonly _originalWidth;\n\n\tpublic readonly maxScroll;\n\n\tprivate readonly _elements;\n\n\tpublic readonly editor;\n\n\tprivate readonly isModifedFocused;\n\tprivate readonly isOriginalFocused;\n\tpublic readonly isFocused;\n\n\tprivate readonly _resourceLabel;\n\n\tprivate readonly _resourceLabel2;\n\n\tprivate readonly _outerEditorHeight: number;\n\tprivate readonly _contextKeyService: IScopedContextKeyService;\n\n\tconstructor(\n\t\tprivate readonly _container: HTMLElement,\n\t\tprivate readonly _overflowWidgetsDomNode: HTMLElement,\n\t\tprivate readonly _workbenchUIElementFactory: IWorkbenchUIElementFactory,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IContextKeyService _parentContextKeyService: IContextKeyService,\n\t) {\n\t\tsuper();\n\t\tthis._viewModel = observableValue<DocumentDiffItemViewModel | undefined>(this, undefined);\n\t\tthis._collapsed = derived(this, reader => this._viewModel.read(reader)?.collapsed.read(reader));\n\t\tthis._editorContentHeight = observableValue<number>(this, 500);\n\t\tthis.contentHeight = derived(this, reader => {\n\t\t\tconst h = this._collapsed.read(reader) ? 0 : this._editorContentHeight.read(reader);\n\t\t\treturn h + this._outerEditorHeight;\n\t\t});\n\t\tthis._modifiedContentWidth = observableValue<number>(this, 0);\n\t\tthis._modifiedWidth = observableValue<number>(this, 0);\n\t\tthis._originalContentWidth = observableValue<number>(this, 0);\n\t\tthis._originalWidth = observableValue<number>(this, 0);\n\t\tthis.maxScroll = derived(this, reader => {\n\t\t\tconst scroll1 = this._modifiedContentWidth.read(reader) - this._modifiedWidth.read(reader);\n\t\t\tconst scroll2 = this._originalContentWidth.read(reader) - this._originalWidth.read(reader);\n\t\t\tif (scroll1 > scroll2) {\n\t\t\t\treturn { maxScroll: scroll1, width: this._modifiedWidth.read(reader) };\n\t\t\t} else {\n\t\t\t\treturn { maxScroll: scroll2, width: this._originalWidth.read(reader) };\n\t\t\t}\n\t\t});\n\t\tthis._elements = h('div.multiDiffEntry', [\n\t\t\th('div.header@header', [\n\t\t\t\th('div.header-content', [\n\t\t\t\t\th('div.collapse-button@collapseButton'),\n\t\t\t\t\th('div.file-path', [\n\t\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\t\t\t\t\t\th('div.title.modified.show-file-icons@primaryPath', [] as any),\n\t\t\t\t\t\th('div.status.deleted@status', ['R']),\n\t\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\t\t\t\t\t\th('div.title.original.show-file-icons@secondaryPath', [] as any),\n\t\t\t\t\t]),\n\t\t\t\t\th('div.actions@actions'),\n\t\t\t\t]),\n\t\t\t]),\n\n\t\t\th('div.editorParent', [\n\t\t\t\th('div.editorContainer@editor'),\n\t\t\t])\n\t\t]) as Record<string, HTMLElement>;\n\t\tthis.editor = this._register(this._instantiationService.createInstance(DiffEditorWidget, this._elements.editor, {\n\t\t\toverflowWidgetsDomNode: this._overflowWidgetsDomNode,\n\t\t}, {}));\n\t\tthis.isModifedFocused = observableCodeEditor(this.editor.getModifiedEditor()).isFocused;\n\t\tthis.isOriginalFocused = observableCodeEditor(this.editor.getOriginalEditor()).isFocused;\n\t\tthis.isFocused = derived(this, reader => this.isModifedFocused.read(reader) || this.isOriginalFocused.read(reader));\n\t\tthis._resourceLabel = this._workbenchUIElementFactory.createResourceLabel\n\t\t\t? this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath))\n\t\t\t: undefined;\n\t\tthis._resourceLabel2 = this._workbenchUIElementFactory.createResourceLabel\n\t\t\t? this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath))\n\t\t\t: undefined;\n\t\tthis._dataStore = this._register(new DisposableStore());\n\t\tthis._headerHeight = 40;\n\t\tthis._lastScrollTop = -1;\n\t\tthis._isSettingScrollTop = false;\n\n\t\tconst btn = new Button(this._elements.collapseButton, {});\n\n\t\tthis._register(autorun(reader => {\n\t\t\tbtn.element.className = '';\n\t\t\tbtn.icon = this._collapsed.read(reader) ? Codicon.chevronRight : Codicon.chevronDown;\n\t\t}));\n\t\tthis._register(btn.onDidClick(() => {\n\t\t\tthis._viewModel.get()?.collapsed.set(!this._collapsed.get(), undefined);\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tthis._elements.editor.style.display = this._collapsed.read(reader) ? 'none' : 'block';\n\t\t}));\n\n\t\tthis._register(this.editor.getModifiedEditor().onDidLayoutChange(e => {\n\t\t\tconst width = this.editor.getModifiedEditor().getLayoutInfo().contentWidth;\n\t\t\tthis._modifiedWidth.set(width, undefined);\n\t\t}));\n\n\t\tthis._register(this.editor.getOriginalEditor().onDidLayoutChange(e => {\n\t\t\tconst width = this.editor.getOriginalEditor().getLayoutInfo().contentWidth;\n\t\t\tthis._originalWidth.set(width, undefined);\n\t\t}));\n\n\t\tthis._register(this.editor.onDidContentSizeChange(e => {\n\t\t\tglobalTransaction(tx => {\n\t\t\t\tthis._editorContentHeight.set(e.contentHeight, tx);\n\t\t\t\tthis._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(), tx);\n\t\t\t\tthis._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(), tx);\n\t\t\t});\n\t\t}));\n\n\t\tthis._register(this.editor.getOriginalEditor().onDidScrollChange(e => {\n\t\t\tif (this._isSettingScrollTop) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!e.scrollTopChanged || !this._data) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst delta = e.scrollTop - this._lastScrollTop;\n\t\t\tthis._data.deltaScrollVertical(delta);\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst isActive = this._viewModel.read(reader)?.isActive.read(reader);\n\t\t\tthis._elements.root.classList.toggle('active', isActive);\n\t\t}));\n\n\t\tthis._container.appendChild(this._elements.root);\n\t\tthis._outerEditorHeight = this._headerHeight;\n\n\t\tthis._contextKeyService = this._register(_parentContextKeyService.createScoped(this._elements.actions));\n\t\tconst instantiationService = this._register(this._instantiationService.createChild(new ServiceCollection([IContextKeyService, this._contextKeyService])));\n\t\tthis._register(instantiationService.createInstance(MenuWorkbenchToolBar, this._elements.actions, MenuId.MultiDiffEditorFileToolbar, {\n\t\t\tactionRunner: this._register(new ActionRunnerWithContext(() => (this._viewModel.get()?.modifiedUri))),\n\t\t\tmenuOptions: {\n\t\t\t\tshouldForwardArgs: true,\n\t\t\t},\n\t\t\ttoolbarOptions: { primaryGroup: g => g.startsWith('navigation') },\n\t\t\tactionViewItemProvider: (action, options) => createActionViewItem(instantiationService, action, options),\n\t\t}));\n\t}\n\n\tpublic setScrollLeft(left: number): void {\n\t\tif (this._modifiedContentWidth.get() - this._modifiedWidth.get() > this._originalContentWidth.get() - this._originalWidth.get()) {\n\t\t\tthis.editor.getModifiedEditor().setScrollLeft(left);\n\t\t} else {\n\t\t\tthis.editor.getOriginalEditor().setScrollLeft(left);\n\t\t}\n\t}\n\n\tprivate readonly _dataStore;\n\n\tprivate _data: TemplateData | undefined;\n\n\tpublic setData(data: TemplateData | undefined): void {\n\t\tthis._data = data;\n\t\tfunction updateOptions(options: IDiffEditorOptions): IDiffEditorOptions {\n\t\t\treturn {\n\t\t\t\t...options,\n\t\t\t\tscrollBeyondLastLine: false,\n\t\t\t\thideUnchangedRegions: {\n\t\t\t\t\tenabled: true,\n\t\t\t\t},\n\t\t\t\tscrollbar: {\n\t\t\t\t\tvertical: 'hidden',\n\t\t\t\t\thorizontal: 'hidden',\n\t\t\t\t\thandleMouseWheel: false,\n\t\t\t\t\tuseShadows: false,\n\t\t\t\t},\n\t\t\t\trenderOverviewRuler: false,\n\t\t\t\tfixedOverflowWidgets: true,\n\t\t\t\toverviewRulerBorder: false,\n\t\t\t};\n\t\t}\n\n\t\tif (!data) {\n\t\t\tglobalTransaction(tx => {\n\t\t\t\tthis._viewModel.set(undefined, tx);\n\t\t\t\tthis.editor.setDiffModel(null, tx);\n\t\t\t\tthis._dataStore.clear();\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tconst value = data.viewModel.documentDiffItem;\n\n\t\tglobalTransaction(tx => {\n\t\t\tthis._resourceLabel?.setUri(data.viewModel.modifiedUri ?? data.viewModel.originalUri!, { strikethrough: data.viewModel.modifiedUri === undefined });\n\n\t\t\tlet isRenamed = false;\n\t\t\tlet isDeleted = false;\n\t\t\tlet isAdded = false;\n\t\t\tlet flag = '';\n\t\t\tif (data.viewModel.modifiedUri && data.viewModel.originalUri && data.viewModel.modifiedUri.path !== data.viewModel.originalUri.path) {\n\t\t\t\tflag = 'R';\n\t\t\t\tisRenamed = true;\n\t\t\t} else if (!data.viewModel.modifiedUri) {\n\t\t\t\tflag = 'D';\n\t\t\t\tisDeleted = true;\n\t\t\t} else if (!data.viewModel.originalUri) {\n\t\t\t\tflag = 'A';\n\t\t\t\tisAdded = true;\n\t\t\t}\n\t\t\tthis._elements.status.classList.toggle('renamed', isRenamed);\n\t\t\tthis._elements.status.classList.toggle('deleted', isDeleted);\n\t\t\tthis._elements.status.classList.toggle('added', isAdded);\n\t\t\tthis._elements.status.innerText = flag;\n\n\t\t\tthis._resourceLabel2?.setUri(isRenamed ? data.viewModel.originalUri : undefined, { strikethrough: true });\n\n\t\t\tthis._dataStore.clear();\n\t\t\tthis._viewModel.set(data.viewModel, tx);\n\t\t\tthis.editor.setDiffModel(data.viewModel.diffEditorViewModelRef, tx);\n\t\t\tthis.editor.updateOptions(updateOptions(value.options ?? {}));\n\t\t});\n\t\tif (value.onOptionsDidChange) {\n\t\t\tthis._dataStore.add(value.onOptionsDidChange(() => {\n\t\t\t\tthis.editor.updateOptions(updateOptions(value.options ?? {}));\n\t\t\t}));\n\t\t}\n\t\tdata.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore, value => {\n\t\t\tif (!value) {\n\t\t\t\tthis.setData(undefined);\n\t\t\t}\n\t\t});\n\n\t\tif (data.viewModel.documentDiffItem.contextKeys) {\n\t\t\tfor (const [key, value] of Object.entries(data.viewModel.documentDiffItem.contextKeys)) {\n\t\t\t\tthis._contextKeyService.createKey(key, value);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate readonly _headerHeight;\n\n\tprivate _lastScrollTop;\n\tprivate _isSettingScrollTop;\n\n\tpublic render(verticalRange: OffsetRange, width: number, editorScroll: number, viewPort: OffsetRange): void {\n\t\tthis._elements.root.style.visibility = 'visible';\n\t\tthis._elements.root.style.top = `${verticalRange.start}px`;\n\t\tthis._elements.root.style.height = `${verticalRange.length}px`;\n\t\tthis._elements.root.style.width = `${width}px`;\n\t\tthis._elements.root.style.position = 'absolute';\n\n\t\t// For sticky scroll\n\t\tconst maxDelta = verticalRange.length - this._headerHeight;\n\t\tconst delta = Math.max(0, Math.min(viewPort.start - verticalRange.start, maxDelta));\n\t\tthis._elements.header.style.transform = `translateY(${delta}px)`;\n\n\t\tglobalTransaction(tx => {\n\t\t\tthis.editor.layout({\n\t\t\t\twidth: width - 2 * 8 - 2 * 1,\n\t\t\t\theight: verticalRange.length - this._outerEditorHeight,\n\t\t\t});\n\t\t});\n\t\ttry {\n\t\t\tthis._isSettingScrollTop = true;\n\t\t\tthis._lastScrollTop = editorScroll;\n\t\t\tthis.editor.getOriginalEditor().setScrollTop(editorScroll);\n\t\t} finally {\n\t\t\tthis._isSettingScrollTop = false;\n\t\t}\n\n\t\tthis._elements.header.classList.toggle('shadow', delta > 0 || editorScroll > 0);\n\t\tthis._elements.header.classList.toggle('collapsed', delta === maxDelta);\n\t}\n\n\tpublic hide(): void {\n\t\tthis._elements.root.style.top = `-100000px`;\n\t\tthis._elements.root.style.visibility = 'hidden'; // Some editor parts are still visible\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.ts","vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;gGAGgG;AAChG,OAAO,EAAE,CAAC,EAAE,MAAM,iCAAiC,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,8CAA8C,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MA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,YAAY,CAAC,CAAC;QAC5D,CAAC;gBAAS,CAAC;YACV,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;QAClC,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,GAAG,CAAC,IAAI,YAAY,GAAG,CAAC,CAAC,CAAC;QAChF,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,KAAK,QAAQ,CAAC,CAAC;IACzE,CAAC;IAEM,IAAI;QACV,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,WAAW,CAAC;QAC5C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC,CAAC,sCAAsC;IACxF,CAAC;CACD,CAAA;AAjSY,sBAAsB;IAkChC,WAAA,qBAAqB,CAAA;IACrB,WAAA,kBAAkB,CAAA;GAnCR,sBAAsB,CAiSlC","file":"diffEditorItemTemplate.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 *--------------------------------------------------------------------------------------------*/\nimport { h } from '../../../../base/browser/dom.js';\nimport { Button } from '../../../../base/browser/ui/button/button.js';\nimport { Codicon } from '../../../../base/common/codicons.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { autorun, derived, globalTransaction, observableValue } from '../../../../base/common/observable.js';\nimport { createActionViewItem } from '../../../../platform/actions/browser/menuEntryActionViewItem.js';\nimport { MenuWorkbenchToolBar } from '../../../../platform/actions/browser/toolbar.js';\nimport { MenuId } from '../../../../platform/actions/common/actions.js';\nimport { IContextKeyService, type IScopedContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js';\nimport { IDiffEditorOptions } from '../../../common/config/editorOptions.js';\nimport { OffsetRange } from '../../../common/core/ranges/offsetRange.js';\nimport { observableCodeEditor } from '../../observableCodeEditor.js';\nimport { DiffEditorWidget } from '../diffEditor/diffEditorWidget.js';\nimport { DocumentDiffItemViewModel } from './multiDiffEditorViewModel.js';\nimport { IObjectData, IPooledObject } from './objectPool.js';\nimport { ActionRunnerWithContext } from './utils.js';\nimport { IWorkbenchUIElementFactory } from './workbenchUIElementFactory.js';\n\nexport class TemplateData implements IObjectData {\n\tconstructor(\n\t\tpublic readonly viewModel: DocumentDiffItemViewModel,\n\t\tpublic readonly deltaScrollVertical: (delta: number) => void,\n\t) { }\n\n\n\tgetId(): unknown {\n\t\treturn this.viewModel;\n\t}\n}\n\nexport class DiffEditorItemTemplate extends Disposable implements IPooledObject<TemplateData> {\n\tprivate readonly _viewModel;\n\n\tprivate readonly _collapsed;\n\n\tprivate readonly _editorContentHeight;\n\tpublic readonly contentHeight;\n\n\tprivate readonly _modifiedContentWidth;\n\tprivate readonly _modifiedWidth;\n\tprivate readonly _originalContentWidth;\n\tprivate readonly _originalWidth;\n\n\tpublic readonly maxScroll;\n\n\tprivate readonly _elements;\n\n\tpublic readonly editor;\n\n\tprivate readonly isModifedFocused;\n\tprivate readonly isOriginalFocused;\n\tpublic readonly isFocused;\n\n\tprivate readonly _resourceLabel;\n\n\tprivate readonly _resourceLabel2;\n\n\tprivate readonly _outerEditorHeight: number;\n\tprivate readonly _contextKeyService: IScopedContextKeyService;\n\n\tconstructor(\n\t\tprivate readonly _container: HTMLElement,\n\t\tprivate readonly _overflowWidgetsDomNode: HTMLElement,\n\t\tprivate readonly _workbenchUIElementFactory: IWorkbenchUIElementFactory,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IContextKeyService _parentContextKeyService: IContextKeyService,\n\t) {\n\t\tsuper();\n\t\tthis._viewModel = observableValue<DocumentDiffItemViewModel | undefined>(this, undefined);\n\t\tthis._collapsed = derived(this, reader => this._viewModel.read(reader)?.collapsed.read(reader));\n\t\tthis._editorContentHeight = observableValue<number>(this, 500);\n\t\tthis.contentHeight = derived(this, reader => {\n\t\t\tconst h = this._collapsed.read(reader) ? 0 : this._editorContentHeight.read(reader);\n\t\t\treturn h + this._outerEditorHeight;\n\t\t});\n\t\tthis._modifiedContentWidth = observableValue<number>(this, 0);\n\t\tthis._modifiedWidth = observableValue<number>(this, 0);\n\t\tthis._originalContentWidth = observableValue<number>(this, 0);\n\t\tthis._originalWidth = observableValue<number>(this, 0);\n\t\tthis.maxScroll = derived(this, reader => {\n\t\t\tconst scroll1 = this._modifiedContentWidth.read(reader) - this._modifiedWidth.read(reader);\n\t\t\tconst scroll2 = this._originalContentWidth.read(reader) - this._originalWidth.read(reader);\n\t\t\tif (scroll1 > scroll2) {\n\t\t\t\treturn { maxScroll: scroll1, width: this._modifiedWidth.read(reader) };\n\t\t\t} else {\n\t\t\t\treturn { maxScroll: scroll2, width: this._originalWidth.read(reader) };\n\t\t\t}\n\t\t});\n\t\tthis._elements = h('div.multiDiffEntry', [\n\t\t\th('div.header@header', [\n\t\t\t\th('div.header-content', [\n\t\t\t\t\th('div.collapse-button@collapseButton'),\n\t\t\t\t\th('div.file-path', [\n\t\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\t\t\t\t\t\th('div.title.modified.show-file-icons@primaryPath', [] as any),\n\t\t\t\t\t\th('div.status.deleted@status', ['R']),\n\t\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\t\t\t\t\t\th('div.title.original.show-file-icons@secondaryPath', [] as any),\n\t\t\t\t\t]),\n\t\t\t\t\th('div.actions@actions'),\n\t\t\t\t]),\n\t\t\t]),\n\n\t\t\th('div.editorParent', [\n\t\t\t\th('div.editorContainer@editor'),\n\t\t\t])\n\t\t]) as Record<string, HTMLElement>;\n\t\tthis.editor = this._register(this._instantiationService.createInstance(DiffEditorWidget, this._elements.editor, {\n\t\t\toverflowWidgetsDomNode: this._overflowWidgetsDomNode,\n\t\t\tfixedOverflowWidgets: true\n\t\t}, {}));\n\t\tthis.isModifedFocused = observableCodeEditor(this.editor.getModifiedEditor()).isFocused;\n\t\tthis.isOriginalFocused = observableCodeEditor(this.editor.getOriginalEditor()).isFocused;\n\t\tthis.isFocused = derived(this, reader => this.isModifedFocused.read(reader) || this.isOriginalFocused.read(reader));\n\t\tthis._resourceLabel = this._workbenchUIElementFactory.createResourceLabel\n\t\t\t? this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath))\n\t\t\t: undefined;\n\t\tthis._resourceLabel2 = this._workbenchUIElementFactory.createResourceLabel\n\t\t\t? this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath))\n\t\t\t: undefined;\n\t\tthis._dataStore = this._register(new DisposableStore());\n\t\tthis._headerHeight = 40;\n\t\tthis._lastScrollTop = -1;\n\t\tthis._isSettingScrollTop = false;\n\n\t\tconst btn = new Button(this._elements.collapseButton, {});\n\n\t\tthis._register(autorun(reader => {\n\t\t\tbtn.element.className = '';\n\t\t\tbtn.icon = this._collapsed.read(reader) ? Codicon.chevronRight : Codicon.chevronDown;\n\t\t}));\n\t\tthis._register(btn.onDidClick(() => {\n\t\t\tthis._viewModel.get()?.collapsed.set(!this._collapsed.get(), undefined);\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tthis._elements.editor.style.display = this._collapsed.read(reader) ? 'none' : 'block';\n\t\t}));\n\n\t\tthis._register(this.editor.getModifiedEditor().onDidLayoutChange(e => {\n\t\t\tconst width = this.editor.getModifiedEditor().getLayoutInfo().contentWidth;\n\t\t\tthis._modifiedWidth.set(width, undefined);\n\t\t}));\n\n\t\tthis._register(this.editor.getOriginalEditor().onDidLayoutChange(e => {\n\t\t\tconst width = this.editor.getOriginalEditor().getLayoutInfo().contentWidth;\n\t\t\tthis._originalWidth.set(width, undefined);\n\t\t}));\n\n\t\tthis._register(this.editor.onDidContentSizeChange(e => {\n\t\t\tglobalTransaction(tx => {\n\t\t\t\tthis._editorContentHeight.set(e.contentHeight, tx);\n\t\t\t\tthis._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(), tx);\n\t\t\t\tthis._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(), tx);\n\t\t\t});\n\t\t}));\n\n\t\tthis._register(this.editor.getOriginalEditor().onDidScrollChange(e => {\n\t\t\tif (this._isSettingScrollTop) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!e.scrollTopChanged || !this._data) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst delta = e.scrollTop - this._lastScrollTop;\n\t\t\tthis._data.deltaScrollVertical(delta);\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst isActive = this._viewModel.read(reader)?.isActive.read(reader);\n\t\t\tthis._elements.root.classList.toggle('active', isActive);\n\t\t}));\n\n\t\tthis._container.appendChild(this._elements.root);\n\t\tthis._outerEditorHeight = this._headerHeight;\n\n\t\tthis._contextKeyService = this._register(_parentContextKeyService.createScoped(this._elements.actions));\n\t\tconst instantiationService = this._register(this._instantiationService.createChild(new ServiceCollection([IContextKeyService, this._contextKeyService])));\n\t\tthis._register(instantiationService.createInstance(MenuWorkbenchToolBar, this._elements.actions, MenuId.MultiDiffEditorFileToolbar, {\n\t\t\tactionRunner: this._register(new ActionRunnerWithContext(() => (this._viewModel.get()?.modifiedUri))),\n\t\t\tmenuOptions: {\n\t\t\t\tshouldForwardArgs: true,\n\t\t\t},\n\t\t\ttoolbarOptions: { primaryGroup: g => g.startsWith('navigation') },\n\t\t\tactionViewItemProvider: (action, options) => createActionViewItem(instantiationService, action, options),\n\t\t}));\n\t}\n\n\tpublic setScrollLeft(left: number): void {\n\t\tif (this._modifiedContentWidth.get() - this._modifiedWidth.get() > this._originalContentWidth.get() - this._originalWidth.get()) {\n\t\t\tthis.editor.getModifiedEditor().setScrollLeft(left);\n\t\t} else {\n\t\t\tthis.editor.getOriginalEditor().setScrollLeft(left);\n\t\t}\n\t}\n\n\tprivate readonly _dataStore;\n\n\tprivate _data: TemplateData | undefined;\n\n\tpublic setData(data: TemplateData | undefined): void {\n\t\tthis._data = data;\n\t\tfunction updateOptions(options: IDiffEditorOptions): IDiffEditorOptions {\n\t\t\treturn {\n\t\t\t\t...options,\n\t\t\t\tscrollBeyondLastLine: false,\n\t\t\t\thideUnchangedRegions: {\n\t\t\t\t\tenabled: true,\n\t\t\t\t},\n\t\t\t\tscrollbar: {\n\t\t\t\t\tvertical: 'hidden',\n\t\t\t\t\thorizontal: 'hidden',\n\t\t\t\t\thandleMouseWheel: false,\n\t\t\t\t\tuseShadows: false,\n\t\t\t\t},\n\t\t\t\trenderOverviewRuler: false,\n\t\t\t\tfixedOverflowWidgets: true,\n\t\t\t\toverviewRulerBorder: false,\n\t\t\t};\n\t\t}\n\n\t\tif (!data) {\n\t\t\tglobalTransaction(tx => {\n\t\t\t\tthis._viewModel.set(undefined, tx);\n\t\t\t\tthis.editor.setDiffModel(null, tx);\n\t\t\t\tthis._dataStore.clear();\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tconst value = data.viewModel.documentDiffItem;\n\n\t\tglobalTransaction(tx => {\n\t\t\tthis._resourceLabel?.setUri(data.viewModel.modifiedUri ?? data.viewModel.originalUri!, { strikethrough: data.viewModel.modifiedUri === undefined });\n\n\t\t\tlet isRenamed = false;\n\t\t\tlet isDeleted = false;\n\t\t\tlet isAdded = false;\n\t\t\tlet flag = '';\n\t\t\tif (data.viewModel.modifiedUri && data.viewModel.originalUri && data.viewModel.modifiedUri.path !== data.viewModel.originalUri.path) {\n\t\t\t\tflag = 'R';\n\t\t\t\tisRenamed = true;\n\t\t\t} else if (!data.viewModel.modifiedUri) {\n\t\t\t\tflag = 'D';\n\t\t\t\tisDeleted = true;\n\t\t\t} else if (!data.viewModel.originalUri) {\n\t\t\t\tflag = 'A';\n\t\t\t\tisAdded = true;\n\t\t\t}\n\t\t\tthis._elements.status.classList.toggle('renamed', isRenamed);\n\t\t\tthis._elements.status.classList.toggle('deleted', isDeleted);\n\t\t\tthis._elements.status.classList.toggle('added', isAdded);\n\t\t\tthis._elements.status.innerText = flag;\n\n\t\t\tthis._resourceLabel2?.setUri(isRenamed ? data.viewModel.originalUri : undefined, { strikethrough: true });\n\n\t\t\tthis._dataStore.clear();\n\t\t\tthis._viewModel.set(data.viewModel, tx);\n\t\t\tthis.editor.setDiffModel(data.viewModel.diffEditorViewModelRef, tx);\n\t\t\tthis.editor.updateOptions(updateOptions(value.options ?? {}));\n\t\t});\n\t\tif (value.onOptionsDidChange) {\n\t\t\tthis._dataStore.add(value.onOptionsDidChange(() => {\n\t\t\t\tthis.editor.updateOptions(updateOptions(value.options ?? {}));\n\t\t\t}));\n\t\t}\n\t\tdata.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore, value => {\n\t\t\tif (!value) {\n\t\t\t\tthis.setData(undefined);\n\t\t\t}\n\t\t});\n\n\t\tif (data.viewModel.documentDiffItem.contextKeys) {\n\t\t\tfor (const [key, value] of Object.entries(data.viewModel.documentDiffItem.contextKeys)) {\n\t\t\t\tthis._contextKeyService.createKey(key, value);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate readonly _headerHeight;\n\n\tprivate _lastScrollTop;\n\tprivate _isSettingScrollTop;\n\n\tpublic render(verticalRange: OffsetRange, width: number, editorScroll: number, viewPort: OffsetRange): void {\n\t\tthis._elements.root.style.visibility = 'visible';\n\t\tthis._elements.root.style.top = `${verticalRange.start}px`;\n\t\tthis._elements.root.style.height = `${verticalRange.length}px`;\n\t\tthis._elements.root.style.width = `${width}px`;\n\t\tthis._elements.root.style.position = 'absolute';\n\n\t\t// For sticky scroll\n\t\tconst maxDelta = verticalRange.length - this._headerHeight;\n\t\tconst delta = Math.max(0, Math.min(viewPort.start - verticalRange.start, maxDelta));\n\t\tthis._elements.header.style.transform = `translateY(${delta}px)`;\n\n\t\tglobalTransaction(tx => {\n\t\t\tthis.editor.layout({\n\t\t\t\twidth: width - 2 * 8 - 2 * 1,\n\t\t\t\theight: verticalRange.length - this._outerEditorHeight,\n\t\t\t});\n\t\t});\n\t\ttry {\n\t\t\tthis._isSettingScrollTop = true;\n\t\t\tthis._lastScrollTop = editorScroll;\n\t\t\tthis.editor.getOriginalEditor().setScrollTop(editorScroll);\n\t\t} finally {\n\t\t\tthis._isSettingScrollTop = false;\n\t\t}\n\n\t\tthis._elements.header.classList.toggle('shadow', delta > 0 || editorScroll > 0);\n\t\tthis._elements.header.classList.toggle('collapsed', delta === maxDelta);\n\t}\n\n\tpublic hide(): void {\n\t\tthis._elements.root.style.top = `-100000px`;\n\t\tthis._elements.root.style.visibility = 'hidden'; // Some editor parts are still visible\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { h } from '../../../../base/browser/dom.js';\nimport { Button } from '../../../../base/browser/ui/button/button.js';\nimport { Codicon } from '../../../../base/common/codicons.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { autorun, derived, globalTransaction, observableValue } from '../../../../base/common/observable.js';\nimport { createActionViewItem } from '../../../../platform/actions/browser/menuEntryActionViewItem.js';\nimport { MenuWorkbenchToolBar } from '../../../../platform/actions/browser/toolbar.js';\nimport { MenuId } from '../../../../platform/actions/common/actions.js';\nimport { IContextKeyService, type IScopedContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js';\nimport { IDiffEditorOptions } from '../../../common/config/editorOptions.js';\nimport { OffsetRange } from '../../../common/core/ranges/offsetRange.js';\nimport { observableCodeEditor } from '../../observableCodeEditor.js';\nimport { DiffEditorWidget } from '../diffEditor/diffEditorWidget.js';\nimport { DocumentDiffItemViewModel } from './multiDiffEditorViewModel.js';\nimport { IObjectData, IPooledObject } from './objectPool.js';\nimport { ActionRunnerWithContext } from './utils.js';\nimport { IWorkbenchUIElementFactory } from './workbenchUIElementFactory.js';\n\nexport class TemplateData implements IObjectData {\n\tconstructor(\n\t\tpublic readonly viewModel: DocumentDiffItemViewModel,\n\t\tpublic readonly deltaScrollVertical: (delta: number) => void,\n\t) { }\n\n\n\tgetId(): unknown {\n\t\treturn this.viewModel;\n\t}\n}\n\nexport class DiffEditorItemTemplate extends Disposable implements IPooledObject<TemplateData> {\n\tprivate readonly _viewModel;\n\n\tprivate readonly _collapsed;\n\n\tprivate readonly _editorContentHeight;\n\tpublic readonly contentHeight;\n\n\tprivate readonly _modifiedContentWidth;\n\tprivate readonly _modifiedWidth;\n\tprivate readonly _originalContentWidth;\n\tprivate readonly _originalWidth;\n\n\tpublic readonly maxScroll;\n\n\tprivate readonly _elements;\n\n\tpublic readonly editor;\n\n\tprivate readonly isModifedFocused;\n\tprivate readonly isOriginalFocused;\n\tpublic readonly isFocused;\n\n\tprivate readonly _resourceLabel;\n\n\tprivate readonly _resourceLabel2;\n\n\tprivate readonly _outerEditorHeight: number;\n\tprivate readonly _contextKeyService: IScopedContextKeyService;\n\n\tconstructor(\n\t\tprivate readonly _container: HTMLElement,\n\t\tprivate readonly _overflowWidgetsDomNode: HTMLElement,\n\t\tprivate readonly _workbenchUIElementFactory: IWorkbenchUIElementFactory,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IContextKeyService _parentContextKeyService: IContextKeyService,\n\t) {\n\t\tsuper();\n\t\tthis._viewModel = observableValue<DocumentDiffItemViewModel | undefined>(this, undefined);\n\t\tthis._collapsed = derived(this, reader => this._viewModel.read(reader)?.collapsed.read(reader));\n\t\tthis._editorContentHeight = observableValue<number>(this, 500);\n\t\tthis.contentHeight = derived(this, reader => {\n\t\t\tconst h = this._collapsed.read(reader) ? 0 : this._editorContentHeight.read(reader);\n\t\t\treturn h + this._outerEditorHeight;\n\t\t});\n\t\tthis._modifiedContentWidth = observableValue<number>(this, 0);\n\t\tthis._modifiedWidth = observableValue<number>(this, 0);\n\t\tthis._originalContentWidth = observableValue<number>(this, 0);\n\t\tthis._originalWidth = observableValue<number>(this, 0);\n\t\tthis.maxScroll = derived(this, reader => {\n\t\t\tconst scroll1 = this._modifiedContentWidth.read(reader) - this._modifiedWidth.read(reader);\n\t\t\tconst scroll2 = this._originalContentWidth.read(reader) - this._originalWidth.read(reader);\n\t\t\tif (scroll1 > scroll2) {\n\t\t\t\treturn { maxScroll: scroll1, width: this._modifiedWidth.read(reader) };\n\t\t\t} else {\n\t\t\t\treturn { maxScroll: scroll2, width: this._originalWidth.read(reader) };\n\t\t\t}\n\t\t});\n\t\tthis._elements = h('div.multiDiffEntry', [\n\t\t\th('div.header@header', [\n\t\t\t\th('div.header-content', [\n\t\t\t\t\th('div.collapse-button@collapseButton'),\n\t\t\t\t\th('div.file-path', [\n\t\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\t\t\t\t\t\th('div.title.modified.show-file-icons@primaryPath', [] as any),\n\t\t\t\t\t\th('div.status.deleted@status', ['R']),\n\t\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\t\t\t\t\t\th('div.title.original.show-file-icons@secondaryPath', [] as any),\n\t\t\t\t\t]),\n\t\t\t\t\th('div.actions@actions'),\n\t\t\t\t]),\n\t\t\t]),\n\n\t\t\th('div.editorParent', [\n\t\t\t\th('div.editorContainer@editor'),\n\t\t\t])\n\t\t]) as Record<string, HTMLElement>;\n\t\tthis.editor = this._register(this._instantiationService.createInstance(DiffEditorWidget, this._elements.editor, {\n\t\t\toverflowWidgetsDomNode: this._overflowWidgetsDomNode,\n\t\t\tfixedOverflowWidgets: true\n\t\t}, {}));\n\t\tthis.isModifedFocused = observableCodeEditor(this.editor.getModifiedEditor()).isFocused;\n\t\tthis.isOriginalFocused = observableCodeEditor(this.editor.getOriginalEditor()).isFocused;\n\t\tthis.isFocused = derived(this, reader => this.isModifedFocused.read(reader) || this.isOriginalFocused.read(reader));\n\t\tthis._resourceLabel = this._workbenchUIElementFactory.createResourceLabel\n\t\t\t? this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath))\n\t\t\t: undefined;\n\t\tthis._resourceLabel2 = this._workbenchUIElementFactory.createResourceLabel\n\t\t\t? this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath))\n\t\t\t: undefined;\n\t\tthis._dataStore = this._register(new DisposableStore());\n\t\tthis._headerHeight = 40;\n\t\tthis._lastScrollTop = -1;\n\t\tthis._isSettingScrollTop = false;\n\n\t\tconst btn = new Button(this._elements.collapseButton, {});\n\n\t\tthis._register(autorun(reader => {\n\t\t\tbtn.element.className = '';\n\t\t\tbtn.icon = this._collapsed.read(reader) ? Codicon.chevronRight : Codicon.chevronDown;\n\t\t}));\n\t\tthis._register(btn.onDidClick(() => {\n\t\t\tthis._viewModel.get()?.collapsed.set(!this._collapsed.get(), undefined);\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tthis._elements.editor.style.display = this._collapsed.read(reader) ? 'none' : 'block';\n\t\t}));\n\n\t\tthis._register(this.editor.getModifiedEditor().onDidLayoutChange(e => {\n\t\t\tconst width = this.editor.getModifiedEditor().getLayoutInfo().contentWidth;\n\t\t\tthis._modifiedWidth.set(width, undefined);\n\t\t}));\n\n\t\tthis._register(this.editor.getOriginalEditor().onDidLayoutChange(e => {\n\t\t\tconst width = this.editor.getOriginalEditor().getLayoutInfo().contentWidth;\n\t\t\tthis._originalWidth.set(width, undefined);\n\t\t}));\n\n\t\tthis._register(this.editor.onDidContentSizeChange(e => {\n\t\t\tglobalTransaction(tx => {\n\t\t\t\tthis._editorContentHeight.set(e.contentHeight, tx);\n\t\t\t\tthis._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(), tx);\n\t\t\t\tthis._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(), tx);\n\t\t\t});\n\t\t}));\n\n\t\tthis._register(this.editor.getOriginalEditor().onDidScrollChange(e => {\n\t\t\tif (this._isSettingScrollTop) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!e.scrollTopChanged || !this._data) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst delta = e.scrollTop - this._lastScrollTop;\n\t\t\tthis._data.deltaScrollVertical(delta);\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst isActive = this._viewModel.read(reader)?.isActive.read(reader);\n\t\t\tthis._elements.root.classList.toggle('active', isActive);\n\t\t}));\n\n\t\tthis._container.appendChild(this._elements.root);\n\t\tthis._outerEditorHeight = this._headerHeight;\n\n\t\tthis._contextKeyService = this._register(_parentContextKeyService.createScoped(this._elements.actions));\n\t\tconst instantiationService = this._register(this._instantiationService.createChild(new ServiceCollection([IContextKeyService, this._contextKeyService])));\n\t\tthis._register(instantiationService.createInstance(MenuWorkbenchToolBar, this._elements.actions, MenuId.MultiDiffEditorFileToolbar, {\n\t\t\tactionRunner: this._register(new ActionRunnerWithContext(() => (this._viewModel.get()?.modifiedUri))),\n\t\t\tmenuOptions: {\n\t\t\t\tshouldForwardArgs: true,\n\t\t\t},\n\t\t\ttoolbarOptions: { primaryGroup: g => g.startsWith('navigation') },\n\t\t\tactionViewItemProvider: (action, options) => createActionViewItem(instantiationService, action, options),\n\t\t}));\n\t}\n\n\tpublic setScrollLeft(left: number): void {\n\t\tif (this._modifiedContentWidth.get() - this._modifiedWidth.get() > this._originalContentWidth.get() - this._originalWidth.get()) {\n\t\t\tthis.editor.getModifiedEditor().setScrollLeft(left);\n\t\t} else {\n\t\t\tthis.editor.getOriginalEditor().setScrollLeft(left);\n\t\t}\n\t}\n\n\tprivate readonly _dataStore;\n\n\tprivate _data: TemplateData | undefined;\n\n\tpublic setData(data: TemplateData | undefined): void {\n\t\tthis._data = data;\n\t\tfunction updateOptions(options: IDiffEditorOptions): IDiffEditorOptions {\n\t\t\treturn {\n\t\t\t\t...options,\n\t\t\t\tscrollBeyondLastLine: false,\n\t\t\t\thideUnchangedRegions: {\n\t\t\t\t\tenabled: true,\n\t\t\t\t},\n\t\t\t\tscrollbar: {\n\t\t\t\t\tvertical: 'hidden',\n\t\t\t\t\thorizontal: 'hidden',\n\t\t\t\t\thandleMouseWheel: false,\n\t\t\t\t\tuseShadows: false,\n\t\t\t\t},\n\t\t\t\trenderOverviewRuler: false,\n\t\t\t\tfixedOverflowWidgets: true,\n\t\t\t\toverviewRulerBorder: false,\n\t\t\t};\n\t\t}\n\n\t\tif (!data) {\n\t\t\tglobalTransaction(tx => {\n\t\t\t\tthis._viewModel.set(undefined, tx);\n\t\t\t\tthis.editor.setDiffModel(null, tx);\n\t\t\t\tthis._dataStore.clear();\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tconst value = data.viewModel.documentDiffItem;\n\n\t\tglobalTransaction(tx => {\n\t\t\tthis._resourceLabel?.setUri(data.viewModel.modifiedUri ?? data.viewModel.originalUri!, { strikethrough: data.viewModel.modifiedUri === undefined });\n\n\t\t\tlet isRenamed = false;\n\t\t\tlet isDeleted = false;\n\t\t\tlet isAdded = false;\n\t\t\tlet flag = '';\n\t\t\tif (data.viewModel.modifiedUri && data.viewModel.originalUri && data.viewModel.modifiedUri.path !== data.viewModel.originalUri.path) {\n\t\t\t\tflag = 'R';\n\t\t\t\tisRenamed = true;\n\t\t\t} else if (!data.viewModel.modifiedUri) {\n\t\t\t\tflag = 'D';\n\t\t\t\tisDeleted = true;\n\t\t\t} else if (!data.viewModel.originalUri) {\n\t\t\t\tflag = 'A';\n\t\t\t\tisAdded = true;\n\t\t\t}\n\t\t\tthis._elements.status.classList.toggle('renamed', isRenamed);\n\t\t\tthis._elements.status.classList.toggle('deleted', isDeleted);\n\t\t\tthis._elements.status.classList.toggle('added', isAdded);\n\t\t\tthis._elements.status.innerText = flag;\n\n\t\t\tthis._resourceLabel2?.setUri(isRenamed ? data.viewModel.originalUri : undefined, { strikethrough: true });\n\n\t\t\tthis._dataStore.clear();\n\t\t\tthis._viewModel.set(data.viewModel, tx);\n\t\t\tthis.editor.setDiffModel(data.viewModel.diffEditorViewModelRef, tx);\n\t\t\tthis.editor.updateOptions(updateOptions(value.options ?? {}));\n\t\t});\n\t\tif (value.onOptionsDidChange) {\n\t\t\tthis._dataStore.add(value.onOptionsDidChange(() => {\n\t\t\t\tthis.editor.updateOptions(updateOptions(value.options ?? {}));\n\t\t\t}));\n\t\t}\n\t\tdata.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore, value => {\n\t\t\tif (!value) {\n\t\t\t\tthis.setData(undefined);\n\t\t\t}\n\t\t});\n\n\t\tif (data.viewModel.documentDiffItem.contextKeys) {\n\t\t\tfor (const [key, value] of Object.entries(data.viewModel.documentDiffItem.contextKeys)) {\n\t\t\t\tthis._contextKeyService.createKey(key, value);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate readonly _headerHeight;\n\n\tprivate _lastScrollTop;\n\tprivate _isSettingScrollTop;\n\n\tpublic render(verticalRange: OffsetRange, width: number, editorScroll: number, viewPort: OffsetRange): void {\n\t\tthis._elements.root.style.visibility = 'visible';\n\t\tthis._elements.root.style.top = `${verticalRange.start}px`;\n\t\tthis._elements.root.style.height = `${verticalRange.length}px`;\n\t\tthis._elements.root.style.width = `${width}px`;\n\t\tthis._elements.root.style.position = 'absolute';\n\n\t\t// For sticky scroll\n\t\tconst maxDelta = verticalRange.length - this._headerHeight;\n\t\tconst delta = Math.max(0, Math.min(viewPort.start - verticalRange.start, maxDelta));\n\t\tthis._elements.header.style.transform = `translateY(${delta}px)`;\n\n\t\tglobalTransaction(tx => {\n\t\t\tthis.editor.layout({\n\t\t\t\twidth: width - 2 * 8 - 2 * 1,\n\t\t\t\theight: verticalRange.length - this._outerEditorHeight,\n\t\t\t});\n\t\t});\n\t\ttry {\n\t\t\tthis._isSettingScrollTop = true;\n\t\t\tthis._lastScrollTop = editorScroll;\n\t\t\tthis.editor.getOriginalEditor().setScrollTop(editorScroll);\n\t\t} finally {\n\t\t\tthis._isSettingScrollTop = false;\n\t\t}\n\n\t\tthis._elements.header.classList.toggle('shadow', delta > 0 || editorScroll > 0);\n\t\tthis._elements.header.classList.toggle('collapsed', delta === maxDelta);\n\t}\n\n\tpublic hide(): void {\n\t\tthis._elements.root.style.top = `-100000px`;\n\t\tthis._elements.root.style.visibility = 'hidden'; // Some editor parts are still visible\n\t}\n}\n"]}
|
|
@@ -26,6 +26,7 @@ let GlyphHoverWidget = class GlyphHoverWidget extends Disposable {
|
|
|
26
26
|
constructor(editor, _markdownRendererService) {
|
|
27
27
|
super();
|
|
28
28
|
this._markdownRendererService = _markdownRendererService;
|
|
29
|
+
this.allowEditorOverflow = true;
|
|
29
30
|
this._renderDisposeables = this._register(new DisposableStore());
|
|
30
31
|
this._editor = editor;
|
|
31
32
|
this._isVisible = false;
|
|
@@ -143,8 +144,27 @@ let GlyphHoverWidget = class GlyphHoverWidget extends Disposable {
|
|
|
143
144
|
const nodeHeight = this._hover.containerDomNode.clientHeight;
|
|
144
145
|
const top = topForLineNumber - editorScrollTop - ((nodeHeight - lineHeight) / 2);
|
|
145
146
|
const left = editorLayout.glyphMarginLeft + editorLayout.glyphMarginWidth + (laneOrLine === 'lineNo' ? editorLayout.lineNumbersWidth : 0);
|
|
146
|
-
|
|
147
|
-
|
|
147
|
+
// Constrain the hover widget to stay within the editor bounds
|
|
148
|
+
const editorHeight = editorLayout.height;
|
|
149
|
+
const maxTop = editorHeight - nodeHeight;
|
|
150
|
+
const constrainedTop = Math.max(0, Math.min(Math.round(top), maxTop));
|
|
151
|
+
const fixedOverflowWidgets = this._editor.getOption(51 /* EditorOption.fixedOverflowWidgets */);
|
|
152
|
+
if (fixedOverflowWidgets) {
|
|
153
|
+
// Use fixed positioning relative to the viewport
|
|
154
|
+
const editorDomNode = this._editor.getDomNode();
|
|
155
|
+
if (editorDomNode) {
|
|
156
|
+
const editorRect = dom.getDomNodePagePosition(editorDomNode);
|
|
157
|
+
this._hover.containerDomNode.style.position = 'fixed';
|
|
158
|
+
this._hover.containerDomNode.style.left = `${editorRect.left + left}px`;
|
|
159
|
+
this._hover.containerDomNode.style.top = `${editorRect.top + constrainedTop}px`;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
// Use absolute positioning relative to the editor
|
|
164
|
+
this._hover.containerDomNode.style.position = 'absolute';
|
|
165
|
+
this._hover.containerDomNode.style.left = `${left}px`;
|
|
166
|
+
this._hover.containerDomNode.style.top = `${constrainedTop}px`;
|
|
167
|
+
}
|
|
148
168
|
this._hover.containerDomNode.style.zIndex = '11'; // 1 more than the zone widget at 10 (#233819)
|
|
149
169
|
}
|
|
150
170
|
_onMouseLeave(e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/hover/browser/glyphHoverWidget.ts","vs/editor/contrib/hover/browser/glyphHoverWidget.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,KAAK,GAAG,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,2DAA2D,CAAC;AAGrG,OAAO,EAAE,cAAc,EAA+B,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AAE/E,OAAO,EAAmC,kBAAkB,EAA6B,MAAM,yBAAyB,CAAC;AACzH,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAE/D,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;AAET,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SA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,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC;QAC7E,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,8CAA8C;IACjG,CAAC;IAEO,aAAa,CAAC,CAAa;QAClC,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QAChD,MAAM,8BAA8B,GAAG,CAAC,aAAa,IAAI,CAAC,4BAA4B,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAChH,IAAI,8BAA8B,EAAE,CAAC;YACpC,IAAI,CAAC,IAAI,EAAE,CAAC;QACb,CAAC;IACF,CAAC;;AAxKW,gBAAgB;IAiB1B,WAAA,wBAAwB,CAAA;GAjBd,gBAAgB,CAyK5B","file":"glyphHoverWidget.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 * as dom from '../../../../base/browser/dom.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { IMarkdownRendererService } from '../../../../platform/markdown/browser/markdownRenderer.js';\nimport { ICodeEditor, IEditorMouseEvent, IOverlayWidget, IOverlayWidgetPosition, MouseTargetType } from '../../../browser/editorBrowser.js';\nimport { ConfigurationChangedEvent, EditorOption } from '../../../common/config/editorOptions.js';\nimport { HoverOperation, HoverResult, HoverStartMode } from './hoverOperation.js';\nimport { HoverWidget } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverWidget } from './hoverTypes.js';\nimport { IHoverMessage, LaneOrLineNumber, GlyphHoverComputer, GlyphHoverComputerOptions } from './glyphHoverComputer.js';\nimport { isMousePositionWithinElement } from './hoverUtils.js';\n\nconst $ = dom.$;\n\nexport class GlyphHoverWidget extends Disposable implements IOverlayWidget, IHoverWidget {\n\n\tpublic static readonly ID = 'editor.contrib.modesGlyphHoverWidget';\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _hover: HoverWidget;\n\n\tprivate _isVisible: boolean;\n\tprivate _messages: IHoverMessage[];\n\n\tprivate readonly _hoverOperation: HoverOperation<GlyphHoverComputerOptions, IHoverMessage>;\n\tprivate readonly _renderDisposeables = this._register(new DisposableStore());\n\n\tprivate _hoverComputerOptions: GlyphHoverComputerOptions | undefined;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IMarkdownRendererService private readonly _markdownRendererService: IMarkdownRendererService,\n\t) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\n\t\tthis._isVisible = false;\n\t\tthis._messages = [];\n\n\t\tthis._hover = this._register(new HoverWidget(true));\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\n\t\tthis._hoverOperation = this._register(new HoverOperation(this._editor, new GlyphHoverComputer(this._editor)));\n\t\tthis._register(this._hoverOperation.onResult((result) => this._withResult(result)));\n\n\t\tthis._register(this._editor.onDidChangeModelDecorations(() => this._onModelDecorationsChanged()));\n\t\tthis._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {\n\t\t\tif (e.hasChanged(EditorOption.fontInfo)) {\n\t\t\t\tthis._updateFont();\n\t\t\t}\n\t\t}));\n\t\tthis._register(dom.addStandardDisposableListener(this._hover.containerDomNode, 'mouseleave', (e) => {\n\t\t\tthis._onMouseLeave(e);\n\t\t}));\n\t\tthis._editor.addOverlayWidget(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._hoverComputerOptions = undefined;\n\t\tthis._editor.removeOverlayWidget(this);\n\t\tsuper.dispose();\n\t}\n\n\tpublic getId(): string {\n\t\treturn GlyphHoverWidget.ID;\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._hover.containerDomNode;\n\t}\n\n\tpublic getPosition(): IOverlayWidgetPosition | null {\n\t\treturn null;\n\t}\n\n\tprivate _updateFont(): void {\n\t\tconst codeClasses: HTMLElement[] = Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName('code'));\n\t\tcodeClasses.forEach(node => this._editor.applyFontInfo(node));\n\t}\n\n\tprivate _onModelDecorationsChanged(): void {\n\t\tif (this._isVisible && this._hoverComputerOptions) {\n\t\t\t// The decorations have changed and the hover is visible,\n\t\t\t// we need to recompute the displayed text\n\t\t\tthis._hoverOperation.cancel();\n\t\t\tthis._hoverOperation.start(HoverStartMode.Delayed, this._hoverComputerOptions);\n\t\t}\n\t}\n\n\tpublic showsOrWillShow(mouseEvent: IEditorMouseEvent): boolean {\n\t\tconst target = mouseEvent.target;\n\t\tif (target.type === MouseTargetType.GUTTER_GLYPH_MARGIN && target.detail.glyphMarginLane) {\n\t\t\tthis._startShowingAt(target.position.lineNumber, target.detail.glyphMarginLane);\n\t\t\treturn true;\n\t\t}\n\t\tif (target.type === MouseTargetType.GUTTER_LINE_NUMBERS) {\n\t\t\tthis._startShowingAt(target.position.lineNumber, 'lineNo');\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _startShowingAt(lineNumber: number, laneOrLine: LaneOrLineNumber): void {\n\t\tif (this._hoverComputerOptions\n\t\t\t&& this._hoverComputerOptions.lineNumber === lineNumber\n\t\t\t&& this._hoverComputerOptions.laneOrLine === laneOrLine) {\n\t\t\t// We have to show the widget at the exact same line number as before, so no work is needed\n\t\t\treturn;\n\t\t}\n\t\tthis._hoverOperation.cancel();\n\t\tthis.hide();\n\t\tthis._hoverComputerOptions = { lineNumber, laneOrLine };\n\t\tthis._hoverOperation.start(HoverStartMode.Delayed, this._hoverComputerOptions);\n\t}\n\n\tpublic hide(): void {\n\t\tthis._hoverComputerOptions = undefined;\n\t\tthis._hoverOperation.cancel();\n\t\tif (!this._isVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isVisible = false;\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\t}\n\n\tprivate _withResult(result: HoverResult<GlyphHoverComputerOptions, IHoverMessage>): void {\n\t\tthis._messages = result.value;\n\n\t\tif (this._messages.length > 0) {\n\t\t\tthis._renderMessages(result.options.lineNumber, result.options.laneOrLine, this._messages);\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}\n\n\tprivate _renderMessages(lineNumber: number, laneOrLine: LaneOrLineNumber, messages: IHoverMessage[]): void {\n\t\tthis._renderDisposeables.clear();\n\n\t\tconst fragment = document.createDocumentFragment();\n\n\t\tfor (const msg of messages) {\n\t\t\tconst markdownHoverElement = $('div.hover-row.markdown-hover');\n\t\t\tconst hoverContentsElement = dom.append(markdownHoverElement, $('div.hover-contents'));\n\t\t\tconst renderedContents = this._renderDisposeables.add(this._markdownRendererService.render(msg.value, { context: this._editor }));\n\t\t\thoverContentsElement.appendChild(renderedContents.element);\n\t\t\tfragment.appendChild(markdownHoverElement);\n\t\t}\n\n\t\tthis._updateContents(fragment);\n\t\tthis._showAt(lineNumber, laneOrLine);\n\t}\n\n\tprivate _updateContents(node: Node): void {\n\t\tthis._hover.contentsDomNode.textContent = '';\n\t\tthis._hover.contentsDomNode.appendChild(node);\n\t\tthis._updateFont();\n\t}\n\n\tprivate _showAt(lineNumber: number, laneOrLine: LaneOrLineNumber): void {\n\t\tif (!this._isVisible) {\n\t\t\tthis._isVisible = true;\n\t\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\t\t}\n\n\t\tconst editorLayout = this._editor.getLayoutInfo();\n\t\tconst topForLineNumber = this._editor.getTopForLineNumber(lineNumber);\n\t\tconst editorScrollTop = this._editor.getScrollTop();\n\t\tconst lineHeight = this._editor.getOption(EditorOption.lineHeight);\n\t\tconst nodeHeight = this._hover.containerDomNode.clientHeight;\n\t\tconst top = topForLineNumber - editorScrollTop - ((nodeHeight - lineHeight) / 2);\n\t\tconst left = editorLayout.glyphMarginLeft + editorLayout.glyphMarginWidth + (laneOrLine === 'lineNo' ? editorLayout.lineNumbersWidth : 0);\n\t\tthis._hover.containerDomNode.style.left = `${left}px`;\n\t\tthis._hover.containerDomNode.style.top = `${Math.max(Math.round(top), 0)}px`;\n\t\tthis._hover.containerDomNode.style.zIndex = '11'; // 1 more than the zone widget at 10 (#233819)\n\t}\n\n\tprivate _onMouseLeave(e: MouseEvent): void {\n\t\tconst editorDomNode = this._editor.getDomNode();\n\t\tconst isMousePositionOutsideOfEditor = !editorDomNode || !isMousePositionWithinElement(editorDomNode, e.x, e.y);\n\t\tif (isMousePositionOutsideOfEditor) {\n\t\t\tthis.hide();\n\t\t}\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as dom from '../../../../base/browser/dom.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { IMarkdownRendererService } from '../../../../platform/markdown/browser/markdownRenderer.js';\nimport { ICodeEditor, IEditorMouseEvent, IOverlayWidget, IOverlayWidgetPosition, MouseTargetType } from '../../../browser/editorBrowser.js';\nimport { ConfigurationChangedEvent, EditorOption } from '../../../common/config/editorOptions.js';\nimport { HoverOperation, HoverResult, HoverStartMode } from './hoverOperation.js';\nimport { HoverWidget } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverWidget } from './hoverTypes.js';\nimport { IHoverMessage, LaneOrLineNumber, GlyphHoverComputer, GlyphHoverComputerOptions } from './glyphHoverComputer.js';\nimport { isMousePositionWithinElement } from './hoverUtils.js';\n\nconst $ = dom.$;\n\nexport class GlyphHoverWidget extends Disposable implements IOverlayWidget, IHoverWidget {\n\n\tpublic static readonly ID = 'editor.contrib.modesGlyphHoverWidget';\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _hover: HoverWidget;\n\n\tprivate _isVisible: boolean;\n\tprivate _messages: IHoverMessage[];\n\n\tprivate readonly _hoverOperation: HoverOperation<GlyphHoverComputerOptions, IHoverMessage>;\n\tprivate readonly _renderDisposeables = this._register(new DisposableStore());\n\n\tprivate _hoverComputerOptions: GlyphHoverComputerOptions | undefined;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IMarkdownRendererService private readonly _markdownRendererService: IMarkdownRendererService,\n\t) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\n\t\tthis._isVisible = false;\n\t\tthis._messages = [];\n\n\t\tthis._hover = this._register(new HoverWidget(true));\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\n\t\tthis._hoverOperation = this._register(new HoverOperation(this._editor, new GlyphHoverComputer(this._editor)));\n\t\tthis._register(this._hoverOperation.onResult((result) => this._withResult(result)));\n\n\t\tthis._register(this._editor.onDidChangeModelDecorations(() => this._onModelDecorationsChanged()));\n\t\tthis._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {\n\t\t\tif (e.hasChanged(EditorOption.fontInfo)) {\n\t\t\t\tthis._updateFont();\n\t\t\t}\n\t\t}));\n\t\tthis._register(dom.addStandardDisposableListener(this._hover.containerDomNode, 'mouseleave', (e) => {\n\t\t\tthis._onMouseLeave(e);\n\t\t}));\n\t\tthis._editor.addOverlayWidget(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._hoverComputerOptions = undefined;\n\t\tthis._editor.removeOverlayWidget(this);\n\t\tsuper.dispose();\n\t}\n\n\tpublic getId(): string {\n\t\treturn GlyphHoverWidget.ID;\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._hover.containerDomNode;\n\t}\n\n\tpublic getPosition(): IOverlayWidgetPosition | null {\n\t\treturn null;\n\t}\n\n\tprivate _updateFont(): void {\n\t\tconst codeClasses: HTMLElement[] = Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName('code'));\n\t\tcodeClasses.forEach(node => this._editor.applyFontInfo(node));\n\t}\n\n\tprivate _onModelDecorationsChanged(): void {\n\t\tif (this._isVisible && this._hoverComputerOptions) {\n\t\t\t// The decorations have changed and the hover is visible,\n\t\t\t// we need to recompute the displayed text\n\t\t\tthis._hoverOperation.cancel();\n\t\t\tthis._hoverOperation.start(HoverStartMode.Delayed, this._hoverComputerOptions);\n\t\t}\n\t}\n\n\tpublic showsOrWillShow(mouseEvent: IEditorMouseEvent): boolean {\n\t\tconst target = mouseEvent.target;\n\t\tif (target.type === MouseTargetType.GUTTER_GLYPH_MARGIN && target.detail.glyphMarginLane) {\n\t\t\tthis._startShowingAt(target.position.lineNumber, target.detail.glyphMarginLane);\n\t\t\treturn true;\n\t\t}\n\t\tif (target.type === MouseTargetType.GUTTER_LINE_NUMBERS) {\n\t\t\tthis._startShowingAt(target.position.lineNumber, 'lineNo');\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _startShowingAt(lineNumber: number, laneOrLine: LaneOrLineNumber): void {\n\t\tif (this._hoverComputerOptions\n\t\t\t&& this._hoverComputerOptions.lineNumber === lineNumber\n\t\t\t&& this._hoverComputerOptions.laneOrLine === laneOrLine) {\n\t\t\t// We have to show the widget at the exact same line number as before, so no work is needed\n\t\t\treturn;\n\t\t}\n\t\tthis._hoverOperation.cancel();\n\t\tthis.hide();\n\t\tthis._hoverComputerOptions = { lineNumber, laneOrLine };\n\t\tthis._hoverOperation.start(HoverStartMode.Delayed, this._hoverComputerOptions);\n\t}\n\n\tpublic hide(): void {\n\t\tthis._hoverComputerOptions = undefined;\n\t\tthis._hoverOperation.cancel();\n\t\tif (!this._isVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isVisible = false;\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\t}\n\n\tprivate _withResult(result: HoverResult<GlyphHoverComputerOptions, IHoverMessage>): void {\n\t\tthis._messages = result.value;\n\n\t\tif (this._messages.length > 0) {\n\t\t\tthis._renderMessages(result.options.lineNumber, result.options.laneOrLine, this._messages);\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}\n\n\tprivate _renderMessages(lineNumber: number, laneOrLine: LaneOrLineNumber, messages: IHoverMessage[]): void {\n\t\tthis._renderDisposeables.clear();\n\n\t\tconst fragment = document.createDocumentFragment();\n\n\t\tfor (const msg of messages) {\n\t\t\tconst markdownHoverElement = $('div.hover-row.markdown-hover');\n\t\t\tconst hoverContentsElement = dom.append(markdownHoverElement, $('div.hover-contents'));\n\t\t\tconst renderedContents = this._renderDisposeables.add(this._markdownRendererService.render(msg.value, { context: this._editor }));\n\t\t\thoverContentsElement.appendChild(renderedContents.element);\n\t\t\tfragment.appendChild(markdownHoverElement);\n\t\t}\n\n\t\tthis._updateContents(fragment);\n\t\tthis._showAt(lineNumber, laneOrLine);\n\t}\n\n\tprivate _updateContents(node: Node): void {\n\t\tthis._hover.contentsDomNode.textContent = '';\n\t\tthis._hover.contentsDomNode.appendChild(node);\n\t\tthis._updateFont();\n\t}\n\n\tprivate _showAt(lineNumber: number, laneOrLine: LaneOrLineNumber): void {\n\t\tif (!this._isVisible) {\n\t\t\tthis._isVisible = true;\n\t\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\t\t}\n\n\t\tconst editorLayout = this._editor.getLayoutInfo();\n\t\tconst topForLineNumber = this._editor.getTopForLineNumber(lineNumber);\n\t\tconst editorScrollTop = this._editor.getScrollTop();\n\t\tconst lineHeight = this._editor.getOption(EditorOption.lineHeight);\n\t\tconst nodeHeight = this._hover.containerDomNode.clientHeight;\n\t\tconst top = topForLineNumber - editorScrollTop - ((nodeHeight - lineHeight) / 2);\n\t\tconst left = editorLayout.glyphMarginLeft + editorLayout.glyphMarginWidth + (laneOrLine === 'lineNo' ? editorLayout.lineNumbersWidth : 0);\n\t\tthis._hover.containerDomNode.style.left = `${left}px`;\n\t\tthis._hover.containerDomNode.style.top = `${Math.max(Math.round(top), 0)}px`;\n\t\tthis._hover.containerDomNode.style.zIndex = '11'; // 1 more than the zone widget at 10 (#233819)\n\t}\n\n\tprivate _onMouseLeave(e: MouseEvent): void {\n\t\tconst editorDomNode = this._editor.getDomNode();\n\t\tconst isMousePositionOutsideOfEditor = !editorDomNode || !isMousePositionWithinElement(editorDomNode, e.x, e.y);\n\t\tif (isMousePositionOutsideOfEditor) {\n\t\t\tthis.hide();\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/hover/browser/glyphHoverWidget.ts","vs/editor/contrib/hover/browser/glyphHoverWidget.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,KAAK,GAAG,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,2DAA2D,CAAC;AAGrG,OAAO,EAAE,cAAc,EAA+B,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AAE/E,OAAO,EAAmC,kBAAkB,EAA6B,MAAM,yBAAyB,CAAC;AACzH,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAE/D,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;AAET,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;;aAExB,OAAE,GAAG,sCAAH,AAAyC,CAAC;IAcnE,YACC,MAAmB,EACO,wBAAmE;QAE7F,KAAK,EAAE,CAAC;QAFmC,6BAAwB,GAAxB,wBAAwB,CAA0B;QAf9E,wBAAmB,GAAG,IAAI,CAAC;QAS1B,wBAAmB,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,eAAe,EAAE,CAAC,CAAC;QAS5E,IAAI,CAAC,OAAO,GAAG,MAA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ACF,CAAC;;AA7LW,gBAAgB;IAkB1B,WAAA,wBAAwB,CAAA;GAlBd,gBAAgB,CA8L5B","file":"glyphHoverWidget.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 * as dom from '../../../../base/browser/dom.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { IMarkdownRendererService } from '../../../../platform/markdown/browser/markdownRenderer.js';\nimport { ICodeEditor, IEditorMouseEvent, IOverlayWidget, IOverlayWidgetPosition, MouseTargetType } from '../../../browser/editorBrowser.js';\nimport { ConfigurationChangedEvent, EditorOption } from '../../../common/config/editorOptions.js';\nimport { HoverOperation, HoverResult, HoverStartMode } from './hoverOperation.js';\nimport { HoverWidget } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverWidget } from './hoverTypes.js';\nimport { IHoverMessage, LaneOrLineNumber, GlyphHoverComputer, GlyphHoverComputerOptions } from './glyphHoverComputer.js';\nimport { isMousePositionWithinElement } from './hoverUtils.js';\n\nconst $ = dom.$;\n\nexport class GlyphHoverWidget extends Disposable implements IOverlayWidget, IHoverWidget {\n\n\tpublic static readonly ID = 'editor.contrib.modesGlyphHoverWidget';\n\tpublic readonly allowEditorOverflow = true;\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _hover: HoverWidget;\n\n\tprivate _isVisible: boolean;\n\tprivate _messages: IHoverMessage[];\n\n\tprivate readonly _hoverOperation: HoverOperation<GlyphHoverComputerOptions, IHoverMessage>;\n\tprivate readonly _renderDisposeables = this._register(new DisposableStore());\n\n\tprivate _hoverComputerOptions: GlyphHoverComputerOptions | undefined;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IMarkdownRendererService private readonly _markdownRendererService: IMarkdownRendererService,\n\t) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\n\t\tthis._isVisible = false;\n\t\tthis._messages = [];\n\n\t\tthis._hover = this._register(new HoverWidget(true));\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\n\t\tthis._hoverOperation = this._register(new HoverOperation(this._editor, new GlyphHoverComputer(this._editor)));\n\t\tthis._register(this._hoverOperation.onResult((result) => this._withResult(result)));\n\n\t\tthis._register(this._editor.onDidChangeModelDecorations(() => this._onModelDecorationsChanged()));\n\t\tthis._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {\n\t\t\tif (e.hasChanged(EditorOption.fontInfo)) {\n\t\t\t\tthis._updateFont();\n\t\t\t}\n\t\t}));\n\t\tthis._register(dom.addStandardDisposableListener(this._hover.containerDomNode, 'mouseleave', (e) => {\n\t\t\tthis._onMouseLeave(e);\n\t\t}));\n\t\tthis._editor.addOverlayWidget(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._hoverComputerOptions = undefined;\n\t\tthis._editor.removeOverlayWidget(this);\n\t\tsuper.dispose();\n\t}\n\n\tpublic getId(): string {\n\t\treturn GlyphHoverWidget.ID;\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._hover.containerDomNode;\n\t}\n\n\tpublic getPosition(): IOverlayWidgetPosition | null {\n\t\treturn null;\n\t}\n\n\tprivate _updateFont(): void {\n\t\tconst codeClasses: HTMLElement[] = Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName('code'));\n\t\tcodeClasses.forEach(node => this._editor.applyFontInfo(node));\n\t}\n\n\tprivate _onModelDecorationsChanged(): void {\n\t\tif (this._isVisible && this._hoverComputerOptions) {\n\t\t\t// The decorations have changed and the hover is visible,\n\t\t\t// we need to recompute the displayed text\n\t\t\tthis._hoverOperation.cancel();\n\t\t\tthis._hoverOperation.start(HoverStartMode.Delayed, this._hoverComputerOptions);\n\t\t}\n\t}\n\n\tpublic showsOrWillShow(mouseEvent: IEditorMouseEvent): boolean {\n\t\tconst target = mouseEvent.target;\n\t\tif (target.type === MouseTargetType.GUTTER_GLYPH_MARGIN && target.detail.glyphMarginLane) {\n\t\t\tthis._startShowingAt(target.position.lineNumber, target.detail.glyphMarginLane);\n\t\t\treturn true;\n\t\t}\n\t\tif (target.type === MouseTargetType.GUTTER_LINE_NUMBERS) {\n\t\t\tthis._startShowingAt(target.position.lineNumber, 'lineNo');\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _startShowingAt(lineNumber: number, laneOrLine: LaneOrLineNumber): void {\n\t\tif (this._hoverComputerOptions\n\t\t\t&& this._hoverComputerOptions.lineNumber === lineNumber\n\t\t\t&& this._hoverComputerOptions.laneOrLine === laneOrLine) {\n\t\t\t// We have to show the widget at the exact same line number as before, so no work is needed\n\t\t\treturn;\n\t\t}\n\t\tthis._hoverOperation.cancel();\n\t\tthis.hide();\n\t\tthis._hoverComputerOptions = { lineNumber, laneOrLine };\n\t\tthis._hoverOperation.start(HoverStartMode.Delayed, this._hoverComputerOptions);\n\t}\n\n\tpublic hide(): void {\n\t\tthis._hoverComputerOptions = undefined;\n\t\tthis._hoverOperation.cancel();\n\t\tif (!this._isVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isVisible = false;\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\t}\n\n\tprivate _withResult(result: HoverResult<GlyphHoverComputerOptions, IHoverMessage>): void {\n\t\tthis._messages = result.value;\n\n\t\tif (this._messages.length > 0) {\n\t\t\tthis._renderMessages(result.options.lineNumber, result.options.laneOrLine, this._messages);\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}\n\n\tprivate _renderMessages(lineNumber: number, laneOrLine: LaneOrLineNumber, messages: IHoverMessage[]): void {\n\t\tthis._renderDisposeables.clear();\n\n\t\tconst fragment = document.createDocumentFragment();\n\n\t\tfor (const msg of messages) {\n\t\t\tconst markdownHoverElement = $('div.hover-row.markdown-hover');\n\t\t\tconst hoverContentsElement = dom.append(markdownHoverElement, $('div.hover-contents'));\n\t\t\tconst renderedContents = this._renderDisposeables.add(this._markdownRendererService.render(msg.value, { context: this._editor }));\n\t\t\thoverContentsElement.appendChild(renderedContents.element);\n\t\t\tfragment.appendChild(markdownHoverElement);\n\t\t}\n\n\t\tthis._updateContents(fragment);\n\t\tthis._showAt(lineNumber, laneOrLine);\n\t}\n\n\tprivate _updateContents(node: Node): void {\n\t\tthis._hover.contentsDomNode.textContent = '';\n\t\tthis._hover.contentsDomNode.appendChild(node);\n\t\tthis._updateFont();\n\t}\n\n\tprivate _showAt(lineNumber: number, laneOrLine: LaneOrLineNumber): void {\n\t\tif (!this._isVisible) {\n\t\t\tthis._isVisible = true;\n\t\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\t\t}\n\n\t\tconst editorLayout = this._editor.getLayoutInfo();\n\t\tconst topForLineNumber = this._editor.getTopForLineNumber(lineNumber);\n\t\tconst editorScrollTop = this._editor.getScrollTop();\n\t\tconst lineHeight = this._editor.getOption(EditorOption.lineHeight);\n\t\tconst nodeHeight = this._hover.containerDomNode.clientHeight;\n\t\tconst top = topForLineNumber - editorScrollTop - ((nodeHeight - lineHeight) / 2);\n\t\tconst left = editorLayout.glyphMarginLeft + editorLayout.glyphMarginWidth + (laneOrLine === 'lineNo' ? editorLayout.lineNumbersWidth : 0);\n\n\t\t// Constrain the hover widget to stay within the editor bounds\n\t\tconst editorHeight = editorLayout.height;\n\t\tconst maxTop = editorHeight - nodeHeight;\n\t\tconst constrainedTop = Math.max(0, Math.min(Math.round(top), maxTop));\n\n\t\tconst fixedOverflowWidgets = this._editor.getOption(EditorOption.fixedOverflowWidgets);\n\t\tif (fixedOverflowWidgets) {\n\t\t\t// Use fixed positioning relative to the viewport\n\t\t\tconst editorDomNode = this._editor.getDomNode();\n\t\t\tif (editorDomNode) {\n\t\t\t\tconst editorRect = dom.getDomNodePagePosition(editorDomNode);\n\t\t\t\tthis._hover.containerDomNode.style.position = 'fixed';\n\t\t\t\tthis._hover.containerDomNode.style.left = `${editorRect.left + left}px`;\n\t\t\t\tthis._hover.containerDomNode.style.top = `${editorRect.top + constrainedTop}px`;\n\t\t\t}\n\t\t} else {\n\t\t\t// Use absolute positioning relative to the editor\n\t\t\tthis._hover.containerDomNode.style.position = 'absolute';\n\t\t\tthis._hover.containerDomNode.style.left = `${left}px`;\n\t\t\tthis._hover.containerDomNode.style.top = `${constrainedTop}px`;\n\t\t}\n\t\tthis._hover.containerDomNode.style.zIndex = '11'; // 1 more than the zone widget at 10 (#233819)\n\t}\n\n\tprivate _onMouseLeave(e: MouseEvent): void {\n\t\tconst editorDomNode = this._editor.getDomNode();\n\t\tconst isMousePositionOutsideOfEditor = !editorDomNode || !isMousePositionWithinElement(editorDomNode, e.x, e.y);\n\t\tif (isMousePositionOutsideOfEditor) {\n\t\t\tthis.hide();\n\t\t}\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as dom from '../../../../base/browser/dom.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { IMarkdownRendererService } from '../../../../platform/markdown/browser/markdownRenderer.js';\nimport { ICodeEditor, IEditorMouseEvent, IOverlayWidget, IOverlayWidgetPosition, MouseTargetType } from '../../../browser/editorBrowser.js';\nimport { ConfigurationChangedEvent, EditorOption } from '../../../common/config/editorOptions.js';\nimport { HoverOperation, HoverResult, HoverStartMode } from './hoverOperation.js';\nimport { HoverWidget } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverWidget } from './hoverTypes.js';\nimport { IHoverMessage, LaneOrLineNumber, GlyphHoverComputer, GlyphHoverComputerOptions } from './glyphHoverComputer.js';\nimport { isMousePositionWithinElement } from './hoverUtils.js';\n\nconst $ = dom.$;\n\nexport class GlyphHoverWidget extends Disposable implements IOverlayWidget, IHoverWidget {\n\n\tpublic static readonly ID = 'editor.contrib.modesGlyphHoverWidget';\n\tpublic readonly allowEditorOverflow = true;\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _hover: HoverWidget;\n\n\tprivate _isVisible: boolean;\n\tprivate _messages: IHoverMessage[];\n\n\tprivate readonly _hoverOperation: HoverOperation<GlyphHoverComputerOptions, IHoverMessage>;\n\tprivate readonly _renderDisposeables = this._register(new DisposableStore());\n\n\tprivate _hoverComputerOptions: GlyphHoverComputerOptions | undefined;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IMarkdownRendererService private readonly _markdownRendererService: IMarkdownRendererService,\n\t) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\n\t\tthis._isVisible = false;\n\t\tthis._messages = [];\n\n\t\tthis._hover = this._register(new HoverWidget(true));\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\n\t\tthis._hoverOperation = this._register(new HoverOperation(this._editor, new GlyphHoverComputer(this._editor)));\n\t\tthis._register(this._hoverOperation.onResult((result) => this._withResult(result)));\n\n\t\tthis._register(this._editor.onDidChangeModelDecorations(() => this._onModelDecorationsChanged()));\n\t\tthis._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {\n\t\t\tif (e.hasChanged(EditorOption.fontInfo)) {\n\t\t\t\tthis._updateFont();\n\t\t\t}\n\t\t}));\n\t\tthis._register(dom.addStandardDisposableListener(this._hover.containerDomNode, 'mouseleave', (e) => {\n\t\t\tthis._onMouseLeave(e);\n\t\t}));\n\t\tthis._editor.addOverlayWidget(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._hoverComputerOptions = undefined;\n\t\tthis._editor.removeOverlayWidget(this);\n\t\tsuper.dispose();\n\t}\n\n\tpublic getId(): string {\n\t\treturn GlyphHoverWidget.ID;\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._hover.containerDomNode;\n\t}\n\n\tpublic getPosition(): IOverlayWidgetPosition | null {\n\t\treturn null;\n\t}\n\n\tprivate _updateFont(): void {\n\t\tconst codeClasses: HTMLElement[] = Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName('code'));\n\t\tcodeClasses.forEach(node => this._editor.applyFontInfo(node));\n\t}\n\n\tprivate _onModelDecorationsChanged(): void {\n\t\tif (this._isVisible && this._hoverComputerOptions) {\n\t\t\t// The decorations have changed and the hover is visible,\n\t\t\t// we need to recompute the displayed text\n\t\t\tthis._hoverOperation.cancel();\n\t\t\tthis._hoverOperation.start(HoverStartMode.Delayed, this._hoverComputerOptions);\n\t\t}\n\t}\n\n\tpublic showsOrWillShow(mouseEvent: IEditorMouseEvent): boolean {\n\t\tconst target = mouseEvent.target;\n\t\tif (target.type === MouseTargetType.GUTTER_GLYPH_MARGIN && target.detail.glyphMarginLane) {\n\t\t\tthis._startShowingAt(target.position.lineNumber, target.detail.glyphMarginLane);\n\t\t\treturn true;\n\t\t}\n\t\tif (target.type === MouseTargetType.GUTTER_LINE_NUMBERS) {\n\t\t\tthis._startShowingAt(target.position.lineNumber, 'lineNo');\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _startShowingAt(lineNumber: number, laneOrLine: LaneOrLineNumber): void {\n\t\tif (this._hoverComputerOptions\n\t\t\t&& this._hoverComputerOptions.lineNumber === lineNumber\n\t\t\t&& this._hoverComputerOptions.laneOrLine === laneOrLine) {\n\t\t\t// We have to show the widget at the exact same line number as before, so no work is needed\n\t\t\treturn;\n\t\t}\n\t\tthis._hoverOperation.cancel();\n\t\tthis.hide();\n\t\tthis._hoverComputerOptions = { lineNumber, laneOrLine };\n\t\tthis._hoverOperation.start(HoverStartMode.Delayed, this._hoverComputerOptions);\n\t}\n\n\tpublic hide(): void {\n\t\tthis._hoverComputerOptions = undefined;\n\t\tthis._hoverOperation.cancel();\n\t\tif (!this._isVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isVisible = false;\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\t}\n\n\tprivate _withResult(result: HoverResult<GlyphHoverComputerOptions, IHoverMessage>): void {\n\t\tthis._messages = result.value;\n\n\t\tif (this._messages.length > 0) {\n\t\t\tthis._renderMessages(result.options.lineNumber, result.options.laneOrLine, this._messages);\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}\n\n\tprivate _renderMessages(lineNumber: number, laneOrLine: LaneOrLineNumber, messages: IHoverMessage[]): void {\n\t\tthis._renderDisposeables.clear();\n\n\t\tconst fragment = document.createDocumentFragment();\n\n\t\tfor (const msg of messages) {\n\t\t\tconst markdownHoverElement = $('div.hover-row.markdown-hover');\n\t\t\tconst hoverContentsElement = dom.append(markdownHoverElement, $('div.hover-contents'));\n\t\t\tconst renderedContents = this._renderDisposeables.add(this._markdownRendererService.render(msg.value, { context: this._editor }));\n\t\t\thoverContentsElement.appendChild(renderedContents.element);\n\t\t\tfragment.appendChild(markdownHoverElement);\n\t\t}\n\n\t\tthis._updateContents(fragment);\n\t\tthis._showAt(lineNumber, laneOrLine);\n\t}\n\n\tprivate _updateContents(node: Node): void {\n\t\tthis._hover.contentsDomNode.textContent = '';\n\t\tthis._hover.contentsDomNode.appendChild(node);\n\t\tthis._updateFont();\n\t}\n\n\tprivate _showAt(lineNumber: number, laneOrLine: LaneOrLineNumber): void {\n\t\tif (!this._isVisible) {\n\t\t\tthis._isVisible = true;\n\t\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\t\t}\n\n\t\tconst editorLayout = this._editor.getLayoutInfo();\n\t\tconst topForLineNumber = this._editor.getTopForLineNumber(lineNumber);\n\t\tconst editorScrollTop = this._editor.getScrollTop();\n\t\tconst lineHeight = this._editor.getOption(EditorOption.lineHeight);\n\t\tconst nodeHeight = this._hover.containerDomNode.clientHeight;\n\t\tconst top = topForLineNumber - editorScrollTop - ((nodeHeight - lineHeight) / 2);\n\t\tconst left = editorLayout.glyphMarginLeft + editorLayout.glyphMarginWidth + (laneOrLine === 'lineNo' ? editorLayout.lineNumbersWidth : 0);\n\n\t\t// Constrain the hover widget to stay within the editor bounds\n\t\tconst editorHeight = editorLayout.height;\n\t\tconst maxTop = editorHeight - nodeHeight;\n\t\tconst constrainedTop = Math.max(0, Math.min(Math.round(top), maxTop));\n\n\t\tconst fixedOverflowWidgets = this._editor.getOption(EditorOption.fixedOverflowWidgets);\n\t\tif (fixedOverflowWidgets) {\n\t\t\t// Use fixed positioning relative to the viewport\n\t\t\tconst editorDomNode = this._editor.getDomNode();\n\t\t\tif (editorDomNode) {\n\t\t\t\tconst editorRect = dom.getDomNodePagePosition(editorDomNode);\n\t\t\t\tthis._hover.containerDomNode.style.position = 'fixed';\n\t\t\t\tthis._hover.containerDomNode.style.left = `${editorRect.left + left}px`;\n\t\t\t\tthis._hover.containerDomNode.style.top = `${editorRect.top + constrainedTop}px`;\n\t\t\t}\n\t\t} else {\n\t\t\t// Use absolute positioning relative to the editor\n\t\t\tthis._hover.containerDomNode.style.position = 'absolute';\n\t\t\tthis._hover.containerDomNode.style.left = `${left}px`;\n\t\t\tthis._hover.containerDomNode.style.top = `${constrainedTop}px`;\n\t\t}\n\t\tthis._hover.containerDomNode.style.zIndex = '11'; // 1 more than the zone widget at 10 (#233819)\n\t}\n\n\tprivate _onMouseLeave(e: MouseEvent): void {\n\t\tconst editorDomNode = this._editor.getDomNode();\n\t\tconst isMousePositionOutsideOfEditor = !editorDomNode || !isMousePositionWithinElement(editorDomNode, e.x, e.y);\n\t\tif (isMousePositionOutsideOfEditor) {\n\t\t\tthis.hide();\n\t\t}\n\t}\n}\n"]}
|
|
@@ -330,7 +330,6 @@ let InlineCompletionsSource = class InlineCompletionsSource extends Disposable {
|
|
|
330
330
|
return;
|
|
331
331
|
}
|
|
332
332
|
const emptyEndOfLifeEvent = {
|
|
333
|
-
id: requestResponseInfo.requestUuid,
|
|
334
333
|
opportunityId: requestResponseInfo.requestUuid,
|
|
335
334
|
noSuggestionReason: requestResponseInfo.noSuggestionReason ?? 'unknown',
|
|
336
335
|
extensionId: 'vscode-core',
|