monaco-editor-core 0.56.0-dev-20260629 → 0.56.0

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.
Files changed (64) hide show
  1. package/esm/nls.keys.json +1 -1
  2. package/esm/nls.messages.cs.js +2 -2
  3. package/esm/nls.messages.de.js +2 -2
  4. package/esm/nls.messages.es.js +2 -2
  5. package/esm/nls.messages.fr.js +2 -2
  6. package/esm/nls.messages.it.js +2 -2
  7. package/esm/nls.messages.ja.js +2 -2
  8. package/esm/nls.messages.js +1 -1
  9. package/esm/nls.messages.json +1 -1
  10. package/esm/nls.messages.ko.js +2 -2
  11. package/esm/nls.messages.pl.js +2 -2
  12. package/esm/nls.messages.pt-br.js +2 -2
  13. package/esm/nls.messages.ru.js +2 -2
  14. package/esm/nls.messages.tr.js +2 -2
  15. package/esm/nls.messages.zh-cn.js +2 -2
  16. package/esm/nls.messages.zh-tw.js +2 -2
  17. package/esm/nls.metadata.json +0 -4
  18. package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +10 -23
  19. package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js.map +1 -1
  20. package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js +0 -1
  21. package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js.map +1 -1
  22. package/esm/vs/editor/contrib/hover/browser/contentHoverRendered.js +2 -2
  23. package/esm/vs/editor/contrib/hover/browser/contentHoverRendered.js.map +1 -1
  24. package/esm/vs/platform/actionWidget/browser/actionList.js +8 -48
  25. package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
  26. package/esm/vs/platform/actionWidget/browser/actionWidget.css +2 -87
  27. package/esm/vs/platform/actionWidget/browser/actionWidget.js +12 -12
  28. package/esm/vs/platform/configuration/common/configurationRegistry.js +11 -11
  29. package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
  30. package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
  31. package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
  32. package/esm/vs/platform/contextkey/common/scanner.js +5 -5
  33. package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
  34. package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
  35. package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
  36. package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +5 -5
  37. package/esm/vs/platform/list/browser/listService.js +27 -27
  38. package/esm/vs/platform/markers/common/markerService.js +2 -2
  39. package/esm/vs/platform/markers/common/markers.js +6 -6
  40. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
  41. package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
  42. package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
  43. package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
  44. package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
  45. package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
  46. package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
  47. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
  48. package/esm/vs/platform/quickinput/browser/tree/quickTree.js +1 -1
  49. package/esm/vs/platform/theme/common/colorUtils.js +2 -2
  50. package/esm/vs/platform/theme/common/colors/baseColors.js +19 -19
  51. package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
  52. package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
  53. package/esm/vs/platform/theme/common/colors/inputColors.js +48 -48
  54. package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
  55. package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
  56. package/esm/vs/platform/theme/common/colors/minimapColors.js +11 -11
  57. package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
  58. package/esm/vs/platform/theme/common/colors/quickpickColors.js +10 -10
  59. package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
  60. package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
  61. package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
  62. package/esm/vs/platform/workspace/common/workspace.js +1 -1
  63. package/package.json +2 -2
  64. package/version.txt +1 -1
@@ -39,14 +39,6 @@ let MultiDiffEditorWidgetImpl = class MultiDiffEditorWidgetImpl extends Disposab
39
39
  this._workbenchUIElementFactory = _workbenchUIElementFactory;
40
40
  this._parentContextKeyService = _parentContextKeyService;
41
41
  this._parentInstantiationService = _parentInstantiationService;
42
- /**
43
- * When `true`, the automatic "select the first change" initialization that
44
- * runs once the view model finishes loading does not move keyboard focus
45
- * into the editor. Driven by {@link setPreserveFocusOnLoad} so a
46
- * `preserveFocus` open (e.g. restored in the background or on a session
47
- * switch) does not steal focus, while a normal user-initiated open does.
48
- */
49
- this._preserveFocusOnLoad = false;
50
42
  this._scrollableElements = h('div.scrollContent', [
51
43
  h('div@content', {
52
44
  style: {
@@ -196,14 +188,8 @@ let MultiDiffEditorWidgetImpl = class MultiDiffEditorWidgetImpl extends Disposab
196
188
  if (activeDiffItem) {
197
189
  return;
198
190
  }
199
- // Navigate to the first change using the existing navigation
200
- // logic. Whether this also moves keyboard focus into the editor
201
- // is driven by the last `setViewModel` call: an editor opened
202
- // with `preserveFocus` (e.g. restored in the background or on a
203
- // session switch) must not steal focus from wherever the user is
204
- // (such as the chat input), while a normal user-initiated open
205
- // focuses the first change so the editor is ready to use.
206
- this._navigateToChange('next', !this._preserveFocusOnLoad);
191
+ // Navigate to the first change using the existing navigation logic
192
+ this.goToNextChange();
207
193
  }
208
194
  }));
209
195
  this._register(this._register(autorun(reader => {
@@ -234,7 +220,10 @@ let MultiDiffEditorWidgetImpl = class MultiDiffEditorWidgetImpl extends Disposab
234
220
  highlightRange(editor, options.range);
235
221
  }
236
222
  }
237
- _navigateToChange(direction, focusEditor = true) {
223
+ goToNextChange() {
224
+ this._navigateToChange('next');
225
+ }
226
+ _navigateToChange(direction) {
238
227
  const viewItems = this._viewItems.get();
239
228
  if (viewItems.length === 0) {
240
229
  return;
@@ -243,7 +232,7 @@ let MultiDiffEditorWidgetImpl = class MultiDiffEditorWidgetImpl extends Disposab
243
232
  const currentIndex = activeViewModel ? viewItems.findIndex(v => v.viewModel === activeViewModel) : -1;
244
233
  // Start with first file if no active item
245
234
  if (currentIndex === -1) {
246
- this._goToFile(0, 'first', focusEditor);
235
+ this._goToFile(0, 'first');
247
236
  return;
248
237
  }
249
238
  // Try current file first - expand if collapsed
@@ -263,9 +252,9 @@ let MultiDiffEditorWidgetImpl = class MultiDiffEditorWidgetImpl extends Disposab
263
252
  }
264
253
  // Move to next/previous file
265
254
  const nextIndex = (currentIndex + (direction === 'next' ? 1 : -1) + viewItems.length) % viewItems.length;
266
- this._goToFile(nextIndex, direction === 'next' ? 'first' : 'last', focusEditor);
255
+ this._goToFile(nextIndex, direction === 'next' ? 'first' : 'last');
267
256
  }
268
- _goToFile(index, position, focusEditor = true) {
257
+ _goToFile(index, position) {
269
258
  const item = this._viewItems.get()[index];
270
259
  if (item.viewModel.collapsed.get()) {
271
260
  item.viewModel.collapsed.set(false, undefined);
@@ -283,9 +272,7 @@ let MultiDiffEditorWidgetImpl = class MultiDiffEditorWidgetImpl extends Disposab
283
272
  modifiedEditor.revealLineInCenter(lastChange.modified.startLineNumber);
284
273
  }
285
274
  }
286
- if (focusEditor) {
287
- editor?.focus();
288
- }
275
+ editor?.focus();
289
276
  }
290
277
  render(reader) {
291
278
  const scrollTop = this.scrollTop.read(reader);
@@ -1 +1 @@
1
- {"version":3,"sources":["vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAa,SAAS,EAAE,CAAC,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AACxG,OAAO,EAAE,uBAAuB,EAAE,MAAM,4DAA4D,CAAC;AACrG,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,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E,SAAS,CAAC,CAAC;QAErC,IAAI,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;QAClC,IAAI,CAAC,GAAG,EAAE,CAAC;YACV,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;YACjG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;YAEtC,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC;YACpE,IAAI,UAAU,EAAE,CAAC;gBAChB,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAC7C,CAAC;QACF,CAAC;QACD,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC3D,CAAC;CACD","file":"multiDiffEditorWidgetImpl.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 { Dimension, getWindow, h, scheduleAtNextAnimationFrame } from '../../../../base/browser/dom.js';\nimport { SmoothScrollableElement } from '../../../../base/browser/ui/scrollbar/scrollableElement.js';\nimport { compareBy, numberComparator } from '../../../../base/common/arrays.js';\nimport { findFirstMax } from '../../../../base/common/arraysFind.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { Disposable, IReference, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { IObservable, IReader, ITransaction, autorun, autorunWithStore, derived, disposableObservableValue, globalTransaction, observableFromEvent, observableValue, transaction } from '../../../../base/common/observable.js';\nimport { Scrollable, ScrollbarVisibility } from '../../../../base/common/scrollable.js';\nimport { URI } from '../../../../base/common/uri.js';\nimport { localize } from '../../../../nls.js';\nimport { ContextKeyValue, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js';\nimport { OffsetRange } from '../../../common/core/ranges/offsetRange.js';\nimport { IRange } from '../../../common/core/range.js';\nimport { ISelection, Selection } from '../../../common/core/selection.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { ICodeEditor } from '../../editorBrowser.js';\nimport { ObservableElementSizeObserver } from '../diffEditor/utils.js';\nimport { DiffEditorItemTemplate, TemplateData } from './diffEditorItemTemplate.js';\nimport { DocumentDiffItemViewModel, MultiDiffEditorViewModel } from './multiDiffEditorViewModel.js';\nimport { RevealOptions } from './multiDiffEditorWidget.js';\nimport { ObjectPool } from './objectPool.js';\nimport './style.css';\nimport { IWorkbenchUIElementFactory } from './workbenchUIElementFactory.js';\n\nexport class MultiDiffEditorWidgetImpl extends Disposable {\n\tprivate readonly _scrollableElements;\n\n\tprivate readonly _scrollable;\n\n\tprivate readonly _scrollableElement;\n\n\tprivate readonly _elements;\n\n\tprivate readonly _sizeObserver;\n\n\tprivate readonly _objectPool;\n\n\tpublic readonly scrollTop;\n\tpublic readonly scrollLeft;\n\n\tprivate readonly _viewItemsInfo;\n\n\tprivate readonly _viewItems;\n\n\tprivate readonly _spaceBetweenPx;\n\n\tprivate readonly _totalHeight;\n\tpublic readonly activeControl;\n\n\tprivate readonly _contextKeyService;\n\tprivate readonly _instantiationService;\n\n\t/**\n\t * When `true`, the automatic \"select the first change\" initialization that\n\t * runs once the view model finishes loading does not move keyboard focus\n\t * into the editor. Driven by {@link setPreserveFocusOnLoad} so a\n\t * `preserveFocus` open (e.g. restored in the background or on a session\n\t * switch) does not steal focus, while a normal user-initiated open does.\n\t */\n\tprivate _preserveFocusOnLoad = false;\n\n\tconstructor(\n\t\tprivate readonly _element: HTMLElement,\n\t\tprivate readonly _dimension: IObservable<Dimension | undefined>,\n\t\tprivate readonly _viewModel: IObservable<MultiDiffEditorViewModel | undefined>,\n\t\tprivate readonly _workbenchUIElementFactory: IWorkbenchUIElementFactory,\n\t\t@IContextKeyService private readonly _parentContextKeyService: IContextKeyService,\n\t\t@IInstantiationService private readonly _parentInstantiationService: IInstantiationService,\n\t) {\n\t\tsuper();\n\t\tthis._scrollableElements = h('div.scrollContent', [\n\t\t\th('div@content', {\n\t\t\t\tstyle: {\n\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t}\n\t\t\t}),\n\t\t\th('div.monaco-editor@overflowWidgetsDomNode', {\n\t\t\t}),\n\t\t]);\n\t\tthis._scrollable = this._register(new Scrollable({\n\t\t\tforceIntegerValues: false,\n\t\t\tscheduleAtNextAnimationFrame: (cb) => scheduleAtNextAnimationFrame(getWindow(this._element), cb),\n\t\t\tsmoothScrollDuration: 100,\n\t\t}));\n\t\tthis._scrollableElement = this._register(new SmoothScrollableElement(this._scrollableElements.root, {\n\t\t\tvertical: ScrollbarVisibility.Auto,\n\t\t\thorizontal: ScrollbarVisibility.Auto,\n\t\t\tuseShadows: false,\n\t\t}, this._scrollable));\n\t\tthis._elements = h('div.monaco-component.multiDiffEditor', {}, [\n\t\t\th('div', {}, [this._scrollableElement.getDomNode()]),\n\t\t\th('div.placeholder@placeholder', {}, [h('div')]),\n\t\t]);\n\t\tthis._sizeObserver = this._register(new ObservableElementSizeObserver(this._element, undefined));\n\t\tthis._objectPool = this._register(new ObjectPool<TemplateData, DiffEditorItemTemplate>((data) => {\n\t\t\tconst template = this._instantiationService.createInstance(\n\t\t\t\tDiffEditorItemTemplate,\n\t\t\t\tthis._scrollableElements.content,\n\t\t\t\tthis._scrollableElements.overflowWidgetsDomNode,\n\t\t\t\tthis._workbenchUIElementFactory\n\t\t\t);\n\t\t\ttemplate.setData(data);\n\t\t\treturn template;\n\t\t}));\n\t\tthis.scrollTop = observableFromEvent(this, this._scrollableElement.onScroll, () => /** @description scrollTop */ this._scrollableElement.getScrollPosition().scrollTop);\n\t\tthis.scrollLeft = observableFromEvent(this, this._scrollableElement.onScroll, () => /** @description scrollLeft */ this._scrollableElement.getScrollPosition().scrollLeft);\n\t\tthis._viewItemsInfo = derived<{ items: readonly VirtualizedViewItem[]; getItem: (viewModel: DocumentDiffItemViewModel) => VirtualizedViewItem }>(this,\n\t\t\t(reader) => {\n\t\t\t\tconst vm = this._viewModel.read(reader);\n\t\t\t\tif (!vm) {\n\t\t\t\t\treturn { items: [], getItem: _d => { throw new BugIndicatingError(); } };\n\t\t\t\t}\n\t\t\t\tconst viewModels = vm.items.read(reader);\n\t\t\t\tconst map = new Map<DocumentDiffItemViewModel, VirtualizedViewItem>();\n\t\t\t\tconst items = viewModels.map(d => {\n\t\t\t\t\tconst item = reader.store.add(new VirtualizedViewItem(d, this._objectPool, this.scrollLeft, delta => {\n\t\t\t\t\t\tthis._scrollableElement.setScrollPosition({ scrollTop: this._scrollableElement.getScrollPosition().scrollTop + delta });\n\t\t\t\t\t}));\n\t\t\t\t\tconst data = this._lastDocStates?.[item.getKey()];\n\t\t\t\t\tif (data) {\n\t\t\t\t\t\ttransaction(tx => {\n\t\t\t\t\t\t\titem.setViewState(data, tx);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tmap.set(d, item);\n\t\t\t\t\treturn item;\n\t\t\t\t});\n\t\t\t\treturn { items, getItem: d => map.get(d)! };\n\t\t\t}\n\t\t);\n\t\tthis._viewItems = this._viewItemsInfo.map(this, items => items.items);\n\t\tthis._spaceBetweenPx = 0;\n\t\tthis._totalHeight = this._viewItems.map(this, (items, reader) => items.reduce((r, i) => r + i.contentHeight.read(reader) + this._spaceBetweenPx, 0));\n\t\tthis.activeControl = derived(this, reader => {\n\t\t\tconst activeDiffItem = this._viewModel.read(reader)?.activeDiffItem.read(reader);\n\t\t\tif (!activeDiffItem) { return undefined; }\n\t\t\tconst viewItem = this._viewItemsInfo.read(reader).getItem(activeDiffItem);\n\t\t\treturn viewItem.template.read(reader)?.editor;\n\t\t});\n\t\tthis._contextKeyService = this._register(this._parentContextKeyService.createScoped(this._element));\n\t\tthis._instantiationService = this._register(this._parentInstantiationService.createChild(\n\t\t\tnew ServiceCollection([IContextKeyService, this._contextKeyService])\n\t\t));\n\n\t\tthis._contextKeyService.createKey(EditorContextKeys.inMultiDiffEditor.key, true);\n\n\t\tthis._lastDocStates = {};\n\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\tconst viewModel = this._viewModel.read(reader);\n\t\t\tif (viewModel && viewModel.contextKeys) {\n\t\t\t\tfor (const [key, value] of Object.entries(viewModel.contextKeys)) {\n\t\t\t\t\tconst contextKey = this._contextKeyService.createKey<ContextKeyValue>(key, undefined);\n\t\t\t\t\tcontextKey.set(value);\n\t\t\t\t\tstore.add(toDisposable(() => contextKey.reset()));\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tconst ctxAllCollapsed = this._parentContextKeyService.createKey<boolean>(EditorContextKeys.multiDiffEditorAllCollapsed.key, false);\n\t\tthis._register(autorun((reader) => {\n\t\t\tconst viewModel = this._viewModel.read(reader);\n\t\t\tif (viewModel) {\n\t\t\t\tconst allCollapsed = viewModel.items.read(reader).every(item => item.collapsed.read(reader));\n\t\t\t\tctxAllCollapsed.set(allCollapsed);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun((reader) => {\n\t\t\t/** @description Update widget dimension */\n\t\t\tconst dimension = this._dimension.read(reader);\n\t\t\tthis._sizeObserver.observe(dimension);\n\t\t}));\n\n\t\tconst placeholderMessage = derived(reader => {\n\t\t\tconst items = this._viewItems.read(reader);\n\t\t\tif (items.length > 0) { return undefined; }\n\n\t\t\tconst vm = this._viewModel.read(reader);\n\t\t\treturn (!vm || vm.isLoading.read(reader))\n\t\t\t\t? localize('loading', 'Loading...')\n\t\t\t\t: localize('noChangedFiles', 'No Changed Files');\n\t\t});\n\n\t\tthis._register(autorun((reader) => {\n\t\t\tconst message = placeholderMessage.read(reader);\n\t\t\tthis._elements.placeholder.innerText = message ?? '';\n\t\t\tthis._elements.placeholder.classList.toggle('visible', !!message);\n\t\t}));\n\n\t\tthis._scrollableElements.content.style.position = 'relative';\n\n\t\tthis._register(autorun((reader) => {\n\t\t\t/** @description Update scroll dimensions */\n\t\t\tconst height = this._sizeObserver.height.read(reader);\n\t\t\tthis._scrollableElements.root.style.height = `${height}px`;\n\t\t\tconst totalHeight = this._totalHeight.read(reader);\n\t\t\tthis._scrollableElements.content.style.height = `${totalHeight}px`;\n\n\t\t\tconst width = this._sizeObserver.width.read(reader);\n\n\t\t\tlet scrollWidth = width;\n\t\t\tconst viewItems = this._viewItems.read(reader);\n\t\t\tconst max = findFirstMax(viewItems, compareBy(i => i.maxScroll.read(reader).maxScroll, numberComparator));\n\t\t\tif (max) {\n\t\t\t\tconst maxScroll = max.maxScroll.read(reader);\n\t\t\t\tscrollWidth = width + maxScroll.maxScroll;\n\t\t\t}\n\n\t\t\tthis._scrollableElement.setScrollDimensions({\n\t\t\t\twidth: width,\n\t\t\t\theight: height,\n\t\t\t\tscrollHeight: totalHeight,\n\t\t\t\tscrollWidth,\n\t\t\t});\n\t\t}));\n\n\t\t_element.replaceChildren(this._elements.root);\n\t\tthis._register(toDisposable(() => {\n\t\t\t_element.replaceChildren();\n\t\t}));\n\n\t\t// Automatically select the first change in the first file when items are loaded\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description Initialize first change */\n\t\t\tconst viewModel = this._viewModel.read(reader);\n\t\t\tif (!viewModel) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Only initialize when loading is complete\n\t\t\tif (!viewModel.isLoading.read(reader)) {\n\t\t\t\tconst items = viewModel.items.read(reader);\n\t\t\t\tif (items.length === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Only initialize if there's no active item yet\n\t\t\t\tconst activeDiffItem = viewModel.activeDiffItem.read(reader);\n\t\t\t\tif (activeDiffItem) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Navigate to the first change using the existing navigation\n\t\t\t\t// logic. Whether this also moves keyboard focus into the editor\n\t\t\t\t// is driven by the last `setViewModel` call: an editor opened\n\t\t\t\t// with `preserveFocus` (e.g. restored in the background or on a\n\t\t\t\t// session switch) must not steal focus from wherever the user is\n\t\t\t\t// (such as the chat input), while a normal user-initiated open\n\t\t\t\t// focuses the first change so the editor is ready to use.\n\t\t\t\tthis._navigateToChange('next', !this._preserveFocusOnLoad);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this._register(autorun(reader => {\n\t\t\t/** @description Render all */\n\t\t\tglobalTransaction(tx => {\n\t\t\t\tthis.render(reader);\n\t\t\t});\n\t\t})));\n\t}\n\tpublic reveal(resource: IMultiDiffResourceId, options?: RevealOptions): void {\n\t\tconst viewItems = this._viewItems.get();\n\t\tconst index = viewItems.findIndex(\n\t\t\t(item) => item.viewModel.originalUri?.toString() === resource.original?.toString()\n\t\t\t\t&& item.viewModel.modifiedUri?.toString() === resource.modified?.toString()\n\t\t);\n\t\tif (index === -1) {\n\t\t\tthrow new BugIndicatingError('Resource not found in diff editor');\n\t\t}\n\t\tconst viewItem = viewItems[index];\n\t\tthis._viewModel.get()!.activeDiffItem.setCache(viewItem.viewModel, undefined);\n\n\t\tlet scrollTop = 0;\n\t\tfor (let i = 0; i < index; i++) {\n\t\t\tscrollTop += viewItems[i].contentHeight.get() + this._spaceBetweenPx;\n\t\t}\n\t\tthis._scrollableElement.setScrollPosition({ scrollTop });\n\n\t\tconst diffEditor = viewItem.template.get()?.editor;\n\t\tconst editor = 'original' in resource ? diffEditor?.getOriginalEditor() : diffEditor?.getModifiedEditor();\n\t\tif (editor && options?.range) {\n\t\t\teditor.revealRangeInCenter(options.range);\n\t\t\thighlightRange(editor, options.range);\n\t\t}\n\t}\n\n\t/** This accounts for documents that are not loaded yet. */\n\tprivate _lastDocStates: IMultiDiffEditorViewState['docStates'];\n\n\tprivate _navigateToChange(direction: 'next' | 'previous', focusEditor: boolean = true): void {\n\t\tconst viewItems = this._viewItems.get();\n\t\tif (viewItems.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst activeViewModel = this._viewModel.get()?.activeDiffItem.get();\n\t\tconst currentIndex = activeViewModel ? viewItems.findIndex(v => v.viewModel === activeViewModel) : -1;\n\n\t\t// Start with first file if no active item\n\t\tif (currentIndex === -1) {\n\t\t\tthis._goToFile(0, 'first', focusEditor);\n\t\t\treturn;\n\t\t}\n\n\t\t// Try current file first - expand if collapsed\n\t\tconst currentItem = viewItems[currentIndex];\n\t\tif (currentItem.viewModel.collapsed.get()) {\n\t\t\tcurrentItem.viewModel.collapsed.set(false, undefined);\n\t\t}\n\n\t\tconst editor = currentItem.template.get()?.editor;\n\t\tif (editor?.getDiffComputationResult()?.changes2?.length) {\n\t\t\tconst pos = editor.getModifiedEditor().getPosition()?.lineNumber || 1;\n\t\t\tconst changes = editor.getDiffComputationResult()!.changes2!;\n\t\t\tconst hasNext = direction === 'next' ? changes.some(c => c.modified.startLineNumber > pos) : changes.some(c => c.modified.endLineNumberExclusive <= pos);\n\n\t\t\tif (hasNext) {\n\t\t\t\teditor.goToDiff(direction);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Move to next/previous file\n\t\tconst nextIndex = (currentIndex + (direction === 'next' ? 1 : -1) + viewItems.length) % viewItems.length;\n\t\tthis._goToFile(nextIndex, direction === 'next' ? 'first' : 'last', focusEditor);\n\t}\n\n\tprivate _goToFile(index: number, position: 'first' | 'last', focusEditor: boolean = true): void {\n\t\tconst item = this._viewItems.get()[index];\n\t\tif (item.viewModel.collapsed.get()) {\n\t\t\titem.viewModel.collapsed.set(false, undefined);\n\t\t}\n\n\t\tthis.reveal({ original: item.viewModel.originalUri, modified: item.viewModel.modifiedUri });\n\n\t\tconst editor = item.template.get()?.editor;\n\t\tif (editor?.getDiffComputationResult()?.changes2?.length) {\n\t\t\tif (position === 'first') {\n\t\t\t\teditor.revealFirstDiff();\n\t\t\t} else {\n\t\t\t\tconst lastChange = editor.getDiffComputationResult()!.changes2!.at(-1)!;\n\t\t\t\tconst modifiedEditor = editor.getModifiedEditor();\n\t\t\t\tmodifiedEditor.setPosition({ lineNumber: lastChange.modified.startLineNumber, column: 1 });\n\t\t\t\tmodifiedEditor.revealLineInCenter(lastChange.modified.startLineNumber);\n\t\t\t}\n\t\t}\n\t\tif (focusEditor) {\n\t\t\teditor?.focus();\n\t\t}\n\t}\n\n\tprivate render(reader: IReader | undefined) {\n\t\tconst scrollTop = this.scrollTop.read(reader);\n\t\tlet contentScrollOffsetToScrollOffset = 0;\n\t\tlet itemHeightSumBefore = 0;\n\t\tlet itemContentHeightSumBefore = 0;\n\t\tconst viewPortHeight = this._sizeObserver.height.read(reader);\n\t\tconst contentViewPort = OffsetRange.ofStartAndLength(scrollTop, viewPortHeight);\n\n\t\tconst width = this._sizeObserver.width.read(reader);\n\n\t\tfor (const v of this._viewItems.read(reader)) {\n\t\t\tconst itemContentHeight = v.contentHeight.read(reader);\n\t\t\tconst itemHeight = Math.min(itemContentHeight, viewPortHeight);\n\t\t\tconst itemRange = OffsetRange.ofStartAndLength(itemHeightSumBefore, itemHeight);\n\t\t\tconst itemContentRange = OffsetRange.ofStartAndLength(itemContentHeightSumBefore, itemContentHeight);\n\n\t\t\tif (itemContentRange.isBefore(contentViewPort)) {\n\t\t\t\tcontentScrollOffsetToScrollOffset -= itemContentHeight - itemHeight;\n\t\t\t\tv.hide();\n\t\t\t} else if (itemContentRange.isAfter(contentViewPort)) {\n\t\t\t\tv.hide();\n\t\t\t} else {\n\t\t\t\tconst scroll = Math.max(0, Math.min(contentViewPort.start - itemContentRange.start, itemContentHeight - itemHeight));\n\t\t\t\tcontentScrollOffsetToScrollOffset -= scroll;\n\t\t\t\tconst viewPort = OffsetRange.ofStartAndLength(scrollTop + contentScrollOffsetToScrollOffset, viewPortHeight);\n\t\t\t\tv.render(itemRange, scroll, width, viewPort);\n\t\t\t}\n\n\t\t\titemHeightSumBefore += itemHeight + this._spaceBetweenPx;\n\t\t\titemContentHeightSumBefore += itemContentHeight + this._spaceBetweenPx;\n\t\t}\n\n\t\tthis._scrollableElements.content.style.transform = `translateY(${-(scrollTop + contentScrollOffsetToScrollOffset)}px)`;\n\t}\n}\n\nfunction highlightRange(targetEditor: ICodeEditor, range: IRange) {\n\tconst modelNow = targetEditor.getModel();\n\tconst decorations = targetEditor.createDecorationsCollection([{ range, options: { description: 'symbol-navigate-action-highlight', className: 'symbolHighlight' } }]);\n\tsetTimeout(() => {\n\t\tif (targetEditor.getModel() === modelNow) {\n\t\t\tdecorations.clear();\n\t\t}\n\t}, 350);\n}\n\nexport interface IMultiDiffEditorViewState {\n\tdocStates?: Record<string, IMultiDiffDocState>;\n}\n\ninterface IMultiDiffDocState {\n\tcollapsed: boolean;\n\tselections?: ISelection[];\n}\n\nexport type IMultiDiffResourceId = { original: URI | undefined; modified: URI | undefined };\n\nclass VirtualizedViewItem extends Disposable {\n\tprivate readonly _templateRef = this._register(disposableObservableValue<IReference<DiffEditorItemTemplate> | undefined>(this, undefined));\n\n\tpublic readonly contentHeight = derived(this, reader =>\n\t\tthis._templateRef.read(reader)?.object.contentHeight?.read(reader) ?? this.viewModel.lastTemplateData.read(reader).contentHeight\n\t);\n\n\tpublic readonly maxScroll = derived(this, reader => this._templateRef.read(reader)?.object.maxScroll.read(reader) ?? { maxScroll: 0, scrollWidth: 0 });\n\n\tpublic readonly template = derived(this, reader => this._templateRef.read(reader)?.object);\n\tprivate _isHidden = observableValue(this, false);\n\n\tprivate readonly _isFocused = derived(this, reader => this.template.read(reader)?.isFocused.read(reader) ?? false);\n\n\tconstructor(\n\t\tpublic readonly viewModel: DocumentDiffItemViewModel,\n\t\tprivate readonly _objectPool: ObjectPool<TemplateData, DiffEditorItemTemplate>,\n\t\tprivate readonly _scrollLeft: IObservable<number>,\n\t\tprivate readonly _deltaScrollVertical: (delta: number) => void,\n\t) {\n\t\tsuper();\n\n\t\tthis.viewModel.setIsFocused(this._isFocused, undefined);\n\n\t\tthis._register(autorun((reader) => {\n\t\t\tconst scrollLeft = this._scrollLeft.read(reader);\n\t\t\tthis._templateRef.read(reader)?.object.setScrollLeft(scrollLeft);\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst ref = this._templateRef.read(reader);\n\t\t\tif (!ref) { return; }\n\t\t\tconst isHidden = this._isHidden.read(reader);\n\t\t\tif (!isHidden) { return; }\n\n\t\t\tconst isFocused = ref.object.isFocused.read(reader);\n\t\t\tif (isFocused) { return; }\n\n\t\t\tthis._clear();\n\t\t}));\n\t}\n\n\toverride dispose(): void {\n\t\tthis._clear();\n\t\tsuper.dispose();\n\t}\n\n\tpublic override toString(): string {\n\t\treturn `VirtualViewItem(${this.viewModel.documentDiffItem.modified?.uri.toString()})`;\n\t}\n\n\tpublic getKey(): string {\n\t\treturn this.viewModel.getKey();\n\t}\n\n\tpublic setViewState(viewState: IMultiDiffDocState, tx: ITransaction): void {\n\t\tthis.viewModel.collapsed.set(viewState.collapsed, tx);\n\n\t\tthis._updateTemplateData(tx);\n\t\tconst data = this.viewModel.lastTemplateData.get();\n\t\tconst selections = viewState.selections?.map(Selection.liftSelection);\n\t\tthis.viewModel.lastTemplateData.set({\n\t\t\t...data,\n\t\t\tselections,\n\t\t}, tx);\n\t\tconst ref = this._templateRef.get();\n\t\tif (ref) {\n\t\t\tif (selections) {\n\t\t\t\tref.object.editor.setSelections(selections);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _updateTemplateData(tx: ITransaction): void {\n\t\tconst ref = this._templateRef.get();\n\t\tif (!ref) { return; }\n\t\tthis.viewModel.lastTemplateData.set({\n\t\t\tcontentHeight: ref.object.contentHeight.get(),\n\t\t\tselections: ref.object.editor.getSelections() ?? undefined,\n\t\t}, tx);\n\t}\n\n\tprivate _clear(): void {\n\t\tconst ref = this._templateRef.get();\n\t\tif (!ref) { return; }\n\t\ttransaction(tx => {\n\t\t\tthis._updateTemplateData(tx);\n\t\t\tref.object.hide();\n\t\t\tthis._templateRef.set(undefined, tx);\n\t\t});\n\t}\n\n\tpublic hide(): void {\n\t\tthis._isHidden.set(true, undefined);\n\t}\n\n\tpublic render(verticalSpace: OffsetRange, offset: number, width: number, viewPort: OffsetRange): void {\n\t\tthis._isHidden.set(false, undefined);\n\n\t\tlet ref = this._templateRef.get();\n\t\tif (!ref) {\n\t\t\tref = this._objectPool.getUnusedObj(new TemplateData(this.viewModel, this._deltaScrollVertical));\n\t\t\tthis._templateRef.set(ref, undefined);\n\n\t\t\tconst selections = this.viewModel.lastTemplateData.get().selections;\n\t\t\tif (selections) {\n\t\t\t\tref.object.editor.setSelections(selections);\n\t\t\t}\n\t\t}\n\t\tref.object.render(verticalSpace, width, offset, viewPort);\n\t}\n}\n"]}
1
+ {"version":3,"sources":["vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAa,SAAS,EAAE,CAAC,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AACxG,OAAO,EAAE,uBAAuB,EAAE,MAAM,4DAA4D,CAAC;AACrG,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAc,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAC5F,OAAO,EAAsC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAChO,OAAO,EAAE,UAAU,EAAuB,MAAM,uCAAuC,CAAC;AAExF,OAAO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EAAE,QAAQ,CAAC,CAAC;IAC3D,CAAC;CACD","file":"multiDiffEditorWidgetImpl.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 { Dimension, getWindow, h, scheduleAtNextAnimationFrame } from '../../../../base/browser/dom.js';\nimport { SmoothScrollableElement } from '../../../../base/browser/ui/scrollbar/scrollableElement.js';\nimport { compareBy, numberComparator } from '../../../../base/common/arrays.js';\nimport { findFirstMax } from '../../../../base/common/arraysFind.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { Disposable, IReference, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { IObservable, IReader, ITransaction, autorun, autorunWithStore, derived, disposableObservableValue, globalTransaction, observableFromEvent, observableValue, transaction } from '../../../../base/common/observable.js';\nimport { Scrollable, ScrollbarVisibility } from '../../../../base/common/scrollable.js';\nimport { URI } from '../../../../base/common/uri.js';\nimport { localize } from '../../../../nls.js';\nimport { ContextKeyValue, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js';\nimport { OffsetRange } from '../../../common/core/ranges/offsetRange.js';\nimport { IRange } from '../../../common/core/range.js';\nimport { ISelection, Selection } from '../../../common/core/selection.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { ICodeEditor } from '../../editorBrowser.js';\nimport { ObservableElementSizeObserver } from '../diffEditor/utils.js';\nimport { DiffEditorItemTemplate, TemplateData } from './diffEditorItemTemplate.js';\nimport { DocumentDiffItemViewModel, MultiDiffEditorViewModel } from './multiDiffEditorViewModel.js';\nimport { RevealOptions } from './multiDiffEditorWidget.js';\nimport { ObjectPool } from './objectPool.js';\nimport './style.css';\nimport { IWorkbenchUIElementFactory } from './workbenchUIElementFactory.js';\n\nexport class MultiDiffEditorWidgetImpl extends Disposable {\n\tprivate readonly _scrollableElements;\n\n\tprivate readonly _scrollable;\n\n\tprivate readonly _scrollableElement;\n\n\tprivate readonly _elements;\n\n\tprivate readonly _sizeObserver;\n\n\tprivate readonly _objectPool;\n\n\tpublic readonly scrollTop;\n\tpublic readonly scrollLeft;\n\n\tprivate readonly _viewItemsInfo;\n\n\tprivate readonly _viewItems;\n\n\tprivate readonly _spaceBetweenPx;\n\n\tprivate readonly _totalHeight;\n\tpublic readonly activeControl;\n\n\tprivate readonly _contextKeyService;\n\tprivate readonly _instantiationService;\n\n\tconstructor(\n\t\tprivate readonly _element: HTMLElement,\n\t\tprivate readonly _dimension: IObservable<Dimension | undefined>,\n\t\tprivate readonly _viewModel: IObservable<MultiDiffEditorViewModel | undefined>,\n\t\tprivate readonly _workbenchUIElementFactory: IWorkbenchUIElementFactory,\n\t\t@IContextKeyService private readonly _parentContextKeyService: IContextKeyService,\n\t\t@IInstantiationService private readonly _parentInstantiationService: IInstantiationService,\n\t) {\n\t\tsuper();\n\t\tthis._scrollableElements = h('div.scrollContent', [\n\t\t\th('div@content', {\n\t\t\t\tstyle: {\n\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t}\n\t\t\t}),\n\t\t\th('div.monaco-editor@overflowWidgetsDomNode', {\n\t\t\t}),\n\t\t]);\n\t\tthis._scrollable = this._register(new Scrollable({\n\t\t\tforceIntegerValues: false,\n\t\t\tscheduleAtNextAnimationFrame: (cb) => scheduleAtNextAnimationFrame(getWindow(this._element), cb),\n\t\t\tsmoothScrollDuration: 100,\n\t\t}));\n\t\tthis._scrollableElement = this._register(new SmoothScrollableElement(this._scrollableElements.root, {\n\t\t\tvertical: ScrollbarVisibility.Auto,\n\t\t\thorizontal: ScrollbarVisibility.Auto,\n\t\t\tuseShadows: false,\n\t\t}, this._scrollable));\n\t\tthis._elements = h('div.monaco-component.multiDiffEditor', {}, [\n\t\t\th('div', {}, [this._scrollableElement.getDomNode()]),\n\t\t\th('div.placeholder@placeholder', {}, [h('div')]),\n\t\t]);\n\t\tthis._sizeObserver = this._register(new ObservableElementSizeObserver(this._element, undefined));\n\t\tthis._objectPool = this._register(new ObjectPool<TemplateData, DiffEditorItemTemplate>((data) => {\n\t\t\tconst template = this._instantiationService.createInstance(\n\t\t\t\tDiffEditorItemTemplate,\n\t\t\t\tthis._scrollableElements.content,\n\t\t\t\tthis._scrollableElements.overflowWidgetsDomNode,\n\t\t\t\tthis._workbenchUIElementFactory\n\t\t\t);\n\t\t\ttemplate.setData(data);\n\t\t\treturn template;\n\t\t}));\n\t\tthis.scrollTop = observableFromEvent(this, this._scrollableElement.onScroll, () => /** @description scrollTop */ this._scrollableElement.getScrollPosition().scrollTop);\n\t\tthis.scrollLeft = observableFromEvent(this, this._scrollableElement.onScroll, () => /** @description scrollLeft */ this._scrollableElement.getScrollPosition().scrollLeft);\n\t\tthis._viewItemsInfo = derived<{ items: readonly VirtualizedViewItem[]; getItem: (viewModel: DocumentDiffItemViewModel) => VirtualizedViewItem }>(this,\n\t\t\t(reader) => {\n\t\t\t\tconst vm = this._viewModel.read(reader);\n\t\t\t\tif (!vm) {\n\t\t\t\t\treturn { items: [], getItem: _d => { throw new BugIndicatingError(); } };\n\t\t\t\t}\n\t\t\t\tconst viewModels = vm.items.read(reader);\n\t\t\t\tconst map = new Map<DocumentDiffItemViewModel, VirtualizedViewItem>();\n\t\t\t\tconst items = viewModels.map(d => {\n\t\t\t\t\tconst item = reader.store.add(new VirtualizedViewItem(d, this._objectPool, this.scrollLeft, delta => {\n\t\t\t\t\t\tthis._scrollableElement.setScrollPosition({ scrollTop: this._scrollableElement.getScrollPosition().scrollTop + delta });\n\t\t\t\t\t}));\n\t\t\t\t\tconst data = this._lastDocStates?.[item.getKey()];\n\t\t\t\t\tif (data) {\n\t\t\t\t\t\ttransaction(tx => {\n\t\t\t\t\t\t\titem.setViewState(data, tx);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tmap.set(d, item);\n\t\t\t\t\treturn item;\n\t\t\t\t});\n\t\t\t\treturn { items, getItem: d => map.get(d)! };\n\t\t\t}\n\t\t);\n\t\tthis._viewItems = this._viewItemsInfo.map(this, items => items.items);\n\t\tthis._spaceBetweenPx = 0;\n\t\tthis._totalHeight = this._viewItems.map(this, (items, reader) => items.reduce((r, i) => r + i.contentHeight.read(reader) + this._spaceBetweenPx, 0));\n\t\tthis.activeControl = derived(this, reader => {\n\t\t\tconst activeDiffItem = this._viewModel.read(reader)?.activeDiffItem.read(reader);\n\t\t\tif (!activeDiffItem) { return undefined; }\n\t\t\tconst viewItem = this._viewItemsInfo.read(reader).getItem(activeDiffItem);\n\t\t\treturn viewItem.template.read(reader)?.editor;\n\t\t});\n\t\tthis._contextKeyService = this._register(this._parentContextKeyService.createScoped(this._element));\n\t\tthis._instantiationService = this._register(this._parentInstantiationService.createChild(\n\t\t\tnew ServiceCollection([IContextKeyService, this._contextKeyService])\n\t\t));\n\n\t\tthis._contextKeyService.createKey(EditorContextKeys.inMultiDiffEditor.key, true);\n\n\t\tthis._lastDocStates = {};\n\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\tconst viewModel = this._viewModel.read(reader);\n\t\t\tif (viewModel && viewModel.contextKeys) {\n\t\t\t\tfor (const [key, value] of Object.entries(viewModel.contextKeys)) {\n\t\t\t\t\tconst contextKey = this._contextKeyService.createKey<ContextKeyValue>(key, undefined);\n\t\t\t\t\tcontextKey.set(value);\n\t\t\t\t\tstore.add(toDisposable(() => contextKey.reset()));\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tconst ctxAllCollapsed = this._parentContextKeyService.createKey<boolean>(EditorContextKeys.multiDiffEditorAllCollapsed.key, false);\n\t\tthis._register(autorun((reader) => {\n\t\t\tconst viewModel = this._viewModel.read(reader);\n\t\t\tif (viewModel) {\n\t\t\t\tconst allCollapsed = viewModel.items.read(reader).every(item => item.collapsed.read(reader));\n\t\t\t\tctxAllCollapsed.set(allCollapsed);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun((reader) => {\n\t\t\t/** @description Update widget dimension */\n\t\t\tconst dimension = this._dimension.read(reader);\n\t\t\tthis._sizeObserver.observe(dimension);\n\t\t}));\n\n\t\tconst placeholderMessage = derived(reader => {\n\t\t\tconst items = this._viewItems.read(reader);\n\t\t\tif (items.length > 0) { return undefined; }\n\n\t\t\tconst vm = this._viewModel.read(reader);\n\t\t\treturn (!vm || vm.isLoading.read(reader))\n\t\t\t\t? localize('loading', 'Loading...')\n\t\t\t\t: localize('noChangedFiles', 'No Changed Files');\n\t\t});\n\n\t\tthis._register(autorun((reader) => {\n\t\t\tconst message = placeholderMessage.read(reader);\n\t\t\tthis._elements.placeholder.innerText = message ?? '';\n\t\t\tthis._elements.placeholder.classList.toggle('visible', !!message);\n\t\t}));\n\n\t\tthis._scrollableElements.content.style.position = 'relative';\n\n\t\tthis._register(autorun((reader) => {\n\t\t\t/** @description Update scroll dimensions */\n\t\t\tconst height = this._sizeObserver.height.read(reader);\n\t\t\tthis._scrollableElements.root.style.height = `${height}px`;\n\t\t\tconst totalHeight = this._totalHeight.read(reader);\n\t\t\tthis._scrollableElements.content.style.height = `${totalHeight}px`;\n\n\t\t\tconst width = this._sizeObserver.width.read(reader);\n\n\t\t\tlet scrollWidth = width;\n\t\t\tconst viewItems = this._viewItems.read(reader);\n\t\t\tconst max = findFirstMax(viewItems, compareBy(i => i.maxScroll.read(reader).maxScroll, numberComparator));\n\t\t\tif (max) {\n\t\t\t\tconst maxScroll = max.maxScroll.read(reader);\n\t\t\t\tscrollWidth = width + maxScroll.maxScroll;\n\t\t\t}\n\n\t\t\tthis._scrollableElement.setScrollDimensions({\n\t\t\t\twidth: width,\n\t\t\t\theight: height,\n\t\t\t\tscrollHeight: totalHeight,\n\t\t\t\tscrollWidth,\n\t\t\t});\n\t\t}));\n\n\t\t_element.replaceChildren(this._elements.root);\n\t\tthis._register(toDisposable(() => {\n\t\t\t_element.replaceChildren();\n\t\t}));\n\n\t\t// Automatically select the first change in the first file when items are loaded\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description Initialize first change */\n\t\t\tconst viewModel = this._viewModel.read(reader);\n\t\t\tif (!viewModel) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Only initialize when loading is complete\n\t\t\tif (!viewModel.isLoading.read(reader)) {\n\t\t\t\tconst items = viewModel.items.read(reader);\n\t\t\t\tif (items.length === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Only initialize if there's no active item yet\n\t\t\t\tconst activeDiffItem = viewModel.activeDiffItem.read(reader);\n\t\t\t\tif (activeDiffItem) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Navigate to the first change using the existing navigation logic\n\t\t\t\tthis.goToNextChange();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this._register(autorun(reader => {\n\t\t\t/** @description Render all */\n\t\t\tglobalTransaction(tx => {\n\t\t\t\tthis.render(reader);\n\t\t\t});\n\t\t})));\n\t}\n\tpublic reveal(resource: IMultiDiffResourceId, options?: RevealOptions): void {\n\t\tconst viewItems = this._viewItems.get();\n\t\tconst index = viewItems.findIndex(\n\t\t\t(item) => item.viewModel.originalUri?.toString() === resource.original?.toString()\n\t\t\t\t&& item.viewModel.modifiedUri?.toString() === resource.modified?.toString()\n\t\t);\n\t\tif (index === -1) {\n\t\t\tthrow new BugIndicatingError('Resource not found in diff editor');\n\t\t}\n\t\tconst viewItem = viewItems[index];\n\t\tthis._viewModel.get()!.activeDiffItem.setCache(viewItem.viewModel, undefined);\n\n\t\tlet scrollTop = 0;\n\t\tfor (let i = 0; i < index; i++) {\n\t\t\tscrollTop += viewItems[i].contentHeight.get() + this._spaceBetweenPx;\n\t\t}\n\t\tthis._scrollableElement.setScrollPosition({ scrollTop });\n\n\t\tconst diffEditor = viewItem.template.get()?.editor;\n\t\tconst editor = 'original' in resource ? diffEditor?.getOriginalEditor() : diffEditor?.getModifiedEditor();\n\t\tif (editor && options?.range) {\n\t\t\teditor.revealRangeInCenter(options.range);\n\t\t\thighlightRange(editor, options.range);\n\t\t}\n\t}\n\n\t/** This accounts for documents that are not loaded yet. */\n\tprivate _lastDocStates: IMultiDiffEditorViewState['docStates'];\n\n\tpublic goToNextChange(): void {\n\t\tthis._navigateToChange('next');\n\t}\n\n\tprivate _navigateToChange(direction: 'next' | 'previous'): void {\n\t\tconst viewItems = this._viewItems.get();\n\t\tif (viewItems.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst activeViewModel = this._viewModel.get()?.activeDiffItem.get();\n\t\tconst currentIndex = activeViewModel ? viewItems.findIndex(v => v.viewModel === activeViewModel) : -1;\n\n\t\t// Start with first file if no active item\n\t\tif (currentIndex === -1) {\n\t\t\tthis._goToFile(0, 'first');\n\t\t\treturn;\n\t\t}\n\n\t\t// Try current file first - expand if collapsed\n\t\tconst currentItem = viewItems[currentIndex];\n\t\tif (currentItem.viewModel.collapsed.get()) {\n\t\t\tcurrentItem.viewModel.collapsed.set(false, undefined);\n\t\t}\n\n\t\tconst editor = currentItem.template.get()?.editor;\n\t\tif (editor?.getDiffComputationResult()?.changes2?.length) {\n\t\t\tconst pos = editor.getModifiedEditor().getPosition()?.lineNumber || 1;\n\t\t\tconst changes = editor.getDiffComputationResult()!.changes2!;\n\t\t\tconst hasNext = direction === 'next' ? changes.some(c => c.modified.startLineNumber > pos) : changes.some(c => c.modified.endLineNumberExclusive <= pos);\n\n\t\t\tif (hasNext) {\n\t\t\t\teditor.goToDiff(direction);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Move to next/previous file\n\t\tconst nextIndex = (currentIndex + (direction === 'next' ? 1 : -1) + viewItems.length) % viewItems.length;\n\t\tthis._goToFile(nextIndex, direction === 'next' ? 'first' : 'last');\n\t}\n\n\tprivate _goToFile(index: number, position: 'first' | 'last'): void {\n\t\tconst item = this._viewItems.get()[index];\n\t\tif (item.viewModel.collapsed.get()) {\n\t\t\titem.viewModel.collapsed.set(false, undefined);\n\t\t}\n\n\t\tthis.reveal({ original: item.viewModel.originalUri, modified: item.viewModel.modifiedUri });\n\n\t\tconst editor = item.template.get()?.editor;\n\t\tif (editor?.getDiffComputationResult()?.changes2?.length) {\n\t\t\tif (position === 'first') {\n\t\t\t\teditor.revealFirstDiff();\n\t\t\t} else {\n\t\t\t\tconst lastChange = editor.getDiffComputationResult()!.changes2!.at(-1)!;\n\t\t\t\tconst modifiedEditor = editor.getModifiedEditor();\n\t\t\t\tmodifiedEditor.setPosition({ lineNumber: lastChange.modified.startLineNumber, column: 1 });\n\t\t\t\tmodifiedEditor.revealLineInCenter(lastChange.modified.startLineNumber);\n\t\t\t}\n\t\t}\n\t\teditor?.focus();\n\t}\n\n\tprivate render(reader: IReader | undefined) {\n\t\tconst scrollTop = this.scrollTop.read(reader);\n\t\tlet contentScrollOffsetToScrollOffset = 0;\n\t\tlet itemHeightSumBefore = 0;\n\t\tlet itemContentHeightSumBefore = 0;\n\t\tconst viewPortHeight = this._sizeObserver.height.read(reader);\n\t\tconst contentViewPort = OffsetRange.ofStartAndLength(scrollTop, viewPortHeight);\n\n\t\tconst width = this._sizeObserver.width.read(reader);\n\n\t\tfor (const v of this._viewItems.read(reader)) {\n\t\t\tconst itemContentHeight = v.contentHeight.read(reader);\n\t\t\tconst itemHeight = Math.min(itemContentHeight, viewPortHeight);\n\t\t\tconst itemRange = OffsetRange.ofStartAndLength(itemHeightSumBefore, itemHeight);\n\t\t\tconst itemContentRange = OffsetRange.ofStartAndLength(itemContentHeightSumBefore, itemContentHeight);\n\n\t\t\tif (itemContentRange.isBefore(contentViewPort)) {\n\t\t\t\tcontentScrollOffsetToScrollOffset -= itemContentHeight - itemHeight;\n\t\t\t\tv.hide();\n\t\t\t} else if (itemContentRange.isAfter(contentViewPort)) {\n\t\t\t\tv.hide();\n\t\t\t} else {\n\t\t\t\tconst scroll = Math.max(0, Math.min(contentViewPort.start - itemContentRange.start, itemContentHeight - itemHeight));\n\t\t\t\tcontentScrollOffsetToScrollOffset -= scroll;\n\t\t\t\tconst viewPort = OffsetRange.ofStartAndLength(scrollTop + contentScrollOffsetToScrollOffset, viewPortHeight);\n\t\t\t\tv.render(itemRange, scroll, width, viewPort);\n\t\t\t}\n\n\t\t\titemHeightSumBefore += itemHeight + this._spaceBetweenPx;\n\t\t\titemContentHeightSumBefore += itemContentHeight + this._spaceBetweenPx;\n\t\t}\n\n\t\tthis._scrollableElements.content.style.transform = `translateY(${-(scrollTop + contentScrollOffsetToScrollOffset)}px)`;\n\t}\n}\n\nfunction highlightRange(targetEditor: ICodeEditor, range: IRange) {\n\tconst modelNow = targetEditor.getModel();\n\tconst decorations = targetEditor.createDecorationsCollection([{ range, options: { description: 'symbol-navigate-action-highlight', className: 'symbolHighlight' } }]);\n\tsetTimeout(() => {\n\t\tif (targetEditor.getModel() === modelNow) {\n\t\t\tdecorations.clear();\n\t\t}\n\t}, 350);\n}\n\nexport interface IMultiDiffEditorViewState {\n\tdocStates?: Record<string, IMultiDiffDocState>;\n}\n\ninterface IMultiDiffDocState {\n\tcollapsed: boolean;\n\tselections?: ISelection[];\n}\n\nexport type IMultiDiffResourceId = { original: URI | undefined; modified: URI | undefined };\n\nclass VirtualizedViewItem extends Disposable {\n\tprivate readonly _templateRef = this._register(disposableObservableValue<IReference<DiffEditorItemTemplate> | undefined>(this, undefined));\n\n\tpublic readonly contentHeight = derived(this, reader =>\n\t\tthis._templateRef.read(reader)?.object.contentHeight?.read(reader) ?? this.viewModel.lastTemplateData.read(reader).contentHeight\n\t);\n\n\tpublic readonly maxScroll = derived(this, reader => this._templateRef.read(reader)?.object.maxScroll.read(reader) ?? { maxScroll: 0, scrollWidth: 0 });\n\n\tpublic readonly template = derived(this, reader => this._templateRef.read(reader)?.object);\n\tprivate _isHidden = observableValue(this, false);\n\n\tprivate readonly _isFocused = derived(this, reader => this.template.read(reader)?.isFocused.read(reader) ?? false);\n\n\tconstructor(\n\t\tpublic readonly viewModel: DocumentDiffItemViewModel,\n\t\tprivate readonly _objectPool: ObjectPool<TemplateData, DiffEditorItemTemplate>,\n\t\tprivate readonly _scrollLeft: IObservable<number>,\n\t\tprivate readonly _deltaScrollVertical: (delta: number) => void,\n\t) {\n\t\tsuper();\n\n\t\tthis.viewModel.setIsFocused(this._isFocused, undefined);\n\n\t\tthis._register(autorun((reader) => {\n\t\t\tconst scrollLeft = this._scrollLeft.read(reader);\n\t\t\tthis._templateRef.read(reader)?.object.setScrollLeft(scrollLeft);\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst ref = this._templateRef.read(reader);\n\t\t\tif (!ref) { return; }\n\t\t\tconst isHidden = this._isHidden.read(reader);\n\t\t\tif (!isHidden) { return; }\n\n\t\t\tconst isFocused = ref.object.isFocused.read(reader);\n\t\t\tif (isFocused) { return; }\n\n\t\t\tthis._clear();\n\t\t}));\n\t}\n\n\toverride dispose(): void {\n\t\tthis._clear();\n\t\tsuper.dispose();\n\t}\n\n\tpublic override toString(): string {\n\t\treturn `VirtualViewItem(${this.viewModel.documentDiffItem.modified?.uri.toString()})`;\n\t}\n\n\tpublic getKey(): string {\n\t\treturn this.viewModel.getKey();\n\t}\n\n\tpublic setViewState(viewState: IMultiDiffDocState, tx: ITransaction): void {\n\t\tthis.viewModel.collapsed.set(viewState.collapsed, tx);\n\n\t\tthis._updateTemplateData(tx);\n\t\tconst data = this.viewModel.lastTemplateData.get();\n\t\tconst selections = viewState.selections?.map(Selection.liftSelection);\n\t\tthis.viewModel.lastTemplateData.set({\n\t\t\t...data,\n\t\t\tselections,\n\t\t}, tx);\n\t\tconst ref = this._templateRef.get();\n\t\tif (ref) {\n\t\t\tif (selections) {\n\t\t\t\tref.object.editor.setSelections(selections);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _updateTemplateData(tx: ITransaction): void {\n\t\tconst ref = this._templateRef.get();\n\t\tif (!ref) { return; }\n\t\tthis.viewModel.lastTemplateData.set({\n\t\t\tcontentHeight: ref.object.contentHeight.get(),\n\t\t\tselections: ref.object.editor.getSelections() ?? undefined,\n\t\t}, tx);\n\t}\n\n\tprivate _clear(): void {\n\t\tconst ref = this._templateRef.get();\n\t\tif (!ref) { return; }\n\t\ttransaction(tx => {\n\t\t\tthis._updateTemplateData(tx);\n\t\t\tref.object.hide();\n\t\t\tthis._templateRef.set(undefined, tx);\n\t\t});\n\t}\n\n\tpublic hide(): void {\n\t\tthis._isHidden.set(true, undefined);\n\t}\n\n\tpublic render(verticalSpace: OffsetRange, offset: number, width: number, viewPort: OffsetRange): void {\n\t\tthis._isHidden.set(false, undefined);\n\n\t\tlet ref = this._templateRef.get();\n\t\tif (!ref) {\n\t\t\tref = this._objectPool.getUnusedObj(new TemplateData(this.viewModel, this._deltaScrollVertical));\n\t\t\tthis._templateRef.set(ref, undefined);\n\n\t\t\tconst selections = this.viewModel.lastTemplateData.get().selections;\n\t\t\tif (selections) {\n\t\t\t\tref.object.editor.setSelections(selections);\n\t\t\t}\n\t\t}\n\t\tref.object.render(verticalSpace, width, offset, viewPort);\n\t}\n}\n"]}
@@ -99,7 +99,6 @@ let ColorDetector = class ColorDetector extends Disposable {
99
99
  updateColors() {
100
100
  this.stop();
101
101
  if (!this._isColorDecoratorsEnabled) {
102
- this.removeAllDecorations();
103
102
  return;
104
103
  }
105
104
  const model = this._editor.getModel();
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/colorPicker/browser/colorDetector.ts","vs/editor/contrib/colorPicker/browser/colorDetector.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAqB,uBAAuB,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAC5G,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,E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AA,+BAA+B,CAAA;GA3BrB,aAAa,CA+OzB;;AAED,MAAM,OAAO,sBAAuB,SAAQ,UAAU;IAAtD;;QACS,iBAAY,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,OAAO,EAAQ,CAAC,CAAC;QAEnD,cAAS,GAAW,CAAC,CAAC;QACtB,aAAQ,GAAmB,KAAK,CAAC;IAQ1C,CAAC;IAPO,MAAM,CAAC,QAAgB,EAAE,OAAuB;QACtD,IAAI,QAAQ,KAAK,IAAI,CAAC,SAAS,IAAI,OAAO,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC9D,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;YAC1B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YACxB,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;QAC1B,CAAC;IACF,CAAC;CACD","file":"colorDetector.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 { CancelablePromise, createCancelablePromise, TimeoutTimer } from '../../../../base/common/async.js';\nimport { RGBA } from '../../../../base/common/color.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { StopWatch } from '../../../../base/common/stopwatch.js';\nimport { noBreakWhitespace } from '../../../../base/common/strings.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { DynamicCssRules } from '../../../browser/editorDom.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { IEditorContribution, IEditorDecorationsCollection } from '../../../common/editorCommon.js';\nimport { IModelDecoration, IModelDeltaDecoration } from '../../../common/model.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { getColors, IColorData } from './color.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\n\nexport const ColorDecorationInjectedTextMarker = Object.create({});\n\n\nexport class ColorDetector extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID: string = 'editor.contrib.colorDetector';\n\n\tstatic readonly RECOMPUTE_TIME = 1000; // ms\n\n\tprivate readonly _localToDispose = this._register(new DisposableStore());\n\tprivate _computePromise: CancelablePromise<IColorData[]> | null;\n\tprivate _timeoutTimer: TimeoutTimer | null;\n\tprivate _debounceInformation: IFeatureDebounceInformation;\n\n\tprivate _decorationsIds: string[] = [];\n\tprivate _colorDatas = new Map<string, IColorData>();\n\n\tprivate readonly _colorDecoratorIds: IEditorDecorationsCollection;\n\n\tprivate _isColorDecoratorsEnabled: boolean;\n\tprivate _defaultColorDecoratorsEnablement: 'auto' | 'always' | 'never';\n\n\tprivate readonly _ruleFactory: DynamicCssRules;\n\n\tprivate readonly _decoratorLimitReporter = this._register(new DecoratorLimitReporter());\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService languageFeatureDebounceService: ILanguageFeatureDebounceService,\n\t) {\n\t\tsuper();\n\t\tthis._colorDecoratorIds = this._editor.createDecorationsCollection();\n\t\tthis._ruleFactory = this._register(new DynamicCssRules(this._editor));\n\t\tthis._debounceInformation = languageFeatureDebounceService.for(_languageFeaturesService.colorProvider, 'Document Colors', { min: ColorDetector.RECOMPUTE_TIME });\n\t\tthis._register(_editor.onDidChangeModel(() => {\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis.updateColors();\n\t\t}));\n\t\tthis._register(_editor.onDidChangeModelLanguage(() => this.updateColors()));\n\t\tthis._register(_languageFeaturesService.colorProvider.onDidChange(() => this.updateColors()));\n\t\tthis._register(_editor.onDidChangeConfiguration((e) => {\n\t\t\tconst prevIsEnabled = this._isColorDecoratorsEnabled;\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\t\tconst updatedColorDecoratorsSetting = prevIsEnabled !== this._isColorDecoratorsEnabled || e.hasChanged(EditorOption.colorDecoratorsLimit);\n\t\t\tconst updatedDefaultColorDecoratorsSetting = e.hasChanged(EditorOption.defaultColorDecorators);\n\t\t\tif (updatedColorDecoratorsSetting || updatedDefaultColorDecoratorsSetting) {\n\t\t\t\tif (this._isColorDecoratorsEnabled) {\n\t\t\t\t\tthis.updateColors();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.removeAllDecorations();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._timeoutTimer = null;\n\t\tthis._computePromise = null;\n\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\tthis.updateColors();\n\t}\n\n\tisEnabled(): boolean {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn false;\n\t\t}\n\t\tconst languageId = model.getLanguageId();\n\t\t// handle deprecated settings. [languageId].colorDecorators.enable\n\t\tconst deprecatedConfig = this._configurationService.getValue(languageId);\n\t\tif (deprecatedConfig && typeof deprecatedConfig === 'object') {\n\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\tconst colorDecorators = (deprecatedConfig as any)['colorDecorators']; // deprecatedConfig.valueOf('.colorDecorators.enable');\n\t\t\tif (colorDecorators && colorDecorators['enable'] !== undefined && !colorDecorators['enable']) {\n\t\t\t\treturn colorDecorators['enable'];\n\t\t\t}\n\t\t}\n\n\t\treturn this._editor.getOption(EditorOption.colorDecorators);\n\t}\n\n\tstatic get(editor: ICodeEditor): ColorDetector | null {\n\t\treturn editor.getContribution<ColorDetector>(this.ID);\n\t}\n\n\toverride dispose(): void {\n\t\tthis.stop();\n\t\tthis.removeAllDecorations();\n\t\tsuper.dispose();\n\t}\n\n\tprivate updateColors(): void {\n\t\tthis.stop();\n\n\t\tif (!this._isColorDecoratorsEnabled) {\n\t\t\tthis.removeAllDecorations();\n\t\t\treturn;\n\t\t}\n\t\tconst model = this._editor.getModel();\n\n\t\tif (!model || !this._languageFeaturesService.colorProvider.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._localToDispose.add(this._editor.onDidChangeModelContent(() => {\n\t\t\tif (!this._timeoutTimer) {\n\t\t\t\tthis._timeoutTimer = new TimeoutTimer();\n\t\t\t\tthis._timeoutTimer.cancelAndSet(() => {\n\t\t\t\t\tthis._timeoutTimer = null;\n\t\t\t\t\tthis.beginCompute();\n\t\t\t\t}, this._debounceInformation.get(model));\n\t\t\t}\n\t\t}));\n\t\tthis.beginCompute();\n\t}\n\n\tprivate async beginCompute(): Promise<void> {\n\t\tthis._computePromise = createCancelablePromise(async token => {\n\t\t\tconst model = this._editor.getModel();\n\t\t\tif (!model) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst sw = new StopWatch(false);\n\t\t\tconst colors = await getColors(this._languageFeaturesService.colorProvider, model, token, this._defaultColorDecoratorsEnablement);\n\t\t\tthis._debounceInformation.update(model, sw.elapsed());\n\t\t\treturn colors;\n\t\t});\n\t\ttry {\n\t\t\tconst colors = await this._computePromise;\n\t\t\tthis.updateDecorations(colors);\n\t\t\tthis.updateColorDecorators(colors);\n\t\t\tthis._computePromise = null;\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t}\n\t}\n\n\tprivate stop(): void {\n\t\tif (this._timeoutTimer) {\n\t\t\tthis._timeoutTimer.cancel();\n\t\t\tthis._timeoutTimer = null;\n\t\t}\n\t\tif (this._computePromise) {\n\t\t\tthis._computePromise.cancel();\n\t\t\tthis._computePromise = null;\n\t\t}\n\t\tthis._localToDispose.clear();\n\t}\n\n\tprivate updateDecorations(colorDatas: IColorData[]): void {\n\t\tconst decorations = colorDatas.map(c => ({\n\t\t\trange: {\n\t\t\t\tstartLineNumber: c.colorInfo.range.startLineNumber,\n\t\t\t\tstartColumn: c.colorInfo.range.startColumn,\n\t\t\t\tendLineNumber: c.colorInfo.range.endLineNumber,\n\t\t\t\tendColumn: c.colorInfo.range.endColumn\n\t\t\t},\n\t\t\toptions: ModelDecorationOptions.EMPTY\n\t\t}));\n\n\t\tthis._editor.changeDecorations((changeAccessor) => {\n\t\t\tthis._decorationsIds = changeAccessor.deltaDecorations(this._decorationsIds, decorations);\n\n\t\t\tthis._colorDatas = new Map<string, IColorData>();\n\t\t\tthis._decorationsIds.forEach((id, i) => this._colorDatas.set(id, colorDatas[i]));\n\t\t});\n\t}\n\n\tprivate readonly _colorDecorationClassRefs = this._register(new DisposableStore());\n\n\tprivate updateColorDecorators(colorData: IColorData[]): void {\n\t\tthis._colorDecorationClassRefs.clear();\n\n\t\tconst decorations: IModelDeltaDecoration[] = [];\n\n\t\tconst limit = this._editor.getOption(EditorOption.colorDecoratorsLimit);\n\n\t\tfor (let i = 0; i < colorData.length && decorations.length < limit; i++) {\n\t\t\tconst { red, green, blue, alpha } = colorData[i].colorInfo.color;\n\t\t\tconst rgba = new RGBA(Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255), alpha);\n\t\t\tconst color = `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`;\n\n\t\t\tconst ref = this._colorDecorationClassRefs.add(\n\t\t\t\tthis._ruleFactory.createClassNameRef({\n\t\t\t\t\tbackgroundColor: color\n\t\t\t\t})\n\t\t\t);\n\n\t\t\tdecorations.push({\n\t\t\t\trange: {\n\t\t\t\t\tstartLineNumber: colorData[i].colorInfo.range.startLineNumber,\n\t\t\t\t\tstartColumn: colorData[i].colorInfo.range.startColumn,\n\t\t\t\t\tendLineNumber: colorData[i].colorInfo.range.endLineNumber,\n\t\t\t\t\tendColumn: colorData[i].colorInfo.range.endColumn\n\t\t\t\t},\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'colorDetector',\n\t\t\t\t\tbefore: {\n\t\t\t\t\t\tcontent: noBreakWhitespace,\n\t\t\t\t\t\tinlineClassName: `${ref.className} colorpicker-color-decoration`,\n\t\t\t\t\t\tinlineClassNameAffectsLetterSpacing: true,\n\t\t\t\t\t\tattachedData: ColorDecorationInjectedTextMarker\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tconst limited = limit < colorData.length ? limit : false;\n\t\tthis._decoratorLimitReporter.update(colorData.length, limited);\n\n\t\tthis._colorDecoratorIds.set(decorations);\n\t}\n\n\tprivate removeAllDecorations(): void {\n\t\tthis._editor.removeDecorations(this._decorationsIds);\n\t\tthis._decorationsIds = [];\n\t\tthis._colorDecoratorIds.clear();\n\t\tthis._colorDecorationClassRefs.clear();\n\t}\n\n\tgetColorData(position: Position): IColorData | null {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst decorations = model\n\t\t\t.getDecorationsInRange(Range.fromPositions(position, position))\n\t\t\t.filter(d => this._colorDatas.has(d.id));\n\n\t\tif (decorations.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this._colorDatas.get(decorations[0].id)!;\n\t}\n\n\tisColorDecoration(decoration: IModelDecoration): boolean {\n\t\treturn this._colorDecoratorIds.has(decoration);\n\t}\n}\n\nexport class DecoratorLimitReporter extends Disposable {\n\tprivate _onDidChange = this._register(new Emitter<void>());\n\n\tprivate _computed: number = 0;\n\tprivate _limited: number | false = false;\n\tpublic update(computed: number, limited: number | false) {\n\t\tif (computed !== this._computed || limited !== this._limited) {\n\t\t\tthis._computed = computed;\n\t\t\tthis._limited = limited;\n\t\t\tthis._onDidChange.fire();\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 { CancelablePromise, createCancelablePromise, TimeoutTimer } from '../../../../base/common/async.js';\nimport { RGBA } from '../../../../base/common/color.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { StopWatch } from '../../../../base/common/stopwatch.js';\nimport { noBreakWhitespace } from '../../../../base/common/strings.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { DynamicCssRules } from '../../../browser/editorDom.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { IEditorContribution, IEditorDecorationsCollection } from '../../../common/editorCommon.js';\nimport { IModelDecoration, IModelDeltaDecoration } from '../../../common/model.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { getColors, IColorData } from './color.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\n\nexport const ColorDecorationInjectedTextMarker = Object.create({});\n\n\nexport class ColorDetector extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID: string = 'editor.contrib.colorDetector';\n\n\tstatic readonly RECOMPUTE_TIME = 1000; // ms\n\n\tprivate readonly _localToDispose = this._register(new DisposableStore());\n\tprivate _computePromise: CancelablePromise<IColorData[]> | null;\n\tprivate _timeoutTimer: TimeoutTimer | null;\n\tprivate _debounceInformation: IFeatureDebounceInformation;\n\n\tprivate _decorationsIds: string[] = [];\n\tprivate _colorDatas = new Map<string, IColorData>();\n\n\tprivate readonly _colorDecoratorIds: IEditorDecorationsCollection;\n\n\tprivate _isColorDecoratorsEnabled: boolean;\n\tprivate _defaultColorDecoratorsEnablement: 'auto' | 'always' | 'never';\n\n\tprivate readonly _ruleFactory: DynamicCssRules;\n\n\tprivate readonly _decoratorLimitReporter = this._register(new DecoratorLimitReporter());\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService languageFeatureDebounceService: ILanguageFeatureDebounceService,\n\t) {\n\t\tsuper();\n\t\tthis._colorDecoratorIds = this._editor.createDecorationsCollection();\n\t\tthis._ruleFactory = this._register(new DynamicCssRules(this._editor));\n\t\tthis._debounceInformation = languageFeatureDebounceService.for(_languageFeaturesService.colorProvider, 'Document Colors', { min: ColorDetector.RECOMPUTE_TIME });\n\t\tthis._register(_editor.onDidChangeModel(() => {\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis.updateColors();\n\t\t}));\n\t\tthis._register(_editor.onDidChangeModelLanguage(() => this.updateColors()));\n\t\tthis._register(_languageFeaturesService.colorProvider.onDidChange(() => this.updateColors()));\n\t\tthis._register(_editor.onDidChangeConfiguration((e) => {\n\t\t\tconst prevIsEnabled = this._isColorDecoratorsEnabled;\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\t\tconst updatedColorDecoratorsSetting = prevIsEnabled !== this._isColorDecoratorsEnabled || e.hasChanged(EditorOption.colorDecoratorsLimit);\n\t\t\tconst updatedDefaultColorDecoratorsSetting = e.hasChanged(EditorOption.defaultColorDecorators);\n\t\t\tif (updatedColorDecoratorsSetting || updatedDefaultColorDecoratorsSetting) {\n\t\t\t\tif (this._isColorDecoratorsEnabled) {\n\t\t\t\t\tthis.updateColors();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.removeAllDecorations();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._timeoutTimer = null;\n\t\tthis._computePromise = null;\n\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\tthis.updateColors();\n\t}\n\n\tisEnabled(): boolean {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn false;\n\t\t}\n\t\tconst languageId = model.getLanguageId();\n\t\t// handle deprecated settings. [languageId].colorDecorators.enable\n\t\tconst deprecatedConfig = this._configurationService.getValue(languageId);\n\t\tif (deprecatedConfig && typeof deprecatedConfig === 'object') {\n\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\tconst colorDecorators = (deprecatedConfig as any)['colorDecorators']; // deprecatedConfig.valueOf('.colorDecorators.enable');\n\t\t\tif (colorDecorators && colorDecorators['enable'] !== undefined && !colorDecorators['enable']) {\n\t\t\t\treturn colorDecorators['enable'];\n\t\t\t}\n\t\t}\n\n\t\treturn this._editor.getOption(EditorOption.colorDecorators);\n\t}\n\n\tstatic get(editor: ICodeEditor): ColorDetector | null {\n\t\treturn editor.getContribution<ColorDetector>(this.ID);\n\t}\n\n\toverride dispose(): void {\n\t\tthis.stop();\n\t\tthis.removeAllDecorations();\n\t\tsuper.dispose();\n\t}\n\n\tprivate updateColors(): void {\n\t\tthis.stop();\n\n\t\tif (!this._isColorDecoratorsEnabled) {\n\t\t\tthis.removeAllDecorations();\n\t\t\treturn;\n\t\t}\n\t\tconst model = this._editor.getModel();\n\n\t\tif (!model || !this._languageFeaturesService.colorProvider.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._localToDispose.add(this._editor.onDidChangeModelContent(() => {\n\t\t\tif (!this._timeoutTimer) {\n\t\t\t\tthis._timeoutTimer = new TimeoutTimer();\n\t\t\t\tthis._timeoutTimer.cancelAndSet(() => {\n\t\t\t\t\tthis._timeoutTimer = null;\n\t\t\t\t\tthis.beginCompute();\n\t\t\t\t}, this._debounceInformation.get(model));\n\t\t\t}\n\t\t}));\n\t\tthis.beginCompute();\n\t}\n\n\tprivate async beginCompute(): Promise<void> {\n\t\tthis._computePromise = createCancelablePromise(async token => {\n\t\t\tconst model = this._editor.getModel();\n\t\t\tif (!model) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst sw = new StopWatch(false);\n\t\t\tconst colors = await getColors(this._languageFeaturesService.colorProvider, model, token, this._defaultColorDecoratorsEnablement);\n\t\t\tthis._debounceInformation.update(model, sw.elapsed());\n\t\t\treturn colors;\n\t\t});\n\t\ttry {\n\t\t\tconst colors = await this._computePromise;\n\t\t\tthis.updateDecorations(colors);\n\t\t\tthis.updateColorDecorators(colors);\n\t\t\tthis._computePromise = null;\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t}\n\t}\n\n\tprivate stop(): void {\n\t\tif (this._timeoutTimer) {\n\t\t\tthis._timeoutTimer.cancel();\n\t\t\tthis._timeoutTimer = null;\n\t\t}\n\t\tif (this._computePromise) {\n\t\t\tthis._computePromise.cancel();\n\t\t\tthis._computePromise = null;\n\t\t}\n\t\tthis._localToDispose.clear();\n\t}\n\n\tprivate updateDecorations(colorDatas: IColorData[]): void {\n\t\tconst decorations = colorDatas.map(c => ({\n\t\t\trange: {\n\t\t\t\tstartLineNumber: c.colorInfo.range.startLineNumber,\n\t\t\t\tstartColumn: c.colorInfo.range.startColumn,\n\t\t\t\tendLineNumber: c.colorInfo.range.endLineNumber,\n\t\t\t\tendColumn: c.colorInfo.range.endColumn\n\t\t\t},\n\t\t\toptions: ModelDecorationOptions.EMPTY\n\t\t}));\n\n\t\tthis._editor.changeDecorations((changeAccessor) => {\n\t\t\tthis._decorationsIds = changeAccessor.deltaDecorations(this._decorationsIds, decorations);\n\n\t\t\tthis._colorDatas = new Map<string, IColorData>();\n\t\t\tthis._decorationsIds.forEach((id, i) => this._colorDatas.set(id, colorDatas[i]));\n\t\t});\n\t}\n\n\tprivate readonly _colorDecorationClassRefs = this._register(new DisposableStore());\n\n\tprivate updateColorDecorators(colorData: IColorData[]): void {\n\t\tthis._colorDecorationClassRefs.clear();\n\n\t\tconst decorations: IModelDeltaDecoration[] = [];\n\n\t\tconst limit = this._editor.getOption(EditorOption.colorDecoratorsLimit);\n\n\t\tfor (let i = 0; i < colorData.length && decorations.length < limit; i++) {\n\t\t\tconst { red, green, blue, alpha } = colorData[i].colorInfo.color;\n\t\t\tconst rgba = new RGBA(Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255), alpha);\n\t\t\tconst color = `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`;\n\n\t\t\tconst ref = this._colorDecorationClassRefs.add(\n\t\t\t\tthis._ruleFactory.createClassNameRef({\n\t\t\t\t\tbackgroundColor: color\n\t\t\t\t})\n\t\t\t);\n\n\t\t\tdecorations.push({\n\t\t\t\trange: {\n\t\t\t\t\tstartLineNumber: colorData[i].colorInfo.range.startLineNumber,\n\t\t\t\t\tstartColumn: colorData[i].colorInfo.range.startColumn,\n\t\t\t\t\tendLineNumber: colorData[i].colorInfo.range.endLineNumber,\n\t\t\t\t\tendColumn: colorData[i].colorInfo.range.endColumn\n\t\t\t\t},\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'colorDetector',\n\t\t\t\t\tbefore: {\n\t\t\t\t\t\tcontent: noBreakWhitespace,\n\t\t\t\t\t\tinlineClassName: `${ref.className} colorpicker-color-decoration`,\n\t\t\t\t\t\tinlineClassNameAffectsLetterSpacing: true,\n\t\t\t\t\t\tattachedData: ColorDecorationInjectedTextMarker\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tconst limited = limit < colorData.length ? limit : false;\n\t\tthis._decoratorLimitReporter.update(colorData.length, limited);\n\n\t\tthis._colorDecoratorIds.set(decorations);\n\t}\n\n\tprivate removeAllDecorations(): void {\n\t\tthis._editor.removeDecorations(this._decorationsIds);\n\t\tthis._decorationsIds = [];\n\t\tthis._colorDecoratorIds.clear();\n\t\tthis._colorDecorationClassRefs.clear();\n\t}\n\n\tgetColorData(position: Position): IColorData | null {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst decorations = model\n\t\t\t.getDecorationsInRange(Range.fromPositions(position, position))\n\t\t\t.filter(d => this._colorDatas.has(d.id));\n\n\t\tif (decorations.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this._colorDatas.get(decorations[0].id)!;\n\t}\n\n\tisColorDecoration(decoration: IModelDecoration): boolean {\n\t\treturn this._colorDecoratorIds.has(decoration);\n\t}\n}\n\nexport class DecoratorLimitReporter extends Disposable {\n\tprivate _onDidChange = this._register(new Emitter<void>());\n\n\tprivate _computed: number = 0;\n\tprivate _limited: number | false = false;\n\tpublic update(computed: number, limited: number | false) {\n\t\tif (computed !== this._computed || limited !== this._limited) {\n\t\t\tthis._computed = computed;\n\t\t\tthis._limited = limited;\n\t\t\tthis._onDidChange.fire();\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/colorPicker/browser/colorDetector.ts","vs/editor/contrib/colorPicker/browser/colorDetector.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAqB,uBAAuB,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAC5G,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,sCAA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CAAC,CAAC;QACtB,aAAQ,GAAmB,KAAK,CAAC;IAQ1C,CAAC;IAPO,MAAM,CAAC,QAAgB,EAAE,OAAuB;QACtD,IAAI,QAAQ,KAAK,IAAI,CAAC,SAAS,IAAI,OAAO,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC9D,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;YAC1B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YACxB,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;QAC1B,CAAC;IACF,CAAC;CACD","file":"colorDetector.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 { CancelablePromise, createCancelablePromise, TimeoutTimer } from '../../../../base/common/async.js';\nimport { RGBA } from '../../../../base/common/color.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { StopWatch } from '../../../../base/common/stopwatch.js';\nimport { noBreakWhitespace } from '../../../../base/common/strings.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { DynamicCssRules } from '../../../browser/editorDom.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { IEditorContribution, IEditorDecorationsCollection } from '../../../common/editorCommon.js';\nimport { IModelDecoration, IModelDeltaDecoration } from '../../../common/model.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { getColors, IColorData } from './color.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\n\nexport const ColorDecorationInjectedTextMarker = Object.create({});\n\n\nexport class ColorDetector extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID: string = 'editor.contrib.colorDetector';\n\n\tstatic readonly RECOMPUTE_TIME = 1000; // ms\n\n\tprivate readonly _localToDispose = this._register(new DisposableStore());\n\tprivate _computePromise: CancelablePromise<IColorData[]> | null;\n\tprivate _timeoutTimer: TimeoutTimer | null;\n\tprivate _debounceInformation: IFeatureDebounceInformation;\n\n\tprivate _decorationsIds: string[] = [];\n\tprivate _colorDatas = new Map<string, IColorData>();\n\n\tprivate readonly _colorDecoratorIds: IEditorDecorationsCollection;\n\n\tprivate _isColorDecoratorsEnabled: boolean;\n\tprivate _defaultColorDecoratorsEnablement: 'auto' | 'always' | 'never';\n\n\tprivate readonly _ruleFactory: DynamicCssRules;\n\n\tprivate readonly _decoratorLimitReporter = this._register(new DecoratorLimitReporter());\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService languageFeatureDebounceService: ILanguageFeatureDebounceService,\n\t) {\n\t\tsuper();\n\t\tthis._colorDecoratorIds = this._editor.createDecorationsCollection();\n\t\tthis._ruleFactory = this._register(new DynamicCssRules(this._editor));\n\t\tthis._debounceInformation = languageFeatureDebounceService.for(_languageFeaturesService.colorProvider, 'Document Colors', { min: ColorDetector.RECOMPUTE_TIME });\n\t\tthis._register(_editor.onDidChangeModel(() => {\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis.updateColors();\n\t\t}));\n\t\tthis._register(_editor.onDidChangeModelLanguage(() => this.updateColors()));\n\t\tthis._register(_languageFeaturesService.colorProvider.onDidChange(() => this.updateColors()));\n\t\tthis._register(_editor.onDidChangeConfiguration((e) => {\n\t\t\tconst prevIsEnabled = this._isColorDecoratorsEnabled;\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\t\tconst updatedColorDecoratorsSetting = prevIsEnabled !== this._isColorDecoratorsEnabled || e.hasChanged(EditorOption.colorDecoratorsLimit);\n\t\t\tconst updatedDefaultColorDecoratorsSetting = e.hasChanged(EditorOption.defaultColorDecorators);\n\t\t\tif (updatedColorDecoratorsSetting || updatedDefaultColorDecoratorsSetting) {\n\t\t\t\tif (this._isColorDecoratorsEnabled) {\n\t\t\t\t\tthis.updateColors();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.removeAllDecorations();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._timeoutTimer = null;\n\t\tthis._computePromise = null;\n\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\tthis.updateColors();\n\t}\n\n\tisEnabled(): boolean {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn false;\n\t\t}\n\t\tconst languageId = model.getLanguageId();\n\t\t// handle deprecated settings. [languageId].colorDecorators.enable\n\t\tconst deprecatedConfig = this._configurationService.getValue(languageId);\n\t\tif (deprecatedConfig && typeof deprecatedConfig === 'object') {\n\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\tconst colorDecorators = (deprecatedConfig as any)['colorDecorators']; // deprecatedConfig.valueOf('.colorDecorators.enable');\n\t\t\tif (colorDecorators && colorDecorators['enable'] !== undefined && !colorDecorators['enable']) {\n\t\t\t\treturn colorDecorators['enable'];\n\t\t\t}\n\t\t}\n\n\t\treturn this._editor.getOption(EditorOption.colorDecorators);\n\t}\n\n\tstatic get(editor: ICodeEditor): ColorDetector | null {\n\t\treturn editor.getContribution<ColorDetector>(this.ID);\n\t}\n\n\toverride dispose(): void {\n\t\tthis.stop();\n\t\tthis.removeAllDecorations();\n\t\tsuper.dispose();\n\t}\n\n\tprivate updateColors(): void {\n\t\tthis.stop();\n\n\t\tif (!this._isColorDecoratorsEnabled) {\n\t\t\treturn;\n\t\t}\n\t\tconst model = this._editor.getModel();\n\n\t\tif (!model || !this._languageFeaturesService.colorProvider.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._localToDispose.add(this._editor.onDidChangeModelContent(() => {\n\t\t\tif (!this._timeoutTimer) {\n\t\t\t\tthis._timeoutTimer = new TimeoutTimer();\n\t\t\t\tthis._timeoutTimer.cancelAndSet(() => {\n\t\t\t\t\tthis._timeoutTimer = null;\n\t\t\t\t\tthis.beginCompute();\n\t\t\t\t}, this._debounceInformation.get(model));\n\t\t\t}\n\t\t}));\n\t\tthis.beginCompute();\n\t}\n\n\tprivate async beginCompute(): Promise<void> {\n\t\tthis._computePromise = createCancelablePromise(async token => {\n\t\t\tconst model = this._editor.getModel();\n\t\t\tif (!model) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst sw = new StopWatch(false);\n\t\t\tconst colors = await getColors(this._languageFeaturesService.colorProvider, model, token, this._defaultColorDecoratorsEnablement);\n\t\t\tthis._debounceInformation.update(model, sw.elapsed());\n\t\t\treturn colors;\n\t\t});\n\t\ttry {\n\t\t\tconst colors = await this._computePromise;\n\t\t\tthis.updateDecorations(colors);\n\t\t\tthis.updateColorDecorators(colors);\n\t\t\tthis._computePromise = null;\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t}\n\t}\n\n\tprivate stop(): void {\n\t\tif (this._timeoutTimer) {\n\t\t\tthis._timeoutTimer.cancel();\n\t\t\tthis._timeoutTimer = null;\n\t\t}\n\t\tif (this._computePromise) {\n\t\t\tthis._computePromise.cancel();\n\t\t\tthis._computePromise = null;\n\t\t}\n\t\tthis._localToDispose.clear();\n\t}\n\n\tprivate updateDecorations(colorDatas: IColorData[]): void {\n\t\tconst decorations = colorDatas.map(c => ({\n\t\t\trange: {\n\t\t\t\tstartLineNumber: c.colorInfo.range.startLineNumber,\n\t\t\t\tstartColumn: c.colorInfo.range.startColumn,\n\t\t\t\tendLineNumber: c.colorInfo.range.endLineNumber,\n\t\t\t\tendColumn: c.colorInfo.range.endColumn\n\t\t\t},\n\t\t\toptions: ModelDecorationOptions.EMPTY\n\t\t}));\n\n\t\tthis._editor.changeDecorations((changeAccessor) => {\n\t\t\tthis._decorationsIds = changeAccessor.deltaDecorations(this._decorationsIds, decorations);\n\n\t\t\tthis._colorDatas = new Map<string, IColorData>();\n\t\t\tthis._decorationsIds.forEach((id, i) => this._colorDatas.set(id, colorDatas[i]));\n\t\t});\n\t}\n\n\tprivate readonly _colorDecorationClassRefs = this._register(new DisposableStore());\n\n\tprivate updateColorDecorators(colorData: IColorData[]): void {\n\t\tthis._colorDecorationClassRefs.clear();\n\n\t\tconst decorations: IModelDeltaDecoration[] = [];\n\n\t\tconst limit = this._editor.getOption(EditorOption.colorDecoratorsLimit);\n\n\t\tfor (let i = 0; i < colorData.length && decorations.length < limit; i++) {\n\t\t\tconst { red, green, blue, alpha } = colorData[i].colorInfo.color;\n\t\t\tconst rgba = new RGBA(Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255), alpha);\n\t\t\tconst color = `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`;\n\n\t\t\tconst ref = this._colorDecorationClassRefs.add(\n\t\t\t\tthis._ruleFactory.createClassNameRef({\n\t\t\t\t\tbackgroundColor: color\n\t\t\t\t})\n\t\t\t);\n\n\t\t\tdecorations.push({\n\t\t\t\trange: {\n\t\t\t\t\tstartLineNumber: colorData[i].colorInfo.range.startLineNumber,\n\t\t\t\t\tstartColumn: colorData[i].colorInfo.range.startColumn,\n\t\t\t\t\tendLineNumber: colorData[i].colorInfo.range.endLineNumber,\n\t\t\t\t\tendColumn: colorData[i].colorInfo.range.endColumn\n\t\t\t\t},\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'colorDetector',\n\t\t\t\t\tbefore: {\n\t\t\t\t\t\tcontent: noBreakWhitespace,\n\t\t\t\t\t\tinlineClassName: `${ref.className} colorpicker-color-decoration`,\n\t\t\t\t\t\tinlineClassNameAffectsLetterSpacing: true,\n\t\t\t\t\t\tattachedData: ColorDecorationInjectedTextMarker\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tconst limited = limit < colorData.length ? limit : false;\n\t\tthis._decoratorLimitReporter.update(colorData.length, limited);\n\n\t\tthis._colorDecoratorIds.set(decorations);\n\t}\n\n\tprivate removeAllDecorations(): void {\n\t\tthis._editor.removeDecorations(this._decorationsIds);\n\t\tthis._decorationsIds = [];\n\t\tthis._colorDecoratorIds.clear();\n\t\tthis._colorDecorationClassRefs.clear();\n\t}\n\n\tgetColorData(position: Position): IColorData | null {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst decorations = model\n\t\t\t.getDecorationsInRange(Range.fromPositions(position, position))\n\t\t\t.filter(d => this._colorDatas.has(d.id));\n\n\t\tif (decorations.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this._colorDatas.get(decorations[0].id)!;\n\t}\n\n\tisColorDecoration(decoration: IModelDecoration): boolean {\n\t\treturn this._colorDecoratorIds.has(decoration);\n\t}\n}\n\nexport class DecoratorLimitReporter extends Disposable {\n\tprivate _onDidChange = this._register(new Emitter<void>());\n\n\tprivate _computed: number = 0;\n\tprivate _limited: number | false = false;\n\tpublic update(computed: number, limited: number | false) {\n\t\tif (computed !== this._computed || limited !== this._limited) {\n\t\t\tthis._computed = computed;\n\t\t\tthis._limited = limited;\n\t\t\tthis._onDidChange.fire();\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 { CancelablePromise, createCancelablePromise, TimeoutTimer } from '../../../../base/common/async.js';\nimport { RGBA } from '../../../../base/common/color.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { StopWatch } from '../../../../base/common/stopwatch.js';\nimport { noBreakWhitespace } from '../../../../base/common/strings.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { DynamicCssRules } from '../../../browser/editorDom.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { IEditorContribution, IEditorDecorationsCollection } from '../../../common/editorCommon.js';\nimport { IModelDecoration, IModelDeltaDecoration } from '../../../common/model.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { getColors, IColorData } from './color.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\n\nexport const ColorDecorationInjectedTextMarker = Object.create({});\n\n\nexport class ColorDetector extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID: string = 'editor.contrib.colorDetector';\n\n\tstatic readonly RECOMPUTE_TIME = 1000; // ms\n\n\tprivate readonly _localToDispose = this._register(new DisposableStore());\n\tprivate _computePromise: CancelablePromise<IColorData[]> | null;\n\tprivate _timeoutTimer: TimeoutTimer | null;\n\tprivate _debounceInformation: IFeatureDebounceInformation;\n\n\tprivate _decorationsIds: string[] = [];\n\tprivate _colorDatas = new Map<string, IColorData>();\n\n\tprivate readonly _colorDecoratorIds: IEditorDecorationsCollection;\n\n\tprivate _isColorDecoratorsEnabled: boolean;\n\tprivate _defaultColorDecoratorsEnablement: 'auto' | 'always' | 'never';\n\n\tprivate readonly _ruleFactory: DynamicCssRules;\n\n\tprivate readonly _decoratorLimitReporter = this._register(new DecoratorLimitReporter());\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService languageFeatureDebounceService: ILanguageFeatureDebounceService,\n\t) {\n\t\tsuper();\n\t\tthis._colorDecoratorIds = this._editor.createDecorationsCollection();\n\t\tthis._ruleFactory = this._register(new DynamicCssRules(this._editor));\n\t\tthis._debounceInformation = languageFeatureDebounceService.for(_languageFeaturesService.colorProvider, 'Document Colors', { min: ColorDetector.RECOMPUTE_TIME });\n\t\tthis._register(_editor.onDidChangeModel(() => {\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis.updateColors();\n\t\t}));\n\t\tthis._register(_editor.onDidChangeModelLanguage(() => this.updateColors()));\n\t\tthis._register(_languageFeaturesService.colorProvider.onDidChange(() => this.updateColors()));\n\t\tthis._register(_editor.onDidChangeConfiguration((e) => {\n\t\t\tconst prevIsEnabled = this._isColorDecoratorsEnabled;\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\t\tconst updatedColorDecoratorsSetting = prevIsEnabled !== this._isColorDecoratorsEnabled || e.hasChanged(EditorOption.colorDecoratorsLimit);\n\t\t\tconst updatedDefaultColorDecoratorsSetting = e.hasChanged(EditorOption.defaultColorDecorators);\n\t\t\tif (updatedColorDecoratorsSetting || updatedDefaultColorDecoratorsSetting) {\n\t\t\t\tif (this._isColorDecoratorsEnabled) {\n\t\t\t\t\tthis.updateColors();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.removeAllDecorations();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._timeoutTimer = null;\n\t\tthis._computePromise = null;\n\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\tthis.updateColors();\n\t}\n\n\tisEnabled(): boolean {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn false;\n\t\t}\n\t\tconst languageId = model.getLanguageId();\n\t\t// handle deprecated settings. [languageId].colorDecorators.enable\n\t\tconst deprecatedConfig = this._configurationService.getValue(languageId);\n\t\tif (deprecatedConfig && typeof deprecatedConfig === 'object') {\n\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\tconst colorDecorators = (deprecatedConfig as any)['colorDecorators']; // deprecatedConfig.valueOf('.colorDecorators.enable');\n\t\t\tif (colorDecorators && colorDecorators['enable'] !== undefined && !colorDecorators['enable']) {\n\t\t\t\treturn colorDecorators['enable'];\n\t\t\t}\n\t\t}\n\n\t\treturn this._editor.getOption(EditorOption.colorDecorators);\n\t}\n\n\tstatic get(editor: ICodeEditor): ColorDetector | null {\n\t\treturn editor.getContribution<ColorDetector>(this.ID);\n\t}\n\n\toverride dispose(): void {\n\t\tthis.stop();\n\t\tthis.removeAllDecorations();\n\t\tsuper.dispose();\n\t}\n\n\tprivate updateColors(): void {\n\t\tthis.stop();\n\n\t\tif (!this._isColorDecoratorsEnabled) {\n\t\t\treturn;\n\t\t}\n\t\tconst model = this._editor.getModel();\n\n\t\tif (!model || !this._languageFeaturesService.colorProvider.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._localToDispose.add(this._editor.onDidChangeModelContent(() => {\n\t\t\tif (!this._timeoutTimer) {\n\t\t\t\tthis._timeoutTimer = new TimeoutTimer();\n\t\t\t\tthis._timeoutTimer.cancelAndSet(() => {\n\t\t\t\t\tthis._timeoutTimer = null;\n\t\t\t\t\tthis.beginCompute();\n\t\t\t\t}, this._debounceInformation.get(model));\n\t\t\t}\n\t\t}));\n\t\tthis.beginCompute();\n\t}\n\n\tprivate async beginCompute(): Promise<void> {\n\t\tthis._computePromise = createCancelablePromise(async token => {\n\t\t\tconst model = this._editor.getModel();\n\t\t\tif (!model) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst sw = new StopWatch(false);\n\t\t\tconst colors = await getColors(this._languageFeaturesService.colorProvider, model, token, this._defaultColorDecoratorsEnablement);\n\t\t\tthis._debounceInformation.update(model, sw.elapsed());\n\t\t\treturn colors;\n\t\t});\n\t\ttry {\n\t\t\tconst colors = await this._computePromise;\n\t\t\tthis.updateDecorations(colors);\n\t\t\tthis.updateColorDecorators(colors);\n\t\t\tthis._computePromise = null;\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t}\n\t}\n\n\tprivate stop(): void {\n\t\tif (this._timeoutTimer) {\n\t\t\tthis._timeoutTimer.cancel();\n\t\t\tthis._timeoutTimer = null;\n\t\t}\n\t\tif (this._computePromise) {\n\t\t\tthis._computePromise.cancel();\n\t\t\tthis._computePromise = null;\n\t\t}\n\t\tthis._localToDispose.clear();\n\t}\n\n\tprivate updateDecorations(colorDatas: IColorData[]): void {\n\t\tconst decorations = colorDatas.map(c => ({\n\t\t\trange: {\n\t\t\t\tstartLineNumber: c.colorInfo.range.startLineNumber,\n\t\t\t\tstartColumn: c.colorInfo.range.startColumn,\n\t\t\t\tendLineNumber: c.colorInfo.range.endLineNumber,\n\t\t\t\tendColumn: c.colorInfo.range.endColumn\n\t\t\t},\n\t\t\toptions: ModelDecorationOptions.EMPTY\n\t\t}));\n\n\t\tthis._editor.changeDecorations((changeAccessor) => {\n\t\t\tthis._decorationsIds = changeAccessor.deltaDecorations(this._decorationsIds, decorations);\n\n\t\t\tthis._colorDatas = new Map<string, IColorData>();\n\t\t\tthis._decorationsIds.forEach((id, i) => this._colorDatas.set(id, colorDatas[i]));\n\t\t});\n\t}\n\n\tprivate readonly _colorDecorationClassRefs = this._register(new DisposableStore());\n\n\tprivate updateColorDecorators(colorData: IColorData[]): void {\n\t\tthis._colorDecorationClassRefs.clear();\n\n\t\tconst decorations: IModelDeltaDecoration[] = [];\n\n\t\tconst limit = this._editor.getOption(EditorOption.colorDecoratorsLimit);\n\n\t\tfor (let i = 0; i < colorData.length && decorations.length < limit; i++) {\n\t\t\tconst { red, green, blue, alpha } = colorData[i].colorInfo.color;\n\t\t\tconst rgba = new RGBA(Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255), alpha);\n\t\t\tconst color = `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`;\n\n\t\t\tconst ref = this._colorDecorationClassRefs.add(\n\t\t\t\tthis._ruleFactory.createClassNameRef({\n\t\t\t\t\tbackgroundColor: color\n\t\t\t\t})\n\t\t\t);\n\n\t\t\tdecorations.push({\n\t\t\t\trange: {\n\t\t\t\t\tstartLineNumber: colorData[i].colorInfo.range.startLineNumber,\n\t\t\t\t\tstartColumn: colorData[i].colorInfo.range.startColumn,\n\t\t\t\t\tendLineNumber: colorData[i].colorInfo.range.endLineNumber,\n\t\t\t\t\tendColumn: colorData[i].colorInfo.range.endColumn\n\t\t\t\t},\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'colorDetector',\n\t\t\t\t\tbefore: {\n\t\t\t\t\t\tcontent: noBreakWhitespace,\n\t\t\t\t\t\tinlineClassName: `${ref.className} colorpicker-color-decoration`,\n\t\t\t\t\t\tinlineClassNameAffectsLetterSpacing: true,\n\t\t\t\t\t\tattachedData: ColorDecorationInjectedTextMarker\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tconst limited = limit < colorData.length ? limit : false;\n\t\tthis._decoratorLimitReporter.update(colorData.length, limited);\n\n\t\tthis._colorDecoratorIds.set(decorations);\n\t}\n\n\tprivate removeAllDecorations(): void {\n\t\tthis._editor.removeDecorations(this._decorationsIds);\n\t\tthis._decorationsIds = [];\n\t\tthis._colorDecoratorIds.clear();\n\t\tthis._colorDecorationClassRefs.clear();\n\t}\n\n\tgetColorData(position: Position): IColorData | null {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst decorations = model\n\t\t\t.getDecorationsInRange(Range.fromPositions(position, position))\n\t\t\t.filter(d => this._colorDatas.has(d.id));\n\n\t\tif (decorations.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this._colorDatas.get(decorations[0].id)!;\n\t}\n\n\tisColorDecoration(decoration: IModelDecoration): boolean {\n\t\treturn this._colorDecoratorIds.has(decoration);\n\t}\n}\n\nexport class DecoratorLimitReporter extends Disposable {\n\tprivate _onDidChange = this._register(new Emitter<void>());\n\n\tprivate _computed: number = 0;\n\tprivate _limited: number | false = false;\n\tpublic update(computed: number, limited: number | false) {\n\t\tif (computed !== this._computed || limited !== this._limited) {\n\t\t\tthis._computed = computed;\n\t\t\tthis._limited = limited;\n\t\t\tthis._onDidChange.fire();\n\t\t}\n\t}\n}\n"]}
@@ -22,7 +22,7 @@ import { Position } from '../../../common/core/position.js';
22
22
  import { Range } from '../../../common/core/range.js';
23
23
  import * as dom from '../../../../base/browser/dom.js';
24
24
  import { MarkdownHoverParticipant } from './markdownHoverParticipant.js';
25
- import { ColorHover, HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js';
25
+ import { HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js';
26
26
  import { InlayHintsHover } from '../../inlayHints/browser/inlayHintsHover.js';
27
27
  import { BugIndicatingError } from '../../../../base/common/errors.js';
28
28
  import { IHoverService } from '../../../../platform/hover/browser/hover.js';
@@ -229,7 +229,7 @@ let RenderedContentHoverParts = class RenderedContentHoverParts extends Disposab
229
229
  this._focusedHoverPartIndex = -1;
230
230
  }));
231
231
  // Add copy button for marker hovers
232
- if (renderedPart.type === 'hoverPart' && !(renderedPart.hoverPart instanceof ColorHover) && !renderedPart.participant.hideCopyButton) {
232
+ if (renderedPart.type === 'hoverPart' && !renderedPart.participant.hideCopyButton) {
233
233
  disposables.add(new HoverCopyButton(element, () => renderedPart.participant.getAccessibleContent(renderedPart.hoverPart), this._clipboardService, this._hoverService));
234
234
  }
235
235
  });