monaco-editor-core 0.54.0-dev-20251004 → 0.54.0-dev-20251005

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 (129) hide show
  1. package/esm/nls.messages.de.js +1 -1
  2. package/esm/nls.messages.es.js +1 -1
  3. package/esm/nls.messages.fr.js +1 -1
  4. package/esm/nls.messages.it.js +1 -1
  5. package/esm/nls.messages.ja.js +1 -1
  6. package/esm/nls.messages.ko.js +1 -1
  7. package/esm/nls.messages.ru.js +1 -1
  8. package/esm/nls.messages.zh-cn.js +1 -1
  9. package/esm/nls.messages.zh-tw.js +1 -1
  10. package/esm/vs/base/browser/dom.js.map +1 -1
  11. package/esm/vs/base/browser/fastDomNode.js +0 -1
  12. package/esm/vs/base/browser/fastDomNode.js.map +1 -1
  13. package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js +1 -1
  14. package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js.map +1 -1
  15. package/esm/vs/base/common/buffer.js.map +1 -1
  16. package/esm/vs/base/common/errors.js.map +1 -1
  17. package/esm/vs/base/common/hash.js.map +1 -1
  18. package/esm/vs/base/common/worker/webWorker.js +26 -22
  19. package/esm/vs/base/common/worker/webWorker.js.map +1 -1
  20. package/esm/vs/editor/browser/config/editorConfiguration.js +3 -6
  21. package/esm/vs/editor/browser/config/editorConfiguration.js.map +1 -1
  22. package/esm/vs/editor/browser/config/migrateOptions.js +1 -2
  23. package/esm/vs/editor/browser/config/migrateOptions.js.map +1 -1
  24. package/esm/vs/editor/browser/controller/editContext/native/editContextFactory.js +0 -1
  25. package/esm/vs/editor/browser/controller/editContext/native/editContextFactory.js.map +1 -1
  26. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContextUtils.js +2 -2
  27. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContextUtils.js.map +1 -1
  28. package/esm/vs/editor/browser/controller/mouseHandler.js +2 -2
  29. package/esm/vs/editor/browser/controller/mouseHandler.js.map +1 -1
  30. package/esm/vs/editor/browser/controller/mouseTarget.js +7 -8
  31. package/esm/vs/editor/browser/controller/mouseTarget.js.map +1 -1
  32. package/esm/vs/editor/browser/controller/pointerHandler.js +0 -2
  33. package/esm/vs/editor/browser/controller/pointerHandler.js.map +1 -1
  34. package/esm/vs/editor/browser/coreCommands.js.map +1 -1
  35. package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
  36. package/esm/vs/editor/browser/editorDom.js +0 -2
  37. package/esm/vs/editor/browser/editorDom.js.map +1 -1
  38. package/esm/vs/editor/browser/editorExtensions.js.map +1 -1
  39. package/esm/vs/editor/browser/gpu/gpuUtils.js +1 -1
  40. package/esm/vs/editor/browser/gpu/gpuUtils.js.map +1 -1
  41. package/esm/vs/editor/browser/gpu/viewGpuContext.js +1 -1
  42. package/esm/vs/editor/browser/gpu/viewGpuContext.js.map +1 -1
  43. package/esm/vs/editor/browser/services/abstractCodeEditorService.js.map +1 -1
  44. package/esm/vs/editor/browser/services/bulkEditService.js.map +1 -1
  45. package/esm/vs/editor/browser/services/codeEditorService.js.map +1 -1
  46. package/esm/vs/editor/browser/services/editorWorkerService.js.map +1 -1
  47. package/esm/vs/editor/browser/services/hoverService/hoverService.js +1 -1
  48. package/esm/vs/editor/browser/services/hoverService/hoverService.js.map +1 -1
  49. package/esm/vs/editor/browser/services/hoverService/hoverWidget.js +1 -1
  50. package/esm/vs/editor/browser/services/hoverService/hoverWidget.js.map +1 -1
  51. package/esm/vs/editor/browser/services/openerService.js.map +1 -1
  52. package/esm/vs/editor/browser/view.js.map +1 -1
  53. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +1 -0
  54. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
  55. package/esm/vs/editor/browser/viewParts/viewZones/viewZones.js +1 -0
  56. package/esm/vs/editor/browser/viewParts/viewZones/viewZones.js.map +1 -1
  57. package/esm/vs/editor/browser/widget/codeEditor/codeEditorContributions.js.map +1 -1
  58. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +4 -2
  59. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
  60. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -1
  61. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js.map +1 -1
  62. package/esm/vs/editor/browser/widget/diffEditor/delegatingEditorImpl.js.map +1 -1
  63. package/esm/vs/editor/browser/widget/diffEditor/diffEditorOptions.js +1 -1
  64. package/esm/vs/editor/browser/widget/diffEditor/diffEditorOptions.js.map +1 -1
  65. package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +1 -1
  66. package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js.map +1 -1
  67. package/esm/vs/editor/browser/widget/diffEditor/utils.js +2 -2
  68. package/esm/vs/editor/browser/widget/diffEditor/utils.js.map +1 -1
  69. package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js +2 -2
  70. package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js.map +1 -1
  71. package/esm/vs/editor/common/config/editorOptions.js +121 -72
  72. package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
  73. package/esm/vs/editor/common/config/fontInfo.js +32 -16
  74. package/esm/vs/editor/common/config/fontInfo.js.map +1 -1
  75. package/esm/vs/editor/common/config/fontInfoFromSettings.js +16 -0
  76. package/esm/vs/editor/common/config/fontInfoFromSettings.js.map +1 -0
  77. package/esm/vs/editor/common/core/edits/edit.js +1 -0
  78. package/esm/vs/editor/common/core/edits/edit.js.map +1 -1
  79. package/esm/vs/editor/common/core/edits/stringEdit.js +2 -0
  80. package/esm/vs/editor/common/core/edits/stringEdit.js.map +1 -1
  81. package/esm/vs/editor/common/core/position.js +1 -1
  82. package/esm/vs/editor/common/core/position.js.map +1 -1
  83. package/esm/vs/editor/common/core/range.js +1 -1
  84. package/esm/vs/editor/common/core/range.js.map +1 -1
  85. package/esm/vs/editor/common/core/selection.js +1 -1
  86. package/esm/vs/editor/common/core/selection.js.map +1 -1
  87. package/esm/vs/editor/common/cursor/cursorMoveCommands.js.map +1 -1
  88. package/esm/vs/editor/common/editorCommon.js.map +1 -1
  89. package/esm/vs/editor/common/languages.js +1 -2
  90. package/esm/vs/editor/common/languages.js.map +1 -1
  91. package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.js +14 -13
  92. package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.js.map +1 -1
  93. package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet.js +2 -0
  94. package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet.js.map +1 -1
  95. package/esm/vs/editor/common/model/textModel.js +1 -1
  96. package/esm/vs/editor/common/model/textModel.js.map +1 -1
  97. package/esm/vs/editor/common/model.js +1 -1
  98. package/esm/vs/editor/common/model.js.map +1 -1
  99. package/esm/vs/editor/common/services/editorBaseApi.js +0 -2
  100. package/esm/vs/editor/common/services/editorBaseApi.js.map +1 -1
  101. package/esm/vs/editor/common/services/editorWebWorker.js +1 -0
  102. package/esm/vs/editor/common/services/editorWebWorker.js.map +1 -1
  103. package/esm/vs/editor/common/services/editorWorkerHost.js.map +1 -1
  104. package/esm/vs/editor/common/services/modelService.js +14 -21
  105. package/esm/vs/editor/common/services/modelService.js.map +1 -1
  106. package/esm/vs/editor/common/textModelEditSource.js +2 -1
  107. package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
  108. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +40 -1
  109. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js.map +1 -1
  110. package/esm/vs/editor/common/viewModel/viewModelImpl.js +2 -1
  111. package/esm/vs/editor/common/viewModel/viewModelImpl.js.map +1 -1
  112. package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +1 -0
  113. package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js.map +1 -1
  114. package/esm/vs/editor/contrib/codelens/browser/codelensController.js +1 -1
  115. package/esm/vs/editor/contrib/codelens/browser/codelensController.js.map +1 -1
  116. package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js.map +1 -1
  117. package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
  118. package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js.map +1 -1
  119. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +1 -1
  120. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js.map +1 -1
  121. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +1 -0
  122. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
  123. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +1 -1
  124. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js.map +1 -1
  125. package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js.map +1 -1
  126. package/esm/vs/editor/editor.api.d.ts +8 -8
  127. package/esm/vs/editor/standalone/browser/standaloneWebWorker.js.map +1 -1
  128. package/monaco.d.ts +8 -8
  129. package/package.json +2 -2
@@ -79,6 +79,7 @@ let CodeActionController = class CodeActionController extends Disposable {
79
79
  const command = actionItem.action.command;
80
80
  if (command && command.id === 'inlineChat.start') {
81
81
  if (command.arguments && command.arguments.length >= 1) {
82
+ // eslint-disable-next-line local/code-no-any-casts
82
83
  command.arguments[0] = { ...command.arguments[0], autoSend: false };
83
84
  }
84
85
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["vs/editor/contrib/codeAction/browser/codeActionController.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,KAAK,IAAI,MAAM,0CAA0C,CAAC;AAKjE,OAAO,EAAE,iBAAiB,EA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CAAA;IACd,WAAA,kBAAkB,CAAA;IAClB,WAAA,qBAAqB,CAAA;IACrB,WAAA,wBAAwB,CAAA;IACxB,WAAA,sBAAsB,CAAA;IACtB,WAAA,eAAe,CAAA;IACf,WAAA,qBAAqB,CAAA;IACrB,WAAA,oBAAoB,CAAA;IACpB,WAAA,qBAAqB,CAAA;IACrB,YAAA,sBAAsB,CAAA;GA9BZ,oBAAoB,CA8WhC;;AAED,0BAA0B,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE;IAC/C,MAAM,sBAAsB,GAAG,CAAC,QAAgB,EAAE,KAAwB,EAAQ,EAAE;QACnF,IAAI,KAAK,EAAE,CAAC;YACX,SAAS,CAAC,OAAO,CAAC,kBAAkB,QAAQ,wBAAwB,KAAK,KAAK,CAAC,CAAC;QACjF,CAAC;IACF,CAAC,CAAC;IAEF,sBAAsB,CAAC,0BAA0B,EAAE,KAAK,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC,CAAC;IAC7F,MAAM,wBAAwB,GAAG,KAAK,CAAC,QAAQ,CAAC,8BAA8B,CAAC,CAAC;IAEhF,IAAI,wBAAwB,EAAE,CAAC;QAC9B,SAAS,CAAC,OAAO,CAAC,yDAAyD,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,IAAI,wBAAwB,6BAA6B,CAAC,CAAC;IACtL,CAAC;AACF,CAAC,CAAC,CAAC","file":"codeActionController.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 { getDomNodePagePosition } from '../../../../base/browser/dom.js';\nimport * as aria from '../../../../base/browser/ui/aria/aria.js';\nimport { IAnchor } from '../../../../base/browser/ui/contextview/contextview.js';\nimport { IAction } from '../../../../base/common/actions.js';\nimport { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { Color } from '../../../../base/common/color.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js';\nimport { Lazy } from '../../../../base/common/lazy.js';\nimport { Disposable, MutableDisposable } from '../../../../base/common/lifecycle.js';\nimport { localize } from '../../../../nls.js';\nimport { IActionListDelegate } from '../../../../platform/actionWidget/browser/actionList.js';\nimport { IActionWidgetService } from '../../../../platform/actionWidget/browser/actionWidget.js';\nimport { ICommandService } from '../../../../platform/commands/common/commands.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\nimport { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { IMarkerService } from '../../../../platform/markers/common/markers.js';\nimport { IEditorProgressService } from '../../../../platform/progress/common/progress.js';\nimport { editorFindMatchHighlight, editorFindMatchHighlightBorder } from '../../../../platform/theme/common/colorRegistry.js';\nimport { isHighContrast } from '../../../../platform/theme/common/theme.js';\nimport { registerThemingParticipant } from '../../../../platform/theme/common/themeService.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { IPosition, Position } from '../../../common/core/position.js';\nimport { IEditorContribution, ScrollType } from '../../../common/editorCommon.js';\nimport { CodeActionTriggerType } from '../../../common/languages.js';\nimport { IModelDeltaDecoration } from '../../../common/model.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { MessageController } from '../../message/browser/messageController.js';\nimport { CodeActionAutoApply, CodeActionFilter, CodeActionItem, CodeActionKind, CodeActionSet, CodeActionTrigger, CodeActionTriggerSource } from '../common/types.js';\nimport { ApplyCodeActionReason, applyCodeAction } from './codeAction.js';\nimport { CodeActionKeybindingResolver } from './codeActionKeybindingResolver.js';\nimport { toMenuItems } from './codeActionMenu.js';\nimport { CodeActionModel, CodeActionsState } from './codeActionModel.js';\nimport { LightBulbWidget } from './lightBulbWidget.js';\n\ninterface IActionShowOptions {\n\treadonly includeDisabledActions?: boolean;\n\treadonly fromLightbulb?: boolean;\n}\n\n\nconst DECORATION_CLASS_NAME = 'quickfix-edit-highlight';\n\nexport class CodeActionController extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.codeActionController';\n\n\tpublic static get(editor: ICodeEditor): CodeActionController | null {\n\t\treturn editor.getContribution<CodeActionController>(CodeActionController.ID);\n\t}\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _model: CodeActionModel;\n\n\tprivate readonly _lightBulbWidget: Lazy<LightBulbWidget | null>;\n\tprivate readonly _activeCodeActions = this._register(new MutableDisposable<CodeActionSet>());\n\tprivate _showDisabled = false;\n\n\tprivate readonly _resolver: CodeActionKeybindingResolver;\n\n\tprivate _disposed = false;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IMarkerService markerService: IMarkerService,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService,\n\t\t@IEditorProgressService progressService: IEditorProgressService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IActionWidgetService private readonly _actionWidgetService: IActionWidgetService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IEditorProgressService private readonly _progressService: IEditorProgressService,\n\t) {\n\t\tsuper();\n\n\t\tthis._editor = editor;\n\t\tthis._model = this._register(new CodeActionModel(this._editor, languageFeaturesService.codeActionProvider, markerService, contextKeyService, progressService, _configurationService));\n\t\tthis._register(this._model.onDidChangeState(newState => this.update(newState)));\n\n\t\tthis._lightBulbWidget = new Lazy(() => {\n\t\t\tconst widget = this._editor.getContribution<LightBulbWidget>(LightBulbWidget.ID);\n\t\t\tif (widget) {\n\t\t\t\tthis._register(widget.onClick(e => this.showCodeActionsFromLightbulb(e.actions, e)));\n\t\t\t}\n\t\t\treturn widget;\n\t\t});\n\n\t\tthis._resolver = instantiationService.createInstance(CodeActionKeybindingResolver);\n\n\t\tthis._register(this._editor.onDidLayoutChange(() => this._actionWidgetService.hide()));\n\t}\n\n\toverride dispose() {\n\t\tthis._disposed = true;\n\t\tsuper.dispose();\n\t}\n\n\tprivate async showCodeActionsFromLightbulb(actions: CodeActionSet, at: IAnchor | IPosition): Promise<void> {\n\t\tif (actions.allAIFixes && actions.validActions.length === 1) {\n\t\t\tconst actionItem = actions.validActions[0];\n\t\t\tconst command = actionItem.action.command;\n\t\t\tif (command && command.id === 'inlineChat.start') {\n\t\t\t\tif (command.arguments && command.arguments.length >= 1) {\n\t\t\t\t\tcommand.arguments[0] = { ...command.arguments[0], autoSend: false };\n\t\t\t\t}\n\t\t\t}\n\t\t\tawait this.applyCodeAction(actionItem, false, false, ApplyCodeActionReason.FromAILightbulb);\n\t\t\treturn;\n\t\t}\n\t\tawait this.showCodeActionList(actions, at, { includeDisabledActions: false, fromLightbulb: true });\n\t}\n\n\tpublic showCodeActions(_trigger: CodeActionTrigger, actions: CodeActionSet, at: IAnchor | IPosition) {\n\t\treturn this.showCodeActionList(actions, at, { includeDisabledActions: false, fromLightbulb: false });\n\t}\n\n\tpublic manualTriggerAtCurrentPosition(\n\t\tnotAvailableMessage: string,\n\t\ttriggerAction: CodeActionTriggerSource,\n\t\tfilter?: CodeActionFilter,\n\t\tautoApply?: CodeActionAutoApply,\n\t): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tMessageController.get(this._editor)?.closeMessage();\n\t\tconst triggerPosition = this._editor.getPosition();\n\t\tthis._trigger({ type: CodeActionTriggerType.Invoke, triggerAction, filter, autoApply, context: { notAvailableMessage, position: triggerPosition } });\n\t}\n\n\tprivate _trigger(trigger: CodeActionTrigger) {\n\t\treturn this._model.trigger(trigger);\n\t}\n\n\tasync applyCodeAction(action: CodeActionItem, retrigger: boolean, preview: boolean, actionReason: ApplyCodeActionReason): Promise<void> {\n\t\tconst progress = this._progressService.show(true, 500);\n\t\ttry {\n\t\t\tawait this._instantiationService.invokeFunction(applyCodeAction, action, actionReason, { preview, editor: this._editor });\n\t\t} finally {\n\t\t\tif (retrigger) {\n\t\t\t\tthis._trigger({ type: CodeActionTriggerType.Auto, triggerAction: CodeActionTriggerSource.QuickFix, filter: {} });\n\t\t\t}\n\t\t\tprogress.done();\n\t\t}\n\t}\n\n\tpublic hideLightBulbWidget(): void {\n\t\tthis._lightBulbWidget.rawValue?.hide();\n\t\tthis._lightBulbWidget.rawValue?.gutterHide();\n\t}\n\n\tprivate async update(newState: CodeActionsState.State): Promise<void> {\n\t\tif (newState.type !== CodeActionsState.Type.Triggered) {\n\t\t\tthis.hideLightBulbWidget();\n\t\t\treturn;\n\t\t}\n\n\t\tlet actions: CodeActionSet;\n\t\ttry {\n\t\t\tactions = await newState.actions;\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._disposed) {\n\t\t\treturn;\n\t\t}\n\n\n\t\tconst selection = this._editor.getSelection();\n\t\tif (selection?.startLineNumber !== newState.position.lineNumber) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._lightBulbWidget.value?.update(actions, newState.trigger, newState.position);\n\n\t\tif (newState.trigger.type === CodeActionTriggerType.Invoke) {\n\t\t\tif (newState.trigger.filter?.include) { // Triggered for specific scope\n\t\t\t\t// Check to see if we want to auto apply.\n\n\t\t\t\tconst validActionToApply = this.tryGetValidActionToApply(newState.trigger, actions);\n\t\t\t\tif (validActionToApply) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.hideLightBulbWidget();\n\t\t\t\t\t\tawait this.applyCodeAction(validActionToApply, false, false, ApplyCodeActionReason.FromCodeActions);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tactions.dispose();\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Check to see if there is an action that we would have applied were it not invalid\n\t\t\t\tif (newState.trigger.context) {\n\t\t\t\t\tconst invalidAction = this.getInvalidActionThatWouldHaveBeenApplied(newState.trigger, actions);\n\t\t\t\t\tif (invalidAction && invalidAction.action.disabled) {\n\t\t\t\t\t\tMessageController.get(this._editor)?.showMessage(invalidAction.action.disabled, newState.trigger.context.position);\n\t\t\t\t\t\tactions.dispose();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst includeDisabledActions = !!newState.trigger.filter?.include;\n\t\t\tif (newState.trigger.context) {\n\t\t\t\tif (!actions.allActions.length || !includeDisabledActions && !actions.validActions.length) {\n\t\t\t\t\tMessageController.get(this._editor)?.showMessage(newState.trigger.context.notAvailableMessage, newState.trigger.context.position);\n\t\t\t\t\tthis._activeCodeActions.value = actions;\n\t\t\t\t\tactions.dispose();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._activeCodeActions.value = actions;\n\t\t\tthis.showCodeActionList(actions, this.toCoords(newState.position), { includeDisabledActions, fromLightbulb: false });\n\t\t} else {\n\t\t\t// auto magically triggered\n\t\t\tif (this._actionWidgetService.isVisible) {\n\t\t\t\t// TODO: Figure out if we should update the showing menu?\n\t\t\t\tactions.dispose();\n\t\t\t} else {\n\t\t\t\tthis._activeCodeActions.value = actions;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getInvalidActionThatWouldHaveBeenApplied(trigger: CodeActionTrigger, actions: CodeActionSet): CodeActionItem | undefined {\n\t\tif (!actions.allActions.length) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif ((trigger.autoApply === CodeActionAutoApply.First && actions.validActions.length === 0)\n\t\t\t|| (trigger.autoApply === CodeActionAutoApply.IfSingle && actions.allActions.length === 1)\n\t\t) {\n\t\t\treturn actions.allActions.find(({ action }) => action.disabled);\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tprivate tryGetValidActionToApply(trigger: CodeActionTrigger, actions: CodeActionSet): CodeActionItem | undefined {\n\t\tif (!actions.validActions.length) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif ((trigger.autoApply === CodeActionAutoApply.First && actions.validActions.length > 0)\n\t\t\t|| (trigger.autoApply === CodeActionAutoApply.IfSingle && actions.validActions.length === 1)\n\t\t) {\n\t\t\treturn actions.validActions[0];\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tprivate static readonly DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'quickfix-highlight',\n\t\tclassName: DECORATION_CLASS_NAME\n\t});\n\n\tpublic async showCodeActionList(actions: CodeActionSet, at: IAnchor | IPosition, options: IActionShowOptions): Promise<void> {\n\n\t\tconst currentDecorations = this._editor.createDecorationsCollection();\n\n\t\tconst editorDom = this._editor.getDomNode();\n\t\tif (!editorDom) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst actionsToShow = options.includeDisabledActions && (this._showDisabled || actions.validActions.length === 0) ? actions.allActions : actions.validActions;\n\t\tif (!actionsToShow.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst anchor = Position.isIPosition(at) ? this.toCoords(at) : at;\n\n\t\tconst delegate: IActionListDelegate<CodeActionItem> = {\n\t\t\tonSelect: async (action: CodeActionItem, preview?: boolean) => {\n\t\t\t\tthis.applyCodeAction(action, /* retrigger */ true, !!preview, options.fromLightbulb ? ApplyCodeActionReason.FromAILightbulb : ApplyCodeActionReason.FromCodeActions);\n\t\t\t\tthis._actionWidgetService.hide(false);\n\t\t\t\tcurrentDecorations.clear();\n\t\t\t},\n\t\t\tonHide: (didCancel?) => {\n\t\t\t\tthis._editor?.focus();\n\t\t\t\tcurrentDecorations.clear();\n\t\t\t},\n\t\t\tonHover: async (action: CodeActionItem, token: CancellationToken) => {\n\t\t\t\tif (token.isCancellationRequested) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet canPreview = false;\n\t\t\t\tconst actionKind = action.action.kind;\n\n\t\t\t\tif (actionKind) {\n\t\t\t\t\tconst hierarchicalKind = new HierarchicalKind(actionKind);\n\t\t\t\t\tconst refactorKinds = [\n\t\t\t\t\t\tCodeActionKind.RefactorExtract,\n\t\t\t\t\t\tCodeActionKind.RefactorInline,\n\t\t\t\t\t\tCodeActionKind.RefactorRewrite,\n\t\t\t\t\t\tCodeActionKind.RefactorMove,\n\t\t\t\t\t\tCodeActionKind.Source\n\t\t\t\t\t];\n\n\t\t\t\t\tcanPreview = refactorKinds.some(refactorKind => refactorKind.contains(hierarchicalKind));\n\t\t\t\t}\n\n\t\t\t\treturn { canPreview: canPreview || !!action.action.edit?.edits.length };\n\t\t\t},\n\t\t\tonFocus: (action: CodeActionItem | undefined) => {\n\t\t\t\tif (action && action.action) {\n\t\t\t\t\tconst ranges = action.action.ranges;\n\t\t\t\t\tconst diagnostics = action.action.diagnostics;\n\t\t\t\t\tcurrentDecorations.clear();\n\t\t\t\t\tif (ranges && ranges.length > 0) {\n\t\t\t\t\t\t// Handles case for `fix all` where there are multiple diagnostics.\n\t\t\t\t\t\tconst decorations: IModelDeltaDecoration[] = (diagnostics && diagnostics?.length > 1)\n\t\t\t\t\t\t\t? diagnostics.map(diagnostic => ({ range: diagnostic, options: CodeActionController.DECORATION }))\n\t\t\t\t\t\t\t: ranges.map(range => ({ range, options: CodeActionController.DECORATION }));\n\t\t\t\t\t\tcurrentDecorations.set(decorations);\n\t\t\t\t\t} else if (diagnostics && diagnostics.length > 0) {\n\t\t\t\t\t\tconst decorations: IModelDeltaDecoration[] = diagnostics.map(diagnostic => ({ range: diagnostic, options: CodeActionController.DECORATION }));\n\t\t\t\t\t\tcurrentDecorations.set(decorations);\n\t\t\t\t\t\tconst diagnostic = diagnostics[0];\n\t\t\t\t\t\tif (diagnostic.startLineNumber && diagnostic.startColumn) {\n\t\t\t\t\t\t\tconst selectionText = this._editor.getModel()?.getWordAtPosition({ lineNumber: diagnostic.startLineNumber, column: diagnostic.startColumn })?.word;\n\t\t\t\t\t\t\taria.status(localize('editingNewSelection', \"Context: {0} at line {1} and column {2}.\", selectionText, diagnostic.startLineNumber, diagnostic.startColumn));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tcurrentDecorations.clear();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tthis._actionWidgetService.show(\n\t\t\t'codeActionWidget',\n\t\t\ttrue,\n\t\t\ttoMenuItems(actionsToShow, this._shouldShowHeaders(), this._resolver.getResolver()),\n\t\t\tdelegate,\n\t\t\tanchor,\n\t\t\teditorDom,\n\t\t\tthis._getActionBarActions(actions, at, options));\n\t}\n\n\tprivate toCoords(position: IPosition): IAnchor {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn { x: 0, y: 0 };\n\t\t}\n\n\t\tthis._editor.revealPosition(position, ScrollType.Immediate);\n\t\tthis._editor.render();\n\n\t\t// Translate to absolute editor position\n\t\tconst cursorCoords = this._editor.getScrolledVisiblePosition(position);\n\t\tconst editorCoords = getDomNodePagePosition(this._editor.getDomNode());\n\t\tconst x = editorCoords.left + cursorCoords.left;\n\t\tconst y = editorCoords.top + cursorCoords.top + cursorCoords.height;\n\n\t\treturn { x, y };\n\t}\n\n\tprivate _shouldShowHeaders(): boolean {\n\t\tconst model = this._editor?.getModel();\n\t\treturn this._configurationService.getValue('editor.codeActionWidget.showHeaders', { resource: model?.uri });\n\t}\n\n\tprivate _getActionBarActions(actions: CodeActionSet, at: IAnchor | IPosition, options: IActionShowOptions): IAction[] {\n\t\tif (options.fromLightbulb) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst resultActions = actions.documentation.map((command): IAction => ({\n\t\t\tid: command.id,\n\t\t\tlabel: command.title,\n\t\t\ttooltip: command.tooltip ?? '',\n\t\t\tclass: undefined,\n\t\t\tenabled: true,\n\t\t\trun: () => this._commandService.executeCommand(command.id, ...(command.arguments ?? [])),\n\t\t}));\n\n\t\tif (options.includeDisabledActions && actions.validActions.length > 0 && actions.allActions.length !== actions.validActions.length) {\n\t\t\tresultActions.push(this._showDisabled ? {\n\t\t\t\tid: 'hideMoreActions',\n\t\t\t\tlabel: localize('hideMoreActions', 'Hide Disabled'),\n\t\t\t\tenabled: true,\n\t\t\t\ttooltip: '',\n\t\t\t\tclass: undefined,\n\t\t\t\trun: () => {\n\t\t\t\t\tthis._showDisabled = false;\n\t\t\t\t\treturn this.showCodeActionList(actions, at, options);\n\t\t\t\t}\n\t\t\t} : {\n\t\t\t\tid: 'showMoreActions',\n\t\t\t\tlabel: localize('showMoreActions', 'Show Disabled'),\n\t\t\t\tenabled: true,\n\t\t\t\ttooltip: '',\n\t\t\t\tclass: undefined,\n\t\t\t\trun: () => {\n\t\t\t\t\tthis._showDisabled = true;\n\t\t\t\t\treturn this.showCodeActionList(actions, at, options);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn resultActions;\n\t}\n}\n\nregisterThemingParticipant((theme, collector) => {\n\tconst addBackgroundColorRule = (selector: string, color: Color | undefined): void => {\n\t\tif (color) {\n\t\t\tcollector.addRule(`.monaco-editor ${selector} { background-color: ${color}; }`);\n\t\t}\n\t};\n\n\taddBackgroundColorRule('.quickfix-edit-highlight', theme.getColor(editorFindMatchHighlight));\n\tconst findMatchHighlightBorder = theme.getColor(editorFindMatchHighlightBorder);\n\n\tif (findMatchHighlightBorder) {\n\t\tcollector.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${isHighContrast(theme.type) ? 'dotted' : 'solid'} ${findMatchHighlightBorder}; box-sizing: border-box; }`);\n\t}\n});\n"]}
1
+ {"version":3,"sources":["vs/editor/contrib/codeAction/browser/codeActionController.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,KAAK,IAAI,MAAM,0CAA0C,CAAC;AAKjE,OAAO,EAAE,iBAAiB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IAqB9B,WAAA,cAAc,CAAA;IACd,WAAA,kBAAkB,CAAA;IAClB,WAAA,qBAAqB,CAAA;IACrB,WAAA,wBAAwB,CAAA;IACxB,WAAA,sBAAsB,CAAA;IACtB,WAAA,eAAe,CAAA;IACf,WAAA,qBAAqB,CAAA;IACrB,WAAA,oBAAoB,CAAA;IACpB,WAAA,qBAAqB,CAAA;IACrB,YAAA,sBAAsB,CAAA;GA9BZ,oBAAoB,CA+WhC;;AAED,0BAA0B,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE;IAC/C,MAAM,sBAAsB,GAAG,CAAC,QAAgB,EAAE,KAAwB,EAAQ,EAAE;QACnF,IAAI,KAAK,EAAE,CAAC;YACX,SAAS,CAAC,OAAO,CAAC,kBAAkB,QAAQ,wBAAwB,KAAK,KAAK,CAAC,CAAC;QACjF,CAAC;IACF,CAAC,CAAC;IAEF,sBAAsB,CAAC,0BAA0B,EAAE,KAAK,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC,CAAC;IAC7F,MAAM,wBAAwB,GAAG,KAAK,CAAC,QAAQ,CAAC,8BAA8B,CAAC,CAAC;IAEhF,IAAI,wBAAwB,EAAE,CAAC;QAC9B,SAAS,CAAC,OAAO,CAAC,yDAAyD,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,IAAI,wBAAwB,6BAA6B,CAAC,CAAC;IACtL,CAAC;AACF,CAAC,CAAC,CAAC","file":"codeActionController.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 { getDomNodePagePosition } from '../../../../base/browser/dom.js';\nimport * as aria from '../../../../base/browser/ui/aria/aria.js';\nimport { IAnchor } from '../../../../base/browser/ui/contextview/contextview.js';\nimport { IAction } from '../../../../base/common/actions.js';\nimport { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { Color } from '../../../../base/common/color.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js';\nimport { Lazy } from '../../../../base/common/lazy.js';\nimport { Disposable, MutableDisposable } from '../../../../base/common/lifecycle.js';\nimport { localize } from '../../../../nls.js';\nimport { IActionListDelegate } from '../../../../platform/actionWidget/browser/actionList.js';\nimport { IActionWidgetService } from '../../../../platform/actionWidget/browser/actionWidget.js';\nimport { ICommandService } from '../../../../platform/commands/common/commands.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\nimport { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { IMarkerService } from '../../../../platform/markers/common/markers.js';\nimport { IEditorProgressService } from '../../../../platform/progress/common/progress.js';\nimport { editorFindMatchHighlight, editorFindMatchHighlightBorder } from '../../../../platform/theme/common/colorRegistry.js';\nimport { isHighContrast } from '../../../../platform/theme/common/theme.js';\nimport { registerThemingParticipant } from '../../../../platform/theme/common/themeService.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { IPosition, Position } from '../../../common/core/position.js';\nimport { IEditorContribution, ScrollType } from '../../../common/editorCommon.js';\nimport { CodeActionTriggerType } from '../../../common/languages.js';\nimport { IModelDeltaDecoration } from '../../../common/model.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { MessageController } from '../../message/browser/messageController.js';\nimport { CodeActionAutoApply, CodeActionFilter, CodeActionItem, CodeActionKind, CodeActionSet, CodeActionTrigger, CodeActionTriggerSource } from '../common/types.js';\nimport { ApplyCodeActionReason, applyCodeAction } from './codeAction.js';\nimport { CodeActionKeybindingResolver } from './codeActionKeybindingResolver.js';\nimport { toMenuItems } from './codeActionMenu.js';\nimport { CodeActionModel, CodeActionsState } from './codeActionModel.js';\nimport { LightBulbWidget } from './lightBulbWidget.js';\n\ninterface IActionShowOptions {\n\treadonly includeDisabledActions?: boolean;\n\treadonly fromLightbulb?: boolean;\n}\n\n\nconst DECORATION_CLASS_NAME = 'quickfix-edit-highlight';\n\nexport class CodeActionController extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.codeActionController';\n\n\tpublic static get(editor: ICodeEditor): CodeActionController | null {\n\t\treturn editor.getContribution<CodeActionController>(CodeActionController.ID);\n\t}\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _model: CodeActionModel;\n\n\tprivate readonly _lightBulbWidget: Lazy<LightBulbWidget | null>;\n\tprivate readonly _activeCodeActions = this._register(new MutableDisposable<CodeActionSet>());\n\tprivate _showDisabled = false;\n\n\tprivate readonly _resolver: CodeActionKeybindingResolver;\n\n\tprivate _disposed = false;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IMarkerService markerService: IMarkerService,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService,\n\t\t@IEditorProgressService progressService: IEditorProgressService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IActionWidgetService private readonly _actionWidgetService: IActionWidgetService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IEditorProgressService private readonly _progressService: IEditorProgressService,\n\t) {\n\t\tsuper();\n\n\t\tthis._editor = editor;\n\t\tthis._model = this._register(new CodeActionModel(this._editor, languageFeaturesService.codeActionProvider, markerService, contextKeyService, progressService, _configurationService));\n\t\tthis._register(this._model.onDidChangeState(newState => this.update(newState)));\n\n\t\tthis._lightBulbWidget = new Lazy(() => {\n\t\t\tconst widget = this._editor.getContribution<LightBulbWidget>(LightBulbWidget.ID);\n\t\t\tif (widget) {\n\t\t\t\tthis._register(widget.onClick(e => this.showCodeActionsFromLightbulb(e.actions, e)));\n\t\t\t}\n\t\t\treturn widget;\n\t\t});\n\n\t\tthis._resolver = instantiationService.createInstance(CodeActionKeybindingResolver);\n\n\t\tthis._register(this._editor.onDidLayoutChange(() => this._actionWidgetService.hide()));\n\t}\n\n\toverride dispose() {\n\t\tthis._disposed = true;\n\t\tsuper.dispose();\n\t}\n\n\tprivate async showCodeActionsFromLightbulb(actions: CodeActionSet, at: IAnchor | IPosition): Promise<void> {\n\t\tif (actions.allAIFixes && actions.validActions.length === 1) {\n\t\t\tconst actionItem = actions.validActions[0];\n\t\t\tconst command = actionItem.action.command;\n\t\t\tif (command && command.id === 'inlineChat.start') {\n\t\t\t\tif (command.arguments && command.arguments.length >= 1) {\n\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\t\tcommand.arguments[0] = { ...(command.arguments[0] as any), autoSend: false };\n\t\t\t\t}\n\t\t\t}\n\t\t\tawait this.applyCodeAction(actionItem, false, false, ApplyCodeActionReason.FromAILightbulb);\n\t\t\treturn;\n\t\t}\n\t\tawait this.showCodeActionList(actions, at, { includeDisabledActions: false, fromLightbulb: true });\n\t}\n\n\tpublic showCodeActions(_trigger: CodeActionTrigger, actions: CodeActionSet, at: IAnchor | IPosition) {\n\t\treturn this.showCodeActionList(actions, at, { includeDisabledActions: false, fromLightbulb: false });\n\t}\n\n\tpublic manualTriggerAtCurrentPosition(\n\t\tnotAvailableMessage: string,\n\t\ttriggerAction: CodeActionTriggerSource,\n\t\tfilter?: CodeActionFilter,\n\t\tautoApply?: CodeActionAutoApply,\n\t): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tMessageController.get(this._editor)?.closeMessage();\n\t\tconst triggerPosition = this._editor.getPosition();\n\t\tthis._trigger({ type: CodeActionTriggerType.Invoke, triggerAction, filter, autoApply, context: { notAvailableMessage, position: triggerPosition } });\n\t}\n\n\tprivate _trigger(trigger: CodeActionTrigger) {\n\t\treturn this._model.trigger(trigger);\n\t}\n\n\tasync applyCodeAction(action: CodeActionItem, retrigger: boolean, preview: boolean, actionReason: ApplyCodeActionReason): Promise<void> {\n\t\tconst progress = this._progressService.show(true, 500);\n\t\ttry {\n\t\t\tawait this._instantiationService.invokeFunction(applyCodeAction, action, actionReason, { preview, editor: this._editor });\n\t\t} finally {\n\t\t\tif (retrigger) {\n\t\t\t\tthis._trigger({ type: CodeActionTriggerType.Auto, triggerAction: CodeActionTriggerSource.QuickFix, filter: {} });\n\t\t\t}\n\t\t\tprogress.done();\n\t\t}\n\t}\n\n\tpublic hideLightBulbWidget(): void {\n\t\tthis._lightBulbWidget.rawValue?.hide();\n\t\tthis._lightBulbWidget.rawValue?.gutterHide();\n\t}\n\n\tprivate async update(newState: CodeActionsState.State): Promise<void> {\n\t\tif (newState.type !== CodeActionsState.Type.Triggered) {\n\t\t\tthis.hideLightBulbWidget();\n\t\t\treturn;\n\t\t}\n\n\t\tlet actions: CodeActionSet;\n\t\ttry {\n\t\t\tactions = await newState.actions;\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._disposed) {\n\t\t\treturn;\n\t\t}\n\n\n\t\tconst selection = this._editor.getSelection();\n\t\tif (selection?.startLineNumber !== newState.position.lineNumber) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._lightBulbWidget.value?.update(actions, newState.trigger, newState.position);\n\n\t\tif (newState.trigger.type === CodeActionTriggerType.Invoke) {\n\t\t\tif (newState.trigger.filter?.include) { // Triggered for specific scope\n\t\t\t\t// Check to see if we want to auto apply.\n\n\t\t\t\tconst validActionToApply = this.tryGetValidActionToApply(newState.trigger, actions);\n\t\t\t\tif (validActionToApply) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.hideLightBulbWidget();\n\t\t\t\t\t\tawait this.applyCodeAction(validActionToApply, false, false, ApplyCodeActionReason.FromCodeActions);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tactions.dispose();\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Check to see if there is an action that we would have applied were it not invalid\n\t\t\t\tif (newState.trigger.context) {\n\t\t\t\t\tconst invalidAction = this.getInvalidActionThatWouldHaveBeenApplied(newState.trigger, actions);\n\t\t\t\t\tif (invalidAction && invalidAction.action.disabled) {\n\t\t\t\t\t\tMessageController.get(this._editor)?.showMessage(invalidAction.action.disabled, newState.trigger.context.position);\n\t\t\t\t\t\tactions.dispose();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst includeDisabledActions = !!newState.trigger.filter?.include;\n\t\t\tif (newState.trigger.context) {\n\t\t\t\tif (!actions.allActions.length || !includeDisabledActions && !actions.validActions.length) {\n\t\t\t\t\tMessageController.get(this._editor)?.showMessage(newState.trigger.context.notAvailableMessage, newState.trigger.context.position);\n\t\t\t\t\tthis._activeCodeActions.value = actions;\n\t\t\t\t\tactions.dispose();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._activeCodeActions.value = actions;\n\t\t\tthis.showCodeActionList(actions, this.toCoords(newState.position), { includeDisabledActions, fromLightbulb: false });\n\t\t} else {\n\t\t\t// auto magically triggered\n\t\t\tif (this._actionWidgetService.isVisible) {\n\t\t\t\t// TODO: Figure out if we should update the showing menu?\n\t\t\t\tactions.dispose();\n\t\t\t} else {\n\t\t\t\tthis._activeCodeActions.value = actions;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getInvalidActionThatWouldHaveBeenApplied(trigger: CodeActionTrigger, actions: CodeActionSet): CodeActionItem | undefined {\n\t\tif (!actions.allActions.length) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif ((trigger.autoApply === CodeActionAutoApply.First && actions.validActions.length === 0)\n\t\t\t|| (trigger.autoApply === CodeActionAutoApply.IfSingle && actions.allActions.length === 1)\n\t\t) {\n\t\t\treturn actions.allActions.find(({ action }) => action.disabled);\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tprivate tryGetValidActionToApply(trigger: CodeActionTrigger, actions: CodeActionSet): CodeActionItem | undefined {\n\t\tif (!actions.validActions.length) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif ((trigger.autoApply === CodeActionAutoApply.First && actions.validActions.length > 0)\n\t\t\t|| (trigger.autoApply === CodeActionAutoApply.IfSingle && actions.validActions.length === 1)\n\t\t) {\n\t\t\treturn actions.validActions[0];\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tprivate static readonly DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'quickfix-highlight',\n\t\tclassName: DECORATION_CLASS_NAME\n\t});\n\n\tpublic async showCodeActionList(actions: CodeActionSet, at: IAnchor | IPosition, options: IActionShowOptions): Promise<void> {\n\n\t\tconst currentDecorations = this._editor.createDecorationsCollection();\n\n\t\tconst editorDom = this._editor.getDomNode();\n\t\tif (!editorDom) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst actionsToShow = options.includeDisabledActions && (this._showDisabled || actions.validActions.length === 0) ? actions.allActions : actions.validActions;\n\t\tif (!actionsToShow.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst anchor = Position.isIPosition(at) ? this.toCoords(at) : at;\n\n\t\tconst delegate: IActionListDelegate<CodeActionItem> = {\n\t\t\tonSelect: async (action: CodeActionItem, preview?: boolean) => {\n\t\t\t\tthis.applyCodeAction(action, /* retrigger */ true, !!preview, options.fromLightbulb ? ApplyCodeActionReason.FromAILightbulb : ApplyCodeActionReason.FromCodeActions);\n\t\t\t\tthis._actionWidgetService.hide(false);\n\t\t\t\tcurrentDecorations.clear();\n\t\t\t},\n\t\t\tonHide: (didCancel?) => {\n\t\t\t\tthis._editor?.focus();\n\t\t\t\tcurrentDecorations.clear();\n\t\t\t},\n\t\t\tonHover: async (action: CodeActionItem, token: CancellationToken) => {\n\t\t\t\tif (token.isCancellationRequested) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet canPreview = false;\n\t\t\t\tconst actionKind = action.action.kind;\n\n\t\t\t\tif (actionKind) {\n\t\t\t\t\tconst hierarchicalKind = new HierarchicalKind(actionKind);\n\t\t\t\t\tconst refactorKinds = [\n\t\t\t\t\t\tCodeActionKind.RefactorExtract,\n\t\t\t\t\t\tCodeActionKind.RefactorInline,\n\t\t\t\t\t\tCodeActionKind.RefactorRewrite,\n\t\t\t\t\t\tCodeActionKind.RefactorMove,\n\t\t\t\t\t\tCodeActionKind.Source\n\t\t\t\t\t];\n\n\t\t\t\t\tcanPreview = refactorKinds.some(refactorKind => refactorKind.contains(hierarchicalKind));\n\t\t\t\t}\n\n\t\t\t\treturn { canPreview: canPreview || !!action.action.edit?.edits.length };\n\t\t\t},\n\t\t\tonFocus: (action: CodeActionItem | undefined) => {\n\t\t\t\tif (action && action.action) {\n\t\t\t\t\tconst ranges = action.action.ranges;\n\t\t\t\t\tconst diagnostics = action.action.diagnostics;\n\t\t\t\t\tcurrentDecorations.clear();\n\t\t\t\t\tif (ranges && ranges.length > 0) {\n\t\t\t\t\t\t// Handles case for `fix all` where there are multiple diagnostics.\n\t\t\t\t\t\tconst decorations: IModelDeltaDecoration[] = (diagnostics && diagnostics?.length > 1)\n\t\t\t\t\t\t\t? diagnostics.map(diagnostic => ({ range: diagnostic, options: CodeActionController.DECORATION }))\n\t\t\t\t\t\t\t: ranges.map(range => ({ range, options: CodeActionController.DECORATION }));\n\t\t\t\t\t\tcurrentDecorations.set(decorations);\n\t\t\t\t\t} else if (diagnostics && diagnostics.length > 0) {\n\t\t\t\t\t\tconst decorations: IModelDeltaDecoration[] = diagnostics.map(diagnostic => ({ range: diagnostic, options: CodeActionController.DECORATION }));\n\t\t\t\t\t\tcurrentDecorations.set(decorations);\n\t\t\t\t\t\tconst diagnostic = diagnostics[0];\n\t\t\t\t\t\tif (diagnostic.startLineNumber && diagnostic.startColumn) {\n\t\t\t\t\t\t\tconst selectionText = this._editor.getModel()?.getWordAtPosition({ lineNumber: diagnostic.startLineNumber, column: diagnostic.startColumn })?.word;\n\t\t\t\t\t\t\taria.status(localize('editingNewSelection', \"Context: {0} at line {1} and column {2}.\", selectionText, diagnostic.startLineNumber, diagnostic.startColumn));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tcurrentDecorations.clear();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tthis._actionWidgetService.show(\n\t\t\t'codeActionWidget',\n\t\t\ttrue,\n\t\t\ttoMenuItems(actionsToShow, this._shouldShowHeaders(), this._resolver.getResolver()),\n\t\t\tdelegate,\n\t\t\tanchor,\n\t\t\teditorDom,\n\t\t\tthis._getActionBarActions(actions, at, options));\n\t}\n\n\tprivate toCoords(position: IPosition): IAnchor {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn { x: 0, y: 0 };\n\t\t}\n\n\t\tthis._editor.revealPosition(position, ScrollType.Immediate);\n\t\tthis._editor.render();\n\n\t\t// Translate to absolute editor position\n\t\tconst cursorCoords = this._editor.getScrolledVisiblePosition(position);\n\t\tconst editorCoords = getDomNodePagePosition(this._editor.getDomNode());\n\t\tconst x = editorCoords.left + cursorCoords.left;\n\t\tconst y = editorCoords.top + cursorCoords.top + cursorCoords.height;\n\n\t\treturn { x, y };\n\t}\n\n\tprivate _shouldShowHeaders(): boolean {\n\t\tconst model = this._editor?.getModel();\n\t\treturn this._configurationService.getValue('editor.codeActionWidget.showHeaders', { resource: model?.uri });\n\t}\n\n\tprivate _getActionBarActions(actions: CodeActionSet, at: IAnchor | IPosition, options: IActionShowOptions): IAction[] {\n\t\tif (options.fromLightbulb) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst resultActions = actions.documentation.map((command): IAction => ({\n\t\t\tid: command.id,\n\t\t\tlabel: command.title,\n\t\t\ttooltip: command.tooltip ?? '',\n\t\t\tclass: undefined,\n\t\t\tenabled: true,\n\t\t\trun: () => this._commandService.executeCommand(command.id, ...(command.arguments ?? [])),\n\t\t}));\n\n\t\tif (options.includeDisabledActions && actions.validActions.length > 0 && actions.allActions.length !== actions.validActions.length) {\n\t\t\tresultActions.push(this._showDisabled ? {\n\t\t\t\tid: 'hideMoreActions',\n\t\t\t\tlabel: localize('hideMoreActions', 'Hide Disabled'),\n\t\t\t\tenabled: true,\n\t\t\t\ttooltip: '',\n\t\t\t\tclass: undefined,\n\t\t\t\trun: () => {\n\t\t\t\t\tthis._showDisabled = false;\n\t\t\t\t\treturn this.showCodeActionList(actions, at, options);\n\t\t\t\t}\n\t\t\t} : {\n\t\t\t\tid: 'showMoreActions',\n\t\t\t\tlabel: localize('showMoreActions', 'Show Disabled'),\n\t\t\t\tenabled: true,\n\t\t\t\ttooltip: '',\n\t\t\t\tclass: undefined,\n\t\t\t\trun: () => {\n\t\t\t\t\tthis._showDisabled = true;\n\t\t\t\t\treturn this.showCodeActionList(actions, at, options);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn resultActions;\n\t}\n}\n\nregisterThemingParticipant((theme, collector) => {\n\tconst addBackgroundColorRule = (selector: string, color: Color | undefined): void => {\n\t\tif (color) {\n\t\t\tcollector.addRule(`.monaco-editor ${selector} { background-color: ${color}; }`);\n\t\t}\n\t};\n\n\taddBackgroundColorRule('.quickfix-edit-highlight', theme.getColor(editorFindMatchHighlight));\n\tconst findMatchHighlightBorder = theme.getColor(editorFindMatchHighlightBorder);\n\n\tif (findMatchHighlightBorder) {\n\t\tcollector.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${isHighContrast(theme.type) ? 'dotted' : 'solid'} ${findMatchHighlightBorder}; box-sizing: border-box; }`);\n\t}\n});\n"]}
@@ -16,7 +16,7 @@ import { onUnexpectedError, onUnexpectedExternalError } from '../../../../base/c
16
16
  import { DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js';
17
17
  import { StableEditorScrollState } from '../../../browser/stableEditorScroll.js';
18
18
  import { EditorAction, registerEditorAction, registerEditorContribution } from '../../../browser/editorExtensions.js';
19
- import { EDITOR_FONT_DEFAULTS } from '../../../common/config/editorOptions.js';
19
+ import { EDITOR_FONT_DEFAULTS } from '../../../common/config/fontInfo.js';
20
20
  import { EditorContextKeys } from '../../../common/editorContextKeys.js';
21
21
  import { getCodeLensModel } from './codelens.js';
22
22
  import { ICodeLensCache } from './codeLensCache.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["vs/editor/contrib/codelens/browser/codelensController.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAGhG,OAAO,EAAqB,uBAAuB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACnI,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AACjG,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAmC,oBAAoB,EAAE,0BAA0B,EAAoB,MAAM,sCAAsC,CAAC;AACzK,OAAO,EAAgB,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAE7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAGzE,OAAO,EAA+B,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0DAA0D,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAC1F,OAAO,EAA+B,+BA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AAO,CAAC,KAAK,CAAC,CAAC;YAChJ,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACzC,OAAO;YACR,CAAC;YACD,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;QAClC,CAAC;QAED,IAAI,CAAC;YACJ,MAAM,cAAc,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,EAAE,GAAG,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,CAAC;QAC/E,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChC,CAAC;IACF,CAAC;CACD,CAAC,CAAC","file":"codelensController.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\n\nimport { CancelablePromise, createCancelablePromise, disposableTimeout, RunOnceScheduler } from '../../../../base/common/async.js';\nimport { onUnexpectedError, onUnexpectedExternalError } from '../../../../base/common/errors.js';\nimport { DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { StableEditorScrollState } from '../../../browser/stableEditorScroll.js';\nimport { IActiveCodeEditor, ICodeEditor, IViewZoneChangeAccessor, MouseTargetType } from '../../../browser/editorBrowser.js';\nimport { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from '../../../browser/editorExtensions.js';\nimport { EditorOption, EDITOR_FONT_DEFAULTS } from '../../../common/config/editorOptions.js';\nimport { IEditorContribution } from '../../../common/editorCommon.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { IModelDecorationsChangeAccessor } from '../../../common/model.js';\nimport { CodeLens, Command } from '../../../common/languages.js';\nimport { CodeLensItem, CodeLensModel, getCodeLensModel } from './codelens.js';\nimport { ICodeLensCache } from './codeLensCache.js';\nimport { CodeLensHelper, CodeLensWidget } from './codelensWidget.js';\nimport { localize, localize2 } from '../../../../nls.js';\nimport { ICommandService } from '../../../../platform/commands/common/commands.js';\nimport { INotificationService } from '../../../../platform/notification/common/notification.js';\nimport { IQuickInputService } from '../../../../platform/quickinput/common/quickInput.js';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\n\nexport class CodeLensContribution implements IEditorContribution {\n\n\tstatic readonly ID: string = 'css.editor.codeLens';\n\n\tprivate readonly _disposables = new DisposableStore();\n\tprivate readonly _localToDispose = new DisposableStore();\n\n\tprivate readonly _lenses: CodeLensWidget[] = [];\n\n\tprivate readonly _provideCodeLensDebounce: IFeatureDebounceInformation;\n\tprivate readonly _resolveCodeLensesDebounce: IFeatureDebounceInformation;\n\tprivate readonly _resolveCodeLensesScheduler: RunOnceScheduler;\n\n\tprivate _getCodeLensModelPromise: CancelablePromise<CodeLensModel> | undefined;\n\tprivate readonly _oldCodeLensModels = new DisposableStore();\n\tprivate _currentCodeLensModel: CodeLensModel | undefined;\n\tprivate _resolveCodeLensesPromise: CancelablePromise<any> | undefined;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService debounceService: ILanguageFeatureDebounceService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@INotificationService private readonly _notificationService: INotificationService,\n\t\t@ICodeLensCache private readonly _codeLensCache: ICodeLensCache\n\t) {\n\t\tthis._provideCodeLensDebounce = debounceService.for(_languageFeaturesService.codeLensProvider, 'CodeLensProvide', { min: 250 });\n\t\tthis._resolveCodeLensesDebounce = debounceService.for(_languageFeaturesService.codeLensProvider, 'CodeLensResolve', { min: 250, salt: 'resolve' });\n\t\tthis._resolveCodeLensesScheduler = new RunOnceScheduler(() => this._resolveCodeLensesInViewport(), this._resolveCodeLensesDebounce.default());\n\n\t\tthis._disposables.add(this._editor.onDidChangeModel(() => this._onModelChange()));\n\t\tthis._disposables.add(this._editor.onDidChangeModelLanguage(() => this._onModelChange()));\n\t\tthis._disposables.add(this._editor.onDidChangeConfiguration((e) => {\n\t\t\tif (e.hasChanged(EditorOption.fontInfo) || e.hasChanged(EditorOption.codeLensFontSize) || e.hasChanged(EditorOption.codeLensFontFamily)) {\n\t\t\t\tthis._updateLensStyle();\n\t\t\t}\n\t\t\tif (e.hasChanged(EditorOption.codeLens)) {\n\t\t\t\tthis._onModelChange();\n\t\t\t}\n\t\t}));\n\t\tthis._disposables.add(_languageFeaturesService.codeLensProvider.onDidChange(this._onModelChange, this));\n\t\tthis._onModelChange();\n\n\t\tthis._updateLensStyle();\n\t}\n\n\tdispose(): void {\n\t\tthis._localDispose();\n\t\tthis._localToDispose.dispose();\n\t\tthis._disposables.dispose();\n\t\tthis._oldCodeLensModels.dispose();\n\t\tthis._currentCodeLensModel?.dispose();\n\t}\n\n\tprivate _getLayoutInfo() {\n\t\tconst lineHeightFactor = Math.max(1.3, this._editor.getOption(EditorOption.lineHeight) / this._editor.getOption(EditorOption.fontSize));\n\t\tlet fontSize = this._editor.getOption(EditorOption.codeLensFontSize);\n\t\tif (!fontSize || fontSize < 5) {\n\t\t\tfontSize = (this._editor.getOption(EditorOption.fontSize) * .9) | 0;\n\t\t}\n\t\treturn {\n\t\t\tfontSize,\n\t\t\tcodeLensHeight: (fontSize * lineHeightFactor) | 0,\n\t\t};\n\t}\n\n\tprivate _updateLensStyle(): void {\n\n\t\tconst { codeLensHeight, fontSize } = this._getLayoutInfo();\n\t\tconst fontFamily = this._editor.getOption(EditorOption.codeLensFontFamily);\n\t\tconst editorFontInfo = this._editor.getOption(EditorOption.fontInfo);\n\n\t\tconst { style } = this._editor.getContainerDomNode();\n\n\t\tstyle.setProperty('--vscode-editorCodeLens-lineHeight', `${codeLensHeight}px`);\n\t\tstyle.setProperty('--vscode-editorCodeLens-fontSize', `${fontSize}px`);\n\t\tstyle.setProperty('--vscode-editorCodeLens-fontFeatureSettings', editorFontInfo.fontFeatureSettings);\n\n\t\tif (fontFamily) {\n\t\t\tstyle.setProperty('--vscode-editorCodeLens-fontFamily', fontFamily);\n\t\t\tstyle.setProperty('--vscode-editorCodeLens-fontFamilyDefault', EDITOR_FONT_DEFAULTS.fontFamily);\n\t\t}\n\n\t\t//\n\t\tthis._editor.changeViewZones(accessor => {\n\t\t\tfor (const lens of this._lenses) {\n\t\t\t\tlens.updateHeight(codeLensHeight, accessor);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _localDispose(): void {\n\t\tthis._getCodeLensModelPromise?.cancel();\n\t\tthis._getCodeLensModelPromise = undefined;\n\t\tthis._resolveCodeLensesPromise?.cancel();\n\t\tthis._resolveCodeLensesPromise = undefined;\n\t\tthis._localToDispose.clear();\n\t\tthis._oldCodeLensModels.clear();\n\t\tthis._currentCodeLensModel?.dispose();\n\t}\n\n\tprivate _onModelChange(): void {\n\n\t\tthis._localDispose();\n\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._editor.getOption(EditorOption.codeLens) || model.isTooLargeForTokenization()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst cachedLenses = this._codeLensCache.get(model);\n\t\tif (cachedLenses) {\n\t\t\tthis._renderCodeLensSymbols(cachedLenses);\n\t\t}\n\n\t\tif (!this._languageFeaturesService.codeLensProvider.has(model)) {\n\t\t\t// no provider -> return but check with\n\t\t\t// cached lenses. they expire after 30 seconds\n\t\t\tif (cachedLenses) {\n\t\t\t\tdisposableTimeout(() => {\n\t\t\t\t\tconst cachedLensesNow = this._codeLensCache.get(model);\n\t\t\t\t\tif (cachedLenses === cachedLensesNow) {\n\t\t\t\t\t\tthis._codeLensCache.delete(model);\n\t\t\t\t\t\tthis._onModelChange();\n\t\t\t\t\t}\n\t\t\t\t}, 30 * 1000, this._localToDispose);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const provider of this._languageFeaturesService.codeLensProvider.all(model)) {\n\t\t\tif (typeof provider.onDidChange === 'function') {\n\t\t\t\tconst registration = provider.onDidChange(() => scheduler.schedule());\n\t\t\t\tthis._localToDispose.add(registration);\n\t\t\t}\n\t\t}\n\n\t\tconst scheduler = new RunOnceScheduler(() => {\n\t\t\tconst t1 = Date.now();\n\n\t\t\tthis._getCodeLensModelPromise?.cancel();\n\t\t\tthis._getCodeLensModelPromise = createCancelablePromise(token => getCodeLensModel(this._languageFeaturesService.codeLensProvider, model, token));\n\n\t\t\tthis._getCodeLensModelPromise.then(result => {\n\t\t\t\tif (this._currentCodeLensModel) {\n\t\t\t\t\tthis._oldCodeLensModels.add(this._currentCodeLensModel);\n\t\t\t\t}\n\t\t\t\tthis._currentCodeLensModel = result;\n\n\t\t\t\t// cache model to reduce flicker\n\t\t\t\tthis._codeLensCache.put(model, result);\n\n\t\t\t\t// update moving average\n\t\t\t\tconst newDelay = this._provideCodeLensDebounce.update(model, Date.now() - t1);\n\t\t\t\tscheduler.delay = newDelay;\n\n\t\t\t\t// render lenses\n\t\t\t\tthis._renderCodeLensSymbols(result);\n\t\t\t\t// dom.scheduleAtNextAnimationFrame(() => this._resolveCodeLensesInViewport());\n\t\t\t\tthis._resolveCodeLensesInViewportSoon();\n\t\t\t}, onUnexpectedError);\n\n\t\t}, this._provideCodeLensDebounce.get(model));\n\n\t\tthis._localToDispose.add(scheduler);\n\t\tthis._localToDispose.add(toDisposable(() => this._resolveCodeLensesScheduler.cancel()));\n\t\tthis._localToDispose.add(this._editor.onDidChangeModelContent(() => {\n\t\t\tthis._editor.changeDecorations(decorationsAccessor => {\n\t\t\t\tthis._editor.changeViewZones(viewZonesAccessor => {\n\t\t\t\t\tconst toDispose: CodeLensWidget[] = [];\n\t\t\t\t\tlet lastLensLineNumber: number = -1;\n\n\t\t\t\t\tthis._lenses.forEach((lens) => {\n\t\t\t\t\t\tif (!lens.isValid() || lastLensLineNumber === lens.getLineNumber()) {\n\t\t\t\t\t\t\t// invalid -> lens collapsed, attach range doesn't exist anymore\n\t\t\t\t\t\t\t// line_number -> lenses should never be on the same line\n\t\t\t\t\t\t\ttoDispose.push(lens);\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlens.update(viewZonesAccessor);\n\t\t\t\t\t\t\tlastLensLineNumber = lens.getLineNumber();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tconst helper = new CodeLensHelper();\n\t\t\t\t\ttoDispose.forEach((l) => {\n\t\t\t\t\t\tl.dispose(helper, viewZonesAccessor);\n\t\t\t\t\t\tthis._lenses.splice(this._lenses.indexOf(l), 1);\n\t\t\t\t\t});\n\t\t\t\t\thelper.commit(decorationsAccessor);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// Ask for all references again\n\t\t\tscheduler.schedule();\n\n\t\t\t// Cancel pending and active resolve requests\n\t\t\tthis._resolveCodeLensesScheduler.cancel();\n\t\t\tthis._resolveCodeLensesPromise?.cancel();\n\t\t\tthis._resolveCodeLensesPromise = undefined;\n\t\t}));\n\t\tthis._localToDispose.add(this._editor.onDidFocusEditorText(() => {\n\t\t\tscheduler.schedule();\n\t\t}));\n\t\tthis._localToDispose.add(this._editor.onDidBlurEditorText(() => {\n\t\t\tscheduler.cancel();\n\t\t}));\n\t\tthis._localToDispose.add(this._editor.onDidScrollChange(e => {\n\t\t\tif (e.scrollTopChanged && this._lenses.length > 0) {\n\t\t\t\tthis._resolveCodeLensesInViewportSoon();\n\t\t\t}\n\t\t}));\n\t\tthis._localToDispose.add(this._editor.onDidLayoutChange(() => {\n\t\t\tthis._resolveCodeLensesInViewportSoon();\n\t\t}));\n\t\tthis._localToDispose.add(toDisposable(() => {\n\t\t\tif (this._editor.getModel()) {\n\t\t\t\tconst scrollState = StableEditorScrollState.capture(this._editor);\n\t\t\t\tthis._editor.changeDecorations(decorationsAccessor => {\n\t\t\t\t\tthis._editor.changeViewZones(viewZonesAccessor => {\n\t\t\t\t\t\tthis._disposeAllLenses(decorationsAccessor, viewZonesAccessor);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tscrollState.restore(this._editor);\n\t\t\t} else {\n\t\t\t\t// No accessors available\n\t\t\t\tthis._disposeAllLenses(undefined, undefined);\n\t\t\t}\n\t\t}));\n\t\tthis._localToDispose.add(this._editor.onMouseDown(e => {\n\t\t\tif (e.target.type !== MouseTargetType.CONTENT_WIDGET) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet target = e.target.element;\n\t\t\tif (target?.tagName === 'SPAN') {\n\t\t\t\ttarget = target.parentElement;\n\t\t\t}\n\t\t\tif (target?.tagName === 'A') {\n\t\t\t\tfor (const lens of this._lenses) {\n\t\t\t\t\tconst command = lens.getCommand(target as HTMLLinkElement);\n\t\t\t\t\tif (command) {\n\t\t\t\t\t\tthis._commandService.executeCommand(command.id, ...(command.arguments || [])).catch(err => this._notificationService.error(err));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t\tscheduler.schedule();\n\t}\n\n\tprivate _disposeAllLenses(decChangeAccessor: IModelDecorationsChangeAccessor | undefined, viewZoneChangeAccessor: IViewZoneChangeAccessor | undefined): void {\n\t\tconst helper = new CodeLensHelper();\n\t\tfor (const lens of this._lenses) {\n\t\t\tlens.dispose(helper, viewZoneChangeAccessor);\n\t\t}\n\t\tif (decChangeAccessor) {\n\t\t\thelper.commit(decChangeAccessor);\n\t\t}\n\t\tthis._lenses.length = 0;\n\t}\n\n\tprivate _renderCodeLensSymbols(symbols: CodeLensModel): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst maxLineNumber = this._editor.getModel().getLineCount();\n\t\tconst groups: CodeLensItem[][] = [];\n\t\tlet lastGroup: CodeLensItem[] | undefined;\n\n\t\tfor (const symbol of symbols.lenses) {\n\t\t\tconst line = symbol.symbol.range.startLineNumber;\n\t\t\tif (line < 1 || line > maxLineNumber) {\n\t\t\t\t// invalid code lens\n\t\t\t\tcontinue;\n\t\t\t} else if (lastGroup && lastGroup[lastGroup.length - 1].symbol.range.startLineNumber === line) {\n\t\t\t\t// on same line as previous\n\t\t\t\tlastGroup.push(symbol);\n\t\t\t} else {\n\t\t\t\t// on later line as previous\n\t\t\t\tlastGroup = [symbol];\n\t\t\t\tgroups.push(lastGroup);\n\t\t\t}\n\t\t}\n\n\t\tif (!groups.length && !this._lenses.length) {\n\t\t\t// Nothing to change\n\t\t\treturn;\n\t\t}\n\n\t\tconst scrollState = StableEditorScrollState.capture(this._editor);\n\t\tconst layoutInfo = this._getLayoutInfo();\n\n\t\tthis._editor.changeDecorations(decorationsAccessor => {\n\t\t\tthis._editor.changeViewZones(viewZoneAccessor => {\n\n\t\t\t\tconst helper = new CodeLensHelper();\n\t\t\t\tlet codeLensIndex = 0;\n\t\t\t\tlet groupsIndex = 0;\n\n\t\t\t\twhile (groupsIndex < groups.length && codeLensIndex < this._lenses.length) {\n\n\t\t\t\t\tconst symbolsLineNumber = groups[groupsIndex][0].symbol.range.startLineNumber;\n\t\t\t\t\tconst codeLensLineNumber = this._lenses[codeLensIndex].getLineNumber();\n\n\t\t\t\t\tif (codeLensLineNumber < symbolsLineNumber) {\n\t\t\t\t\t\tthis._lenses[codeLensIndex].dispose(helper, viewZoneAccessor);\n\t\t\t\t\t\tthis._lenses.splice(codeLensIndex, 1);\n\t\t\t\t\t} else if (codeLensLineNumber === symbolsLineNumber) {\n\t\t\t\t\t\tthis._lenses[codeLensIndex].updateCodeLensSymbols(groups[groupsIndex], helper);\n\t\t\t\t\t\tgroupsIndex++;\n\t\t\t\t\t\tcodeLensIndex++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._lenses.splice(codeLensIndex, 0, new CodeLensWidget(groups[groupsIndex], <IActiveCodeEditor>this._editor, helper, viewZoneAccessor, layoutInfo.codeLensHeight, () => this._resolveCodeLensesInViewportSoon()));\n\t\t\t\t\t\tcodeLensIndex++;\n\t\t\t\t\t\tgroupsIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Delete extra code lenses\n\t\t\t\twhile (codeLensIndex < this._lenses.length) {\n\t\t\t\t\tthis._lenses[codeLensIndex].dispose(helper, viewZoneAccessor);\n\t\t\t\t\tthis._lenses.splice(codeLensIndex, 1);\n\t\t\t\t}\n\n\t\t\t\t// Create extra symbols\n\t\t\t\twhile (groupsIndex < groups.length) {\n\t\t\t\t\tthis._lenses.push(new CodeLensWidget(groups[groupsIndex], <IActiveCodeEditor>this._editor, helper, viewZoneAccessor, layoutInfo.codeLensHeight, () => this._resolveCodeLensesInViewportSoon()));\n\t\t\t\t\tgroupsIndex++;\n\t\t\t\t}\n\n\t\t\t\thelper.commit(decorationsAccessor);\n\t\t\t});\n\t\t});\n\n\t\tscrollState.restore(this._editor);\n\t}\n\n\tprivate _resolveCodeLensesInViewportSoon(): void {\n\t\tconst model = this._editor.getModel();\n\t\tif (model) {\n\t\t\tthis._resolveCodeLensesScheduler.schedule();\n\t\t}\n\t}\n\n\tprivate _resolveCodeLensesInViewport(): void {\n\n\t\tthis._resolveCodeLensesPromise?.cancel();\n\t\tthis._resolveCodeLensesPromise = undefined;\n\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst toResolve: Array<ReadonlyArray<CodeLensItem>> = [];\n\t\tconst lenses: CodeLensWidget[] = [];\n\t\tthis._lenses.forEach((lens) => {\n\t\t\tconst request = lens.computeIfNecessary(model);\n\t\t\tif (request) {\n\t\t\t\ttoResolve.push(request);\n\t\t\t\tlenses.push(lens);\n\t\t\t}\n\t\t});\n\n\t\tif (toResolve.length === 0) {\n\t\t\tthis._oldCodeLensModels.clear();\n\t\t\treturn;\n\t\t}\n\n\t\tconst t1 = Date.now();\n\n\t\tconst resolvePromise = createCancelablePromise(token => {\n\n\t\t\tconst promises = toResolve.map((request, i) => {\n\n\t\t\t\tconst resolvedSymbols = new Array<CodeLens | undefined | null>(request.length);\n\t\t\t\tconst promises = request.map((request, i) => {\n\t\t\t\t\tif (!request.symbol.command && typeof request.provider.resolveCodeLens === 'function') {\n\t\t\t\t\t\treturn Promise.resolve(request.provider.resolveCodeLens(model, request.symbol, token)).then(symbol => {\n\t\t\t\t\t\t\tresolvedSymbols[i] = symbol;\n\t\t\t\t\t\t}, onUnexpectedExternalError);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresolvedSymbols[i] = request.symbol;\n\t\t\t\t\t\treturn Promise.resolve(undefined);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn Promise.all(promises).then(() => {\n\t\t\t\t\tif (!token.isCancellationRequested && !lenses[i].isDisposed()) {\n\t\t\t\t\t\tlenses[i].updateCommands(resolvedSymbols);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t\treturn Promise.all(promises);\n\t\t});\n\t\tthis._resolveCodeLensesPromise = resolvePromise;\n\n\t\tthis._resolveCodeLensesPromise.then(() => {\n\n\t\t\t// update moving average\n\t\t\tconst newDelay = this._resolveCodeLensesDebounce.update(model, Date.now() - t1);\n\t\t\tthis._resolveCodeLensesScheduler.delay = newDelay;\n\n\t\t\tif (this._currentCodeLensModel) { // update the cached state with new resolved items\n\t\t\t\tthis._codeLensCache.put(model, this._currentCodeLensModel);\n\t\t\t}\n\t\t\tthis._oldCodeLensModels.clear(); // dispose old models once we have updated the UI with the current model\n\t\t\tif (resolvePromise === this._resolveCodeLensesPromise) {\n\t\t\t\tthis._resolveCodeLensesPromise = undefined;\n\t\t\t}\n\t\t}, err => {\n\t\t\tonUnexpectedError(err); // can also be cancellation!\n\t\t\tif (resolvePromise === this._resolveCodeLensesPromise) {\n\t\t\t\tthis._resolveCodeLensesPromise = undefined;\n\t\t\t}\n\t\t});\n\t}\n\n\tasync getModel(): Promise<CodeLensModel | undefined> {\n\t\tawait this._getCodeLensModelPromise;\n\t\tawait this._resolveCodeLensesPromise;\n\t\treturn !this._currentCodeLensModel?.isDisposed\n\t\t\t? this._currentCodeLensModel\n\t\t\t: undefined;\n\t}\n}\n\nregisterEditorContribution(CodeLensContribution.ID, CodeLensContribution, EditorContributionInstantiation.AfterFirstRender);\n\nregisterEditorAction(class ShowLensesInCurrentLine extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'codelens.showLensesInCurrentLine',\n\t\t\tprecondition: EditorContextKeys.hasCodeLensProvider,\n\t\t\tlabel: localize2('showLensOnLine', \"Show CodeLens Commands for Current Line\"),\n\t\t});\n\t}\n\n\tasync run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst quickInputService = accessor.get(IQuickInputService);\n\t\tconst commandService = accessor.get(ICommandService);\n\t\tconst notificationService = accessor.get(INotificationService);\n\n\t\tconst lineNumber = editor.getSelection().positionLineNumber;\n\t\tconst codelensController = editor.getContribution<CodeLensContribution>(CodeLensContribution.ID);\n\t\tif (!codelensController) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = await codelensController.getModel();\n\t\tif (!model) {\n\t\t\t// nothing\n\t\t\treturn;\n\t\t}\n\n\t\tconst items: { label: string; command: Command }[] = [];\n\t\tfor (const lens of model.lenses) {\n\t\t\tif (lens.symbol.command && lens.symbol.range.startLineNumber === lineNumber) {\n\t\t\t\titems.push({\n\t\t\t\t\tlabel: lens.symbol.command.title,\n\t\t\t\t\tcommand: lens.symbol.command\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (items.length === 0) {\n\t\t\t// We dont want an empty picker\n\t\t\treturn;\n\t\t}\n\n\t\tconst item = await quickInputService.pick(items, {\n\t\t\tcanPickMany: false,\n\t\t\tplaceHolder: localize('placeHolder', \"Select a command\")\n\t\t});\n\t\tif (!item) {\n\t\t\t// Nothing picked\n\t\t\treturn;\n\t\t}\n\n\t\tlet command = item.command;\n\n\t\tif (model.isDisposed) {\n\t\t\t// try to find the same command again in-case the model has been re-created in the meantime\n\t\t\t// this is a best attempt approach which shouldn't be needed because eager model re-creates\n\t\t\t// shouldn't happen due to focus in/out anymore\n\t\t\tconst newModel = await codelensController.getModel();\n\t\t\tconst newLens = newModel?.lenses.find(lens => lens.symbol.range.startLineNumber === lineNumber && lens.symbol.command?.title === command.title);\n\t\t\tif (!newLens || !newLens.symbol.command) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcommand = newLens.symbol.command;\n\t\t}\n\n\t\ttry {\n\t\t\tawait commandService.executeCommand(command.id, ...(command.arguments || []));\n\t\t} catch (err) {\n\t\t\tnotificationService.error(err);\n\t\t}\n\t}\n});\n"]}
1
+ {"version":3,"sources":["vs/editor/contrib/codelens/browser/codelensController.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAGhG,OAAO,EAAqB,uBAAuB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACnI,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AACjG,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAmC,oBAAoB,EAAE,0BAA0B,EAAoB,MAAM,sCAAsC,CAAC;AAEzK,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAGzE,OAAO,EAA+B,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EA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,kBAAkB,CAAC,QAAQ,EAAE,CAAC;YACrD,MAAM,OAAO,GAAG,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,KAAK,UAAU,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,KAAK,OAAO,CAAC,KAAK,CAAC,CAAC;YAChJ,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACzC,OAAO;YACR,CAAC;YACD,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;QAClC,CAAC;QAED,IAAI,CAAC;YACJ,MAAM,cAAc,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,EAAE,GAAG,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,CAAC;QAC/E,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChC,CAAC;IACF,CAAC;CACD,CAAC,CAAC","file":"codelensController.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\n\nimport { CancelablePromise, createCancelablePromise, disposableTimeout, RunOnceScheduler } from '../../../../base/common/async.js';\nimport { onUnexpectedError, onUnexpectedExternalError } from '../../../../base/common/errors.js';\nimport { DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { StableEditorScrollState } from '../../../browser/stableEditorScroll.js';\nimport { IActiveCodeEditor, ICodeEditor, IViewZoneChangeAccessor, MouseTargetType } from '../../../browser/editorBrowser.js';\nimport { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from '../../../browser/editorExtensions.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { EDITOR_FONT_DEFAULTS } from '../../../common/config/fontInfo.js';\nimport { IEditorContribution } from '../../../common/editorCommon.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { IModelDecorationsChangeAccessor } from '../../../common/model.js';\nimport { CodeLens, Command } from '../../../common/languages.js';\nimport { CodeLensItem, CodeLensModel, getCodeLensModel } from './codelens.js';\nimport { ICodeLensCache } from './codeLensCache.js';\nimport { CodeLensHelper, CodeLensWidget } from './codelensWidget.js';\nimport { localize, localize2 } from '../../../../nls.js';\nimport { ICommandService } from '../../../../platform/commands/common/commands.js';\nimport { INotificationService } from '../../../../platform/notification/common/notification.js';\nimport { IQuickInputService } from '../../../../platform/quickinput/common/quickInput.js';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\n\nexport class CodeLensContribution implements IEditorContribution {\n\n\tstatic readonly ID: string = 'css.editor.codeLens';\n\n\tprivate readonly _disposables = new DisposableStore();\n\tprivate readonly _localToDispose = new DisposableStore();\n\n\tprivate readonly _lenses: CodeLensWidget[] = [];\n\n\tprivate readonly _provideCodeLensDebounce: IFeatureDebounceInformation;\n\tprivate readonly _resolveCodeLensesDebounce: IFeatureDebounceInformation;\n\tprivate readonly _resolveCodeLensesScheduler: RunOnceScheduler;\n\n\tprivate _getCodeLensModelPromise: CancelablePromise<CodeLensModel> | undefined;\n\tprivate readonly _oldCodeLensModels = new DisposableStore();\n\tprivate _currentCodeLensModel: CodeLensModel | undefined;\n\tprivate _resolveCodeLensesPromise: CancelablePromise<any> | undefined;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService debounceService: ILanguageFeatureDebounceService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@INotificationService private readonly _notificationService: INotificationService,\n\t\t@ICodeLensCache private readonly _codeLensCache: ICodeLensCache\n\t) {\n\t\tthis._provideCodeLensDebounce = debounceService.for(_languageFeaturesService.codeLensProvider, 'CodeLensProvide', { min: 250 });\n\t\tthis._resolveCodeLensesDebounce = debounceService.for(_languageFeaturesService.codeLensProvider, 'CodeLensResolve', { min: 250, salt: 'resolve' });\n\t\tthis._resolveCodeLensesScheduler = new RunOnceScheduler(() => this._resolveCodeLensesInViewport(), this._resolveCodeLensesDebounce.default());\n\n\t\tthis._disposables.add(this._editor.onDidChangeModel(() => this._onModelChange()));\n\t\tthis._disposables.add(this._editor.onDidChangeModelLanguage(() => this._onModelChange()));\n\t\tthis._disposables.add(this._editor.onDidChangeConfiguration((e) => {\n\t\t\tif (e.hasChanged(EditorOption.fontInfo) || e.hasChanged(EditorOption.codeLensFontSize) || e.hasChanged(EditorOption.codeLensFontFamily)) {\n\t\t\t\tthis._updateLensStyle();\n\t\t\t}\n\t\t\tif (e.hasChanged(EditorOption.codeLens)) {\n\t\t\t\tthis._onModelChange();\n\t\t\t}\n\t\t}));\n\t\tthis._disposables.add(_languageFeaturesService.codeLensProvider.onDidChange(this._onModelChange, this));\n\t\tthis._onModelChange();\n\n\t\tthis._updateLensStyle();\n\t}\n\n\tdispose(): void {\n\t\tthis._localDispose();\n\t\tthis._localToDispose.dispose();\n\t\tthis._disposables.dispose();\n\t\tthis._oldCodeLensModels.dispose();\n\t\tthis._currentCodeLensModel?.dispose();\n\t}\n\n\tprivate _getLayoutInfo() {\n\t\tconst lineHeightFactor = Math.max(1.3, this._editor.getOption(EditorOption.lineHeight) / this._editor.getOption(EditorOption.fontSize));\n\t\tlet fontSize = this._editor.getOption(EditorOption.codeLensFontSize);\n\t\tif (!fontSize || fontSize < 5) {\n\t\t\tfontSize = (this._editor.getOption(EditorOption.fontSize) * .9) | 0;\n\t\t}\n\t\treturn {\n\t\t\tfontSize,\n\t\t\tcodeLensHeight: (fontSize * lineHeightFactor) | 0,\n\t\t};\n\t}\n\n\tprivate _updateLensStyle(): void {\n\n\t\tconst { codeLensHeight, fontSize } = this._getLayoutInfo();\n\t\tconst fontFamily = this._editor.getOption(EditorOption.codeLensFontFamily);\n\t\tconst editorFontInfo = this._editor.getOption(EditorOption.fontInfo);\n\n\t\tconst { style } = this._editor.getContainerDomNode();\n\n\t\tstyle.setProperty('--vscode-editorCodeLens-lineHeight', `${codeLensHeight}px`);\n\t\tstyle.setProperty('--vscode-editorCodeLens-fontSize', `${fontSize}px`);\n\t\tstyle.setProperty('--vscode-editorCodeLens-fontFeatureSettings', editorFontInfo.fontFeatureSettings);\n\n\t\tif (fontFamily) {\n\t\t\tstyle.setProperty('--vscode-editorCodeLens-fontFamily', fontFamily);\n\t\t\tstyle.setProperty('--vscode-editorCodeLens-fontFamilyDefault', EDITOR_FONT_DEFAULTS.fontFamily);\n\t\t}\n\n\t\t//\n\t\tthis._editor.changeViewZones(accessor => {\n\t\t\tfor (const lens of this._lenses) {\n\t\t\t\tlens.updateHeight(codeLensHeight, accessor);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _localDispose(): void {\n\t\tthis._getCodeLensModelPromise?.cancel();\n\t\tthis._getCodeLensModelPromise = undefined;\n\t\tthis._resolveCodeLensesPromise?.cancel();\n\t\tthis._resolveCodeLensesPromise = undefined;\n\t\tthis._localToDispose.clear();\n\t\tthis._oldCodeLensModels.clear();\n\t\tthis._currentCodeLensModel?.dispose();\n\t}\n\n\tprivate _onModelChange(): void {\n\n\t\tthis._localDispose();\n\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._editor.getOption(EditorOption.codeLens) || model.isTooLargeForTokenization()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst cachedLenses = this._codeLensCache.get(model);\n\t\tif (cachedLenses) {\n\t\t\tthis._renderCodeLensSymbols(cachedLenses);\n\t\t}\n\n\t\tif (!this._languageFeaturesService.codeLensProvider.has(model)) {\n\t\t\t// no provider -> return but check with\n\t\t\t// cached lenses. they expire after 30 seconds\n\t\t\tif (cachedLenses) {\n\t\t\t\tdisposableTimeout(() => {\n\t\t\t\t\tconst cachedLensesNow = this._codeLensCache.get(model);\n\t\t\t\t\tif (cachedLenses === cachedLensesNow) {\n\t\t\t\t\t\tthis._codeLensCache.delete(model);\n\t\t\t\t\t\tthis._onModelChange();\n\t\t\t\t\t}\n\t\t\t\t}, 30 * 1000, this._localToDispose);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const provider of this._languageFeaturesService.codeLensProvider.all(model)) {\n\t\t\tif (typeof provider.onDidChange === 'function') {\n\t\t\t\tconst registration = provider.onDidChange(() => scheduler.schedule());\n\t\t\t\tthis._localToDispose.add(registration);\n\t\t\t}\n\t\t}\n\n\t\tconst scheduler = new RunOnceScheduler(() => {\n\t\t\tconst t1 = Date.now();\n\n\t\t\tthis._getCodeLensModelPromise?.cancel();\n\t\t\tthis._getCodeLensModelPromise = createCancelablePromise(token => getCodeLensModel(this._languageFeaturesService.codeLensProvider, model, token));\n\n\t\t\tthis._getCodeLensModelPromise.then(result => {\n\t\t\t\tif (this._currentCodeLensModel) {\n\t\t\t\t\tthis._oldCodeLensModels.add(this._currentCodeLensModel);\n\t\t\t\t}\n\t\t\t\tthis._currentCodeLensModel = result;\n\n\t\t\t\t// cache model to reduce flicker\n\t\t\t\tthis._codeLensCache.put(model, result);\n\n\t\t\t\t// update moving average\n\t\t\t\tconst newDelay = this._provideCodeLensDebounce.update(model, Date.now() - t1);\n\t\t\t\tscheduler.delay = newDelay;\n\n\t\t\t\t// render lenses\n\t\t\t\tthis._renderCodeLensSymbols(result);\n\t\t\t\t// dom.scheduleAtNextAnimationFrame(() => this._resolveCodeLensesInViewport());\n\t\t\t\tthis._resolveCodeLensesInViewportSoon();\n\t\t\t}, onUnexpectedError);\n\n\t\t}, this._provideCodeLensDebounce.get(model));\n\n\t\tthis._localToDispose.add(scheduler);\n\t\tthis._localToDispose.add(toDisposable(() => this._resolveCodeLensesScheduler.cancel()));\n\t\tthis._localToDispose.add(this._editor.onDidChangeModelContent(() => {\n\t\t\tthis._editor.changeDecorations(decorationsAccessor => {\n\t\t\t\tthis._editor.changeViewZones(viewZonesAccessor => {\n\t\t\t\t\tconst toDispose: CodeLensWidget[] = [];\n\t\t\t\t\tlet lastLensLineNumber: number = -1;\n\n\t\t\t\t\tthis._lenses.forEach((lens) => {\n\t\t\t\t\t\tif (!lens.isValid() || lastLensLineNumber === lens.getLineNumber()) {\n\t\t\t\t\t\t\t// invalid -> lens collapsed, attach range doesn't exist anymore\n\t\t\t\t\t\t\t// line_number -> lenses should never be on the same line\n\t\t\t\t\t\t\ttoDispose.push(lens);\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlens.update(viewZonesAccessor);\n\t\t\t\t\t\t\tlastLensLineNumber = lens.getLineNumber();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tconst helper = new CodeLensHelper();\n\t\t\t\t\ttoDispose.forEach((l) => {\n\t\t\t\t\t\tl.dispose(helper, viewZonesAccessor);\n\t\t\t\t\t\tthis._lenses.splice(this._lenses.indexOf(l), 1);\n\t\t\t\t\t});\n\t\t\t\t\thelper.commit(decorationsAccessor);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// Ask for all references again\n\t\t\tscheduler.schedule();\n\n\t\t\t// Cancel pending and active resolve requests\n\t\t\tthis._resolveCodeLensesScheduler.cancel();\n\t\t\tthis._resolveCodeLensesPromise?.cancel();\n\t\t\tthis._resolveCodeLensesPromise = undefined;\n\t\t}));\n\t\tthis._localToDispose.add(this._editor.onDidFocusEditorText(() => {\n\t\t\tscheduler.schedule();\n\t\t}));\n\t\tthis._localToDispose.add(this._editor.onDidBlurEditorText(() => {\n\t\t\tscheduler.cancel();\n\t\t}));\n\t\tthis._localToDispose.add(this._editor.onDidScrollChange(e => {\n\t\t\tif (e.scrollTopChanged && this._lenses.length > 0) {\n\t\t\t\tthis._resolveCodeLensesInViewportSoon();\n\t\t\t}\n\t\t}));\n\t\tthis._localToDispose.add(this._editor.onDidLayoutChange(() => {\n\t\t\tthis._resolveCodeLensesInViewportSoon();\n\t\t}));\n\t\tthis._localToDispose.add(toDisposable(() => {\n\t\t\tif (this._editor.getModel()) {\n\t\t\t\tconst scrollState = StableEditorScrollState.capture(this._editor);\n\t\t\t\tthis._editor.changeDecorations(decorationsAccessor => {\n\t\t\t\t\tthis._editor.changeViewZones(viewZonesAccessor => {\n\t\t\t\t\t\tthis._disposeAllLenses(decorationsAccessor, viewZonesAccessor);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tscrollState.restore(this._editor);\n\t\t\t} else {\n\t\t\t\t// No accessors available\n\t\t\t\tthis._disposeAllLenses(undefined, undefined);\n\t\t\t}\n\t\t}));\n\t\tthis._localToDispose.add(this._editor.onMouseDown(e => {\n\t\t\tif (e.target.type !== MouseTargetType.CONTENT_WIDGET) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet target = e.target.element;\n\t\t\tif (target?.tagName === 'SPAN') {\n\t\t\t\ttarget = target.parentElement;\n\t\t\t}\n\t\t\tif (target?.tagName === 'A') {\n\t\t\t\tfor (const lens of this._lenses) {\n\t\t\t\t\tconst command = lens.getCommand(target as HTMLLinkElement);\n\t\t\t\t\tif (command) {\n\t\t\t\t\t\tthis._commandService.executeCommand(command.id, ...(command.arguments || [])).catch(err => this._notificationService.error(err));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t\tscheduler.schedule();\n\t}\n\n\tprivate _disposeAllLenses(decChangeAccessor: IModelDecorationsChangeAccessor | undefined, viewZoneChangeAccessor: IViewZoneChangeAccessor | undefined): void {\n\t\tconst helper = new CodeLensHelper();\n\t\tfor (const lens of this._lenses) {\n\t\t\tlens.dispose(helper, viewZoneChangeAccessor);\n\t\t}\n\t\tif (decChangeAccessor) {\n\t\t\thelper.commit(decChangeAccessor);\n\t\t}\n\t\tthis._lenses.length = 0;\n\t}\n\n\tprivate _renderCodeLensSymbols(symbols: CodeLensModel): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst maxLineNumber = this._editor.getModel().getLineCount();\n\t\tconst groups: CodeLensItem[][] = [];\n\t\tlet lastGroup: CodeLensItem[] | undefined;\n\n\t\tfor (const symbol of symbols.lenses) {\n\t\t\tconst line = symbol.symbol.range.startLineNumber;\n\t\t\tif (line < 1 || line > maxLineNumber) {\n\t\t\t\t// invalid code lens\n\t\t\t\tcontinue;\n\t\t\t} else if (lastGroup && lastGroup[lastGroup.length - 1].symbol.range.startLineNumber === line) {\n\t\t\t\t// on same line as previous\n\t\t\t\tlastGroup.push(symbol);\n\t\t\t} else {\n\t\t\t\t// on later line as previous\n\t\t\t\tlastGroup = [symbol];\n\t\t\t\tgroups.push(lastGroup);\n\t\t\t}\n\t\t}\n\n\t\tif (!groups.length && !this._lenses.length) {\n\t\t\t// Nothing to change\n\t\t\treturn;\n\t\t}\n\n\t\tconst scrollState = StableEditorScrollState.capture(this._editor);\n\t\tconst layoutInfo = this._getLayoutInfo();\n\n\t\tthis._editor.changeDecorations(decorationsAccessor => {\n\t\t\tthis._editor.changeViewZones(viewZoneAccessor => {\n\n\t\t\t\tconst helper = new CodeLensHelper();\n\t\t\t\tlet codeLensIndex = 0;\n\t\t\t\tlet groupsIndex = 0;\n\n\t\t\t\twhile (groupsIndex < groups.length && codeLensIndex < this._lenses.length) {\n\n\t\t\t\t\tconst symbolsLineNumber = groups[groupsIndex][0].symbol.range.startLineNumber;\n\t\t\t\t\tconst codeLensLineNumber = this._lenses[codeLensIndex].getLineNumber();\n\n\t\t\t\t\tif (codeLensLineNumber < symbolsLineNumber) {\n\t\t\t\t\t\tthis._lenses[codeLensIndex].dispose(helper, viewZoneAccessor);\n\t\t\t\t\t\tthis._lenses.splice(codeLensIndex, 1);\n\t\t\t\t\t} else if (codeLensLineNumber === symbolsLineNumber) {\n\t\t\t\t\t\tthis._lenses[codeLensIndex].updateCodeLensSymbols(groups[groupsIndex], helper);\n\t\t\t\t\t\tgroupsIndex++;\n\t\t\t\t\t\tcodeLensIndex++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._lenses.splice(codeLensIndex, 0, new CodeLensWidget(groups[groupsIndex], <IActiveCodeEditor>this._editor, helper, viewZoneAccessor, layoutInfo.codeLensHeight, () => this._resolveCodeLensesInViewportSoon()));\n\t\t\t\t\t\tcodeLensIndex++;\n\t\t\t\t\t\tgroupsIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Delete extra code lenses\n\t\t\t\twhile (codeLensIndex < this._lenses.length) {\n\t\t\t\t\tthis._lenses[codeLensIndex].dispose(helper, viewZoneAccessor);\n\t\t\t\t\tthis._lenses.splice(codeLensIndex, 1);\n\t\t\t\t}\n\n\t\t\t\t// Create extra symbols\n\t\t\t\twhile (groupsIndex < groups.length) {\n\t\t\t\t\tthis._lenses.push(new CodeLensWidget(groups[groupsIndex], <IActiveCodeEditor>this._editor, helper, viewZoneAccessor, layoutInfo.codeLensHeight, () => this._resolveCodeLensesInViewportSoon()));\n\t\t\t\t\tgroupsIndex++;\n\t\t\t\t}\n\n\t\t\t\thelper.commit(decorationsAccessor);\n\t\t\t});\n\t\t});\n\n\t\tscrollState.restore(this._editor);\n\t}\n\n\tprivate _resolveCodeLensesInViewportSoon(): void {\n\t\tconst model = this._editor.getModel();\n\t\tif (model) {\n\t\t\tthis._resolveCodeLensesScheduler.schedule();\n\t\t}\n\t}\n\n\tprivate _resolveCodeLensesInViewport(): void {\n\n\t\tthis._resolveCodeLensesPromise?.cancel();\n\t\tthis._resolveCodeLensesPromise = undefined;\n\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst toResolve: Array<ReadonlyArray<CodeLensItem>> = [];\n\t\tconst lenses: CodeLensWidget[] = [];\n\t\tthis._lenses.forEach((lens) => {\n\t\t\tconst request = lens.computeIfNecessary(model);\n\t\t\tif (request) {\n\t\t\t\ttoResolve.push(request);\n\t\t\t\tlenses.push(lens);\n\t\t\t}\n\t\t});\n\n\t\tif (toResolve.length === 0) {\n\t\t\tthis._oldCodeLensModels.clear();\n\t\t\treturn;\n\t\t}\n\n\t\tconst t1 = Date.now();\n\n\t\tconst resolvePromise = createCancelablePromise(token => {\n\n\t\t\tconst promises = toResolve.map((request, i) => {\n\n\t\t\t\tconst resolvedSymbols = new Array<CodeLens | undefined | null>(request.length);\n\t\t\t\tconst promises = request.map((request, i) => {\n\t\t\t\t\tif (!request.symbol.command && typeof request.provider.resolveCodeLens === 'function') {\n\t\t\t\t\t\treturn Promise.resolve(request.provider.resolveCodeLens(model, request.symbol, token)).then(symbol => {\n\t\t\t\t\t\t\tresolvedSymbols[i] = symbol;\n\t\t\t\t\t\t}, onUnexpectedExternalError);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresolvedSymbols[i] = request.symbol;\n\t\t\t\t\t\treturn Promise.resolve(undefined);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn Promise.all(promises).then(() => {\n\t\t\t\t\tif (!token.isCancellationRequested && !lenses[i].isDisposed()) {\n\t\t\t\t\t\tlenses[i].updateCommands(resolvedSymbols);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t\treturn Promise.all(promises);\n\t\t});\n\t\tthis._resolveCodeLensesPromise = resolvePromise;\n\n\t\tthis._resolveCodeLensesPromise.then(() => {\n\n\t\t\t// update moving average\n\t\t\tconst newDelay = this._resolveCodeLensesDebounce.update(model, Date.now() - t1);\n\t\t\tthis._resolveCodeLensesScheduler.delay = newDelay;\n\n\t\t\tif (this._currentCodeLensModel) { // update the cached state with new resolved items\n\t\t\t\tthis._codeLensCache.put(model, this._currentCodeLensModel);\n\t\t\t}\n\t\t\tthis._oldCodeLensModels.clear(); // dispose old models once we have updated the UI with the current model\n\t\t\tif (resolvePromise === this._resolveCodeLensesPromise) {\n\t\t\t\tthis._resolveCodeLensesPromise = undefined;\n\t\t\t}\n\t\t}, err => {\n\t\t\tonUnexpectedError(err); // can also be cancellation!\n\t\t\tif (resolvePromise === this._resolveCodeLensesPromise) {\n\t\t\t\tthis._resolveCodeLensesPromise = undefined;\n\t\t\t}\n\t\t});\n\t}\n\n\tasync getModel(): Promise<CodeLensModel | undefined> {\n\t\tawait this._getCodeLensModelPromise;\n\t\tawait this._resolveCodeLensesPromise;\n\t\treturn !this._currentCodeLensModel?.isDisposed\n\t\t\t? this._currentCodeLensModel\n\t\t\t: undefined;\n\t}\n}\n\nregisterEditorContribution(CodeLensContribution.ID, CodeLensContribution, EditorContributionInstantiation.AfterFirstRender);\n\nregisterEditorAction(class ShowLensesInCurrentLine extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'codelens.showLensesInCurrentLine',\n\t\t\tprecondition: EditorContextKeys.hasCodeLensProvider,\n\t\t\tlabel: localize2('showLensOnLine', \"Show CodeLens Commands for Current Line\"),\n\t\t});\n\t}\n\n\tasync run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst quickInputService = accessor.get(IQuickInputService);\n\t\tconst commandService = accessor.get(ICommandService);\n\t\tconst notificationService = accessor.get(INotificationService);\n\n\t\tconst lineNumber = editor.getSelection().positionLineNumber;\n\t\tconst codelensController = editor.getContribution<CodeLensContribution>(CodeLensContribution.ID);\n\t\tif (!codelensController) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = await codelensController.getModel();\n\t\tif (!model) {\n\t\t\t// nothing\n\t\t\treturn;\n\t\t}\n\n\t\tconst items: { label: string; command: Command }[] = [];\n\t\tfor (const lens of model.lenses) {\n\t\t\tif (lens.symbol.command && lens.symbol.range.startLineNumber === lineNumber) {\n\t\t\t\titems.push({\n\t\t\t\t\tlabel: lens.symbol.command.title,\n\t\t\t\t\tcommand: lens.symbol.command\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (items.length === 0) {\n\t\t\t// We dont want an empty picker\n\t\t\treturn;\n\t\t}\n\n\t\tconst item = await quickInputService.pick(items, {\n\t\t\tcanPickMany: false,\n\t\t\tplaceHolder: localize('placeHolder', \"Select a command\")\n\t\t});\n\t\tif (!item) {\n\t\t\t// Nothing picked\n\t\t\treturn;\n\t\t}\n\n\t\tlet command = item.command;\n\n\t\tif (model.isDisposed) {\n\t\t\t// try to find the same command again in-case the model has been re-created in the meantime\n\t\t\t// this is a best attempt approach which shouldn't be needed because eager model re-creates\n\t\t\t// shouldn't happen due to focus in/out anymore\n\t\t\tconst newModel = await codelensController.getModel();\n\t\t\tconst newLens = newModel?.lenses.find(lens => lens.symbol.range.startLineNumber === lineNumber && lens.symbol.command?.title === command.title);\n\t\t\tif (!newLens || !newLens.symbol.command) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcommand = newLens.symbol.command;\n\t\t}\n\n\t\ttry {\n\t\t\tawait commandService.executeCommand(command.id, ...(command.arguments || []));\n\t\t} catch (err) {\n\t\t\tnotificationService.error(err);\n\t\t}\n\t}\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["vs/editor/contrib/folding/browser/foldingDecorations.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAG9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,oDAAoD,CAAC;AAC3I,OAAO,EAAE,YAAY,EAAE,MAAM,mDAAmD,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,EAAE,SAAS,E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CAAC,qBAAqB,CAAC,CAAC,CAAC,yBAAyB,CAAC,gDAAgD,CAAC,CAAC,CAAC,yBAAyB,CAAC,oCAAoC,CAAC;gBAC1K,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,yBAAyB,CAAC,uCAAuC,CAAC,CAAC,CAAC,yBAAyB,CAAC,2BAA2B,CAAC,CAAC;QAC7J,CAAC;aAAM,IAAI,IAAI,CAAC,mBAAmB,KAAK,WAAW,EAAE,CAAC;YACrD,OAAO,QAAQ,CAAC,CAAC,CAAC,yBAAyB,CAAC,6CAA6C,CAAC,CAAC,CAAC,yBAAyB,CAAC,oCAAoC,CAAC;QAC5J,CAAC;aAAM,CAAC;YACP,OAAO,QAAQ,CAAC,CAAC,CAAC,yBAAyB,CAAC,mCAAmC,CAAC,CAAC,CAAC,yBAAyB,CAAC,0BAA0B,CAAC;QACxI,CAAC;IACF,CAAC;IAED,iBAAiB,CAAI,QAAgE;QACpF,OAAO,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAChD,CAAC;IAED,iBAAiB,CAAC,aAAuB;QACxC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;IAC9C,CAAC","file":"foldingDecorations.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 { Codicon } from '../../../../base/common/codicons.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { IModelDecorationOptions, IModelDecorationsChangeAccessor, MinimapPosition, TrackedRangeStickiness } from '../../../common/model.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { IDecorationProvider } from './foldingModel.js';\nimport { localize } from '../../../../nls.js';\nimport { editorSelectionBackground, iconForeground, registerColor, transparent } from '../../../../platform/theme/common/colorRegistry.js';\nimport { registerIcon } from '../../../../platform/theme/common/iconRegistry.js';\nimport { themeColorFromId } from '../../../../platform/theme/common/themeService.js';\nimport { ThemeIcon } from '../../../../base/common/themables.js';\n\nconst foldBackground = registerColor('editor.foldBackground', { light: transparent(editorSelectionBackground, 0.3), dark: transparent(editorSelectionBackground, 0.3), hcDark: null, hcLight: null }, localize('foldBackgroundBackground', \"Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations.\"), true);\nregisterColor('editor.foldPlaceholderForeground', { light: '#808080', dark: '#808080', hcDark: null, hcLight: null }, localize('collapsedTextColor', \"Color of the collapsed text after the first line of a folded range.\"));\nregisterColor('editorGutter.foldingControlForeground', iconForeground, localize('editorGutter.foldingControlForeground', 'Color of the folding control in the editor gutter.'));\n\nexport const foldingExpandedIcon = registerIcon('folding-expanded', Codicon.chevronDown, localize('foldingExpandedIcon', 'Icon for expanded ranges in the editor glyph margin.'));\nexport const foldingCollapsedIcon = registerIcon('folding-collapsed', Codicon.chevronRight, localize('foldingCollapsedIcon', 'Icon for collapsed ranges in the editor glyph margin.'));\nexport const foldingManualCollapsedIcon = registerIcon('folding-manual-collapsed', foldingCollapsedIcon, localize('foldingManualCollapedIcon', 'Icon for manually collapsed ranges in the editor glyph margin.'));\nexport const foldingManualExpandedIcon = registerIcon('folding-manual-expanded', foldingExpandedIcon, localize('foldingManualExpandedIcon', 'Icon for manually expanded ranges in the editor glyph margin.'));\n\nconst foldedBackgroundMinimap = { color: themeColorFromId(foldBackground), position: MinimapPosition.Inline };\n\nconst collapsed = localize('linesCollapsed', \"Click to expand the range.\");\nconst expanded = localize('linesExpanded', \"Click to collapse the range.\");\n\nexport class FoldingDecorationProvider implements IDecorationProvider {\n\n\tprivate static readonly COLLAPSED_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-collapsed-visual-decoration',\n\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\tafterContentClassName: 'inline-folded',\n\t\tisWholeLine: true,\n\t\tlinesDecorationsTooltip: collapsed,\n\t\tfirstLineDecorationClassName: ThemeIcon.asClassName(foldingCollapsedIcon),\n\t});\n\n\tprivate static readonly COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-collapsed-highlighted-visual-decoration',\n\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\tafterContentClassName: 'inline-folded',\n\t\tclassName: 'folded-background',\n\t\tminimap: foldedBackgroundMinimap,\n\t\tisWholeLine: true,\n\t\tlinesDecorationsTooltip: collapsed,\n\t\tfirstLineDecorationClassName: ThemeIcon.asClassName(foldingCollapsedIcon)\n\t});\n\n\tprivate static readonly MANUALLY_COLLAPSED_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-manually-collapsed-visual-decoration',\n\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\tafterContentClassName: 'inline-folded',\n\t\tisWholeLine: true,\n\t\tlinesDecorationsTooltip: collapsed,\n\t\tfirstLineDecorationClassName: ThemeIcon.asClassName(foldingManualCollapsedIcon)\n\t});\n\n\tprivate static readonly MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-manually-collapsed-highlighted-visual-decoration',\n\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\tafterContentClassName: 'inline-folded',\n\t\tclassName: 'folded-background',\n\t\tminimap: foldedBackgroundMinimap,\n\t\tisWholeLine: true,\n\t\tlinesDecorationsTooltip: collapsed,\n\t\tfirstLineDecorationClassName: ThemeIcon.asClassName(foldingManualCollapsedIcon)\n\t});\n\n\tprivate static readonly NO_CONTROLS_COLLAPSED_RANGE_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-no-controls-range-decoration',\n\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\tafterContentClassName: 'inline-folded',\n\t\tisWholeLine: true,\n\t\tlinesDecorationsTooltip: collapsed,\n\t});\n\n\tprivate static readonly NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-no-controls-range-decoration',\n\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\tafterContentClassName: 'inline-folded',\n\t\tclassName: 'folded-background',\n\t\tminimap: foldedBackgroundMinimap,\n\t\tisWholeLine: true,\n\t\tlinesDecorationsTooltip: collapsed,\n\t});\n\n\tprivate static readonly EXPANDED_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-expanded-visual-decoration',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tisWholeLine: true,\n\t\tfirstLineDecorationClassName: 'alwaysShowFoldIcons ' + ThemeIcon.asClassName(foldingExpandedIcon),\n\t\tlinesDecorationsTooltip: expanded,\n\t});\n\n\tprivate static readonly EXPANDED_AUTO_HIDE_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-expanded-auto-hide-visual-decoration',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tisWholeLine: true,\n\t\tfirstLineDecorationClassName: ThemeIcon.asClassName(foldingExpandedIcon),\n\t\tlinesDecorationsTooltip: expanded,\n\t});\n\n\tprivate static readonly MANUALLY_EXPANDED_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-manually-expanded-visual-decoration',\n\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\tisWholeLine: true,\n\t\tfirstLineDecorationClassName: 'alwaysShowFoldIcons ' + ThemeIcon.asClassName(foldingManualExpandedIcon),\n\t\tlinesDecorationsTooltip: expanded,\n\t});\n\n\tprivate static readonly MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-manually-expanded-auto-hide-visual-decoration',\n\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\tisWholeLine: true,\n\t\tfirstLineDecorationClassName: ThemeIcon.asClassName(foldingManualExpandedIcon),\n\t\tlinesDecorationsTooltip: expanded,\n\t});\n\n\tprivate static readonly NO_CONTROLS_EXPANDED_RANGE_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-no-controls-range-decoration',\n\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\tisWholeLine: true\n\t});\n\n\tprivate static readonly HIDDEN_RANGE_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-hidden-range-decoration',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges\n\t});\n\n\tpublic showFoldingControls: 'always' | 'never' | 'mouseover' = 'mouseover';\n\n\tpublic showFoldingHighlights: boolean = true;\n\n\tconstructor(private readonly editor: ICodeEditor) {\n\t}\n\n\tgetDecorationOption(isCollapsed: boolean, isHidden: boolean, isManual: boolean): IModelDecorationOptions {\n\t\tif (isHidden) { // is inside another collapsed region\n\t\t\treturn FoldingDecorationProvider.HIDDEN_RANGE_DECORATION;\n\t\t}\n\t\tif (this.showFoldingControls === 'never') {\n\t\t\tif (isCollapsed) {\n\t\t\t\treturn this.showFoldingHighlights ? FoldingDecorationProvider.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION : FoldingDecorationProvider.NO_CONTROLS_COLLAPSED_RANGE_DECORATION;\n\t\t\t}\n\t\t\treturn FoldingDecorationProvider.NO_CONTROLS_EXPANDED_RANGE_DECORATION;\n\t\t}\n\t\tif (isCollapsed) {\n\t\t\treturn isManual ?\n\t\t\t\t(this.showFoldingHighlights ? FoldingDecorationProvider.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION : FoldingDecorationProvider.MANUALLY_COLLAPSED_VISUAL_DECORATION)\n\t\t\t\t: (this.showFoldingHighlights ? FoldingDecorationProvider.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION : FoldingDecorationProvider.COLLAPSED_VISUAL_DECORATION);\n\t\t} else if (this.showFoldingControls === 'mouseover') {\n\t\t\treturn isManual ? FoldingDecorationProvider.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION : FoldingDecorationProvider.EXPANDED_AUTO_HIDE_VISUAL_DECORATION;\n\t\t} else {\n\t\t\treturn isManual ? FoldingDecorationProvider.MANUALLY_EXPANDED_VISUAL_DECORATION : FoldingDecorationProvider.EXPANDED_VISUAL_DECORATION;\n\t\t}\n\t}\n\n\tchangeDecorations<T>(callback: (changeAccessor: IModelDecorationsChangeAccessor) => T): T {\n\t\treturn this.editor.changeDecorations(callback);\n\t}\n\n\tremoveDecorations(decorationIds: string[]): void {\n\t\tthis.editor.removeDecorations(decorationIds);\n\t}\n}\n"]}
1
+ {"version":3,"sources":["vs/editor/contrib/folding/browser/foldingDecorations.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAG9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,oDAAoD,CAAC;AAC3I,OAAO,EAAE,YAAY,EAAE,MAAM,mDAAmD,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEjE,MAAM,cAAc,GAAG,aAAa,CAAC,uBAAuB,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,yBAAyB,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,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AC,yBAAyB,CAAC,uCAAuC,CAAC,CAAC,CAAC,yBAAyB,CAAC,2BAA2B,CAAC,CAAC;QAC7J,CAAC;aAAM,IAAI,IAAI,CAAC,mBAAmB,KAAK,WAAW,EAAE,CAAC;YACrD,OAAO,QAAQ,CAAC,CAAC,CAAC,yBAAyB,CAAC,6CAA6C,CAAC,CAAC,CAAC,yBAAyB,CAAC,oCAAoC,CAAC;QAC5J,CAAC;aAAM,CAAC;YACP,OAAO,QAAQ,CAAC,CAAC,CAAC,yBAAyB,CAAC,mCAAmC,CAAC,CAAC,CAAC,yBAAyB,CAAC,0BAA0B,CAAC;QACxI,CAAC;IACF,CAAC;IAED,iBAAiB,CAAI,QAAgE;QACpF,OAAO,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAChD,CAAC;IAED,iBAAiB,CAAC,aAAuB;QACxC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;IAC9C,CAAC","file":"foldingDecorations.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 { Codicon } from '../../../../base/common/codicons.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { IModelDecorationOptions, IModelDecorationsChangeAccessor, MinimapPosition, TrackedRangeStickiness } from '../../../common/model.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { IDecorationProvider } from './foldingModel.js';\nimport { localize } from '../../../../nls.js';\nimport { editorSelectionBackground, iconForeground, registerColor, transparent } from '../../../../platform/theme/common/colorRegistry.js';\nimport { registerIcon } from '../../../../platform/theme/common/iconRegistry.js';\nimport { themeColorFromId } from '../../../../platform/theme/common/themeService.js';\nimport { ThemeIcon } from '../../../../base/common/themables.js';\n\nconst foldBackground = registerColor('editor.foldBackground', { light: transparent(editorSelectionBackground, 0.3), dark: transparent(editorSelectionBackground, 0.3), hcDark: null, hcLight: null }, localize('foldBackgroundBackground', \"Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations.\"), true);\nregisterColor('editor.foldPlaceholderForeground', { light: '#808080', dark: '#808080', hcDark: null, hcLight: null }, localize('collapsedTextColor', \"Color of the collapsed text after the first line of a folded range.\"));\nregisterColor('editorGutter.foldingControlForeground', iconForeground, localize('editorGutter.foldingControlForeground', 'Color of the folding control in the editor gutter.'));\n\nexport const foldingExpandedIcon = registerIcon('folding-expanded', Codicon.chevronDown, localize('foldingExpandedIcon', 'Icon for expanded ranges in the editor glyph margin.'));\nexport const foldingCollapsedIcon = registerIcon('folding-collapsed', Codicon.chevronRight, localize('foldingCollapsedIcon', 'Icon for collapsed ranges in the editor glyph margin.'));\nexport const foldingManualCollapsedIcon = registerIcon('folding-manual-collapsed', foldingCollapsedIcon, localize('foldingManualCollapedIcon', 'Icon for manually collapsed ranges in the editor glyph margin.'));\nexport const foldingManualExpandedIcon = registerIcon('folding-manual-expanded', foldingExpandedIcon, localize('foldingManualExpandedIcon', 'Icon for manually expanded ranges in the editor glyph margin.'));\n\nconst foldedBackgroundMinimap = { color: themeColorFromId(foldBackground), position: MinimapPosition.Inline };\n\nconst collapsed = localize('linesCollapsed', \"Click to expand the range.\");\nconst expanded = localize('linesExpanded', \"Click to collapse the range.\");\n\nexport class FoldingDecorationProvider implements IDecorationProvider {\n\n\tprivate static readonly COLLAPSED_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-collapsed-visual-decoration',\n\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\tafterContentClassName: 'inline-folded',\n\t\tisWholeLine: true,\n\t\tlinesDecorationsTooltip: collapsed,\n\t\tfirstLineDecorationClassName: ThemeIcon.asClassName(foldingCollapsedIcon),\n\t});\n\n\tprivate static readonly COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-collapsed-highlighted-visual-decoration',\n\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\tafterContentClassName: 'inline-folded',\n\t\tclassName: 'folded-background',\n\t\tminimap: foldedBackgroundMinimap,\n\t\tisWholeLine: true,\n\t\tlinesDecorationsTooltip: collapsed,\n\t\tfirstLineDecorationClassName: ThemeIcon.asClassName(foldingCollapsedIcon)\n\t});\n\n\tprivate static readonly MANUALLY_COLLAPSED_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-manually-collapsed-visual-decoration',\n\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\tafterContentClassName: 'inline-folded',\n\t\tisWholeLine: true,\n\t\tlinesDecorationsTooltip: collapsed,\n\t\tfirstLineDecorationClassName: ThemeIcon.asClassName(foldingManualCollapsedIcon)\n\t});\n\n\tprivate static readonly MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-manually-collapsed-highlighted-visual-decoration',\n\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\tafterContentClassName: 'inline-folded',\n\t\tclassName: 'folded-background',\n\t\tminimap: foldedBackgroundMinimap,\n\t\tisWholeLine: true,\n\t\tlinesDecorationsTooltip: collapsed,\n\t\tfirstLineDecorationClassName: ThemeIcon.asClassName(foldingManualCollapsedIcon)\n\t});\n\n\tprivate static readonly NO_CONTROLS_COLLAPSED_RANGE_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-no-controls-range-decoration',\n\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\tafterContentClassName: 'inline-folded',\n\t\tisWholeLine: true,\n\t\tlinesDecorationsTooltip: collapsed,\n\t});\n\n\tprivate static readonly NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-no-controls-range-decoration',\n\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\tafterContentClassName: 'inline-folded',\n\t\tclassName: 'folded-background',\n\t\tminimap: foldedBackgroundMinimap,\n\t\tisWholeLine: true,\n\t\tlinesDecorationsTooltip: collapsed,\n\t});\n\n\tprivate static readonly EXPANDED_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-expanded-visual-decoration',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tisWholeLine: true,\n\t\tfirstLineDecorationClassName: 'alwaysShowFoldIcons ' + ThemeIcon.asClassName(foldingExpandedIcon),\n\t\tlinesDecorationsTooltip: expanded,\n\t});\n\n\tprivate static readonly EXPANDED_AUTO_HIDE_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-expanded-auto-hide-visual-decoration',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tisWholeLine: true,\n\t\tfirstLineDecorationClassName: ThemeIcon.asClassName(foldingExpandedIcon),\n\t\tlinesDecorationsTooltip: expanded,\n\t});\n\n\tprivate static readonly MANUALLY_EXPANDED_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-manually-expanded-visual-decoration',\n\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\tisWholeLine: true,\n\t\tfirstLineDecorationClassName: 'alwaysShowFoldIcons ' + ThemeIcon.asClassName(foldingManualExpandedIcon),\n\t\tlinesDecorationsTooltip: expanded,\n\t});\n\n\tprivate static readonly MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-manually-expanded-auto-hide-visual-decoration',\n\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\tisWholeLine: true,\n\t\tfirstLineDecorationClassName: ThemeIcon.asClassName(foldingManualExpandedIcon),\n\t\tlinesDecorationsTooltip: expanded,\n\t});\n\n\tprivate static readonly NO_CONTROLS_EXPANDED_RANGE_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-no-controls-range-decoration',\n\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\tisWholeLine: true\n\t});\n\n\tprivate static readonly HIDDEN_RANGE_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-hidden-range-decoration',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges\n\t});\n\n\tpublic showFoldingControls: 'always' | 'never' | 'mouseover' = 'mouseover';\n\n\tpublic showFoldingHighlights: boolean = true;\n\n\tconstructor(private readonly editor: ICodeEditor) {\n\t}\n\n\tgetDecorationOption(isCollapsed: boolean, isHidden: boolean, isManual: boolean): IModelDecorationOptions {\n\t\tif (isHidden) { // is inside another collapsed region\n\t\t\treturn FoldingDecorationProvider.HIDDEN_RANGE_DECORATION;\n\t\t}\n\t\tif (this.showFoldingControls === 'never') {\n\t\t\tif (isCollapsed) {\n\t\t\t\treturn this.showFoldingHighlights ? FoldingDecorationProvider.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION : FoldingDecorationProvider.NO_CONTROLS_COLLAPSED_RANGE_DECORATION;\n\t\t\t}\n\t\t\treturn FoldingDecorationProvider.NO_CONTROLS_EXPANDED_RANGE_DECORATION;\n\t\t}\n\t\tif (isCollapsed) {\n\t\t\treturn isManual ?\n\t\t\t\t(this.showFoldingHighlights ? FoldingDecorationProvider.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION : FoldingDecorationProvider.MANUALLY_COLLAPSED_VISUAL_DECORATION)\n\t\t\t\t: (this.showFoldingHighlights ? FoldingDecorationProvider.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION : FoldingDecorationProvider.COLLAPSED_VISUAL_DECORATION);\n\t\t} else if (this.showFoldingControls === 'mouseover') {\n\t\t\treturn isManual ? FoldingDecorationProvider.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION : FoldingDecorationProvider.EXPANDED_AUTO_HIDE_VISUAL_DECORATION;\n\t\t} else {\n\t\t\treturn isManual ? FoldingDecorationProvider.MANUALLY_EXPANDED_VISUAL_DECORATION : FoldingDecorationProvider.EXPANDED_VISUAL_DECORATION;\n\t\t}\n\t}\n\n\tchangeDecorations<T>(callback: (changeAccessor: IModelDecorationsChangeAccessor) => T): T | null {\n\t\treturn this.editor.changeDecorations(callback);\n\t}\n\n\tremoveDecorations(decorationIds: string[]): void {\n\t\tthis.editor.removeDecorations(decorationIds);\n\t}\n}\n"]}
@@ -239,7 +239,7 @@ let GotoDefinitionAtPositionEditorContribution = class GotoDefinitionAtPositionE
239
239
  }
240
240
  return getDefinitionsAtPosition(this.languageFeaturesService.definitionProvider, model, position, false, token);
241
241
  }
242
- gotoDefinition(position, openToSide) {
242
+ async gotoDefinition(position, openToSide) {
243
243
  this.editor.setPosition(position);
244
244
  return this.editor.invokeWithinContext((accessor) => {
245
245
  const canPeek = !openToSide && this.editor.getOption(101 /* EditorOption.definitionLinkOpensInPeek */) && !this.isInPeekEditor(accessor);
@@ -1 +1 @@
1
- {"version":3,"sources":["vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAGhG,OAAO,EAAqB,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAEjG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,gCAAgC,CAAC;AACxC,OAAO,EAAuB,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAE/F,OAAO,EAAmC,0BAA0B,EAAE,MAAM,yCAAyC,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OAAO,EAAE,CAAC;IACpC,CAAC;;AA7RW,0CAA0C;IAcpD,WAAA,iBAAiB,CAAA;IACjB,WAAA,gBAAgB,CAAA;IAChB,WAAA,wBAAwB,CAAA;GAhBd,0CAA0C,CA8RtD;;AAED,0BAA0B,CAAC,0CAA0C,CAAC,EAAE,EAAE,0CAA0C,iEAAyD,CAAC","file":"goToDefinitionAtPosition.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 { IKeyboardEvent } from '../../../../../base/browser/keyboardEvent.js';\nimport { CancelablePromise, createCancelablePromise } from '../../../../../base/common/async.js';\nimport { CancellationToken } from '../../../../../base/common/cancellation.js';\nimport { onUnexpectedError } from '../../../../../base/common/errors.js';\nimport { MarkdownString } from '../../../../../base/common/htmlContent.js';\nimport { DisposableStore } from '../../../../../base/common/lifecycle.js';\nimport './goToDefinitionAtPosition.css';\nimport { CodeEditorStateFlag, EditorState } from '../../../editorState/browser/editorState.js';\nimport { ICodeEditor, MouseTargetType } from '../../../../browser/editorBrowser.js';\nimport { EditorContributionInstantiation, registerEditorContribution } from '../../../../browser/editorExtensions.js';\nimport { EditorOption } from '../../../../common/config/editorOptions.js';\nimport { Position } from '../../../../common/core/position.js';\nimport { IRange, Range } from '../../../../common/core/range.js';\nimport { IEditorContribution, IEditorDecorationsCollection } from '../../../../common/editorCommon.js';\nimport { IModelDeltaDecoration, ITextModel } from '../../../../common/model.js';\nimport { LocationLink } from '../../../../common/languages.js';\nimport { ILanguageService } from '../../../../common/languages/language.js';\nimport { ITextModelService } from '../../../../common/services/resolverService.js';\nimport { ClickLinkGesture, ClickLinkKeyboardEvent, ClickLinkMouseEvent } from './clickLinkGesture.js';\nimport { PeekContext } from '../../../peekView/browser/peekView.js';\nimport * as nls from '../../../../../nls.js';\nimport { IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js';\nimport { ServicesAccessor } from '../../../../../platform/instantiation/common/instantiation.js';\nimport { DefinitionAction } from '../goToCommands.js';\nimport { getDefinitionsAtPosition } from '../goToSymbol.js';\nimport { IWordAtPosition } from '../../../../common/core/wordHelper.js';\nimport { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js';\nimport { ModelDecorationInjectedTextOptions } from '../../../../common/model/textModel.js';\n\nexport class GotoDefinitionAtPositionEditorContribution implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.gotodefinitionatposition';\n\tstatic readonly MAX_SOURCE_PREVIEW_LINES = 8;\n\n\tprivate readonly editor: ICodeEditor;\n\tprivate readonly toUnhook = new DisposableStore();\n\tprivate readonly toUnhookForKeyboard = new DisposableStore();\n\tprivate readonly linkDecorations: IEditorDecorationsCollection;\n\tprivate currentWordAtPosition: IWordAtPosition | null = null;\n\tprivate previousPromise: CancelablePromise<LocationLink[] | null> | null = null;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@ITextModelService private readonly textModelResolverService: ITextModelService,\n\t\t@ILanguageService private readonly languageService: ILanguageService,\n\t\t@ILanguageFeaturesService private readonly languageFeaturesService: ILanguageFeaturesService,\n\t) {\n\t\tthis.editor = editor;\n\t\tthis.linkDecorations = this.editor.createDecorationsCollection();\n\n\t\tconst linkGesture = new ClickLinkGesture(editor);\n\t\tthis.toUnhook.add(linkGesture);\n\n\t\tthis.toUnhook.add(linkGesture.onMouseMoveOrRelevantKeyDown(([mouseEvent, keyboardEvent]) => {\n\t\t\tthis.startFindDefinitionFromMouse(mouseEvent, keyboardEvent ?? undefined);\n\t\t}));\n\n\t\tthis.toUnhook.add(linkGesture.onExecute((mouseEvent: ClickLinkMouseEvent) => {\n\t\t\tif (this.isEnabled(mouseEvent)) {\n\t\t\t\tthis.gotoDefinition(mouseEvent.target.position!, mouseEvent.hasSideBySideModifier)\n\t\t\t\t\t.catch((error: Error) => {\n\t\t\t\t\t\tonUnexpectedError(error);\n\t\t\t\t\t})\n\t\t\t\t\t.finally(() => {\n\t\t\t\t\t\tthis.removeLinkDecorations();\n\t\t\t\t\t});\n\t\t\t}\n\t\t}));\n\n\t\tthis.toUnhook.add(linkGesture.onCancel(() => {\n\t\t\tthis.removeLinkDecorations();\n\t\t\tthis.currentWordAtPosition = null;\n\t\t}));\n\t}\n\n\tstatic get(editor: ICodeEditor): GotoDefinitionAtPositionEditorContribution | null {\n\t\treturn editor.getContribution<GotoDefinitionAtPositionEditorContribution>(GotoDefinitionAtPositionEditorContribution.ID);\n\t}\n\n\tasync startFindDefinitionFromCursor(position: Position) {\n\t\t// For issue: https://github.com/microsoft/vscode/issues/46257\n\t\t// equivalent to mouse move with meta/ctrl key\n\n\t\t// First find the definition and add decorations\n\t\t// to the editor to be shown with the content hover widget\n\t\tawait this.startFindDefinition(position);\n\t\t// Add listeners for editor cursor move and key down events\n\t\t// Dismiss the \"extended\" editor decorations when the user hides\n\t\t// the hover widget. There is no event for the widget itself so these\n\t\t// serve as a best effort. After removing the link decorations, the hover\n\t\t// widget is clean and will only show declarations per next request.\n\t\tthis.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(() => {\n\t\t\tthis.currentWordAtPosition = null;\n\t\t\tthis.removeLinkDecorations();\n\t\t\tthis.toUnhookForKeyboard.clear();\n\t\t}));\n\t\tthis.toUnhookForKeyboard.add(this.editor.onKeyDown((e: IKeyboardEvent) => {\n\t\t\tif (e) {\n\t\t\t\tthis.currentWordAtPosition = null;\n\t\t\t\tthis.removeLinkDecorations();\n\t\t\t\tthis.toUnhookForKeyboard.clear();\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate startFindDefinitionFromMouse(mouseEvent: ClickLinkMouseEvent, withKey?: ClickLinkKeyboardEvent): void {\n\n\t\t// check if we are active and on a content widget\n\t\tif (mouseEvent.target.type === MouseTargetType.CONTENT_WIDGET && this.linkDecorations.length > 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.editor.hasModel() || !this.isEnabled(mouseEvent, withKey)) {\n\t\t\tthis.currentWordAtPosition = null;\n\t\t\tthis.removeLinkDecorations();\n\t\t\treturn;\n\t\t}\n\n\t\tconst position = mouseEvent.target.position!;\n\n\t\tthis.startFindDefinition(position);\n\t}\n\n\tprivate async startFindDefinition(position: Position): Promise<void> {\n\n\t\t// Dispose listeners for updating decorations when using keyboard to show definition hover\n\t\tthis.toUnhookForKeyboard.clear();\n\n\t\t// Find word at mouse position\n\t\tconst word = position ? this.editor.getModel()?.getWordAtPosition(position) : null;\n\t\tif (!word) {\n\t\t\tthis.currentWordAtPosition = null;\n\t\t\tthis.removeLinkDecorations();\n\t\t\treturn;\n\t\t}\n\n\t\t// Return early if word at position is still the same\n\t\tif (this.currentWordAtPosition && this.currentWordAtPosition.startColumn === word.startColumn && this.currentWordAtPosition.endColumn === word.endColumn && this.currentWordAtPosition.word === word.word) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.currentWordAtPosition = word;\n\n\t\t// Find definition and decorate word if found\n\t\tconst state = new EditorState(this.editor, CodeEditorStateFlag.Position | CodeEditorStateFlag.Value | CodeEditorStateFlag.Selection | CodeEditorStateFlag.Scroll);\n\n\t\tif (this.previousPromise) {\n\t\t\tthis.previousPromise.cancel();\n\t\t\tthis.previousPromise = null;\n\t\t}\n\n\t\tthis.previousPromise = createCancelablePromise(token => this.findDefinition(position, token));\n\n\t\tlet results: LocationLink[] | null;\n\t\ttry {\n\t\t\tresults = await this.previousPromise;\n\n\t\t} catch (error) {\n\t\t\tonUnexpectedError(error);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!results || !results.length || !state.validate(this.editor)) {\n\t\t\tthis.removeLinkDecorations();\n\t\t\treturn;\n\t\t}\n\n\t\tconst linkRange = results[0].originSelectionRange\n\t\t\t? Range.lift(results[0].originSelectionRange)\n\t\t\t: new Range(position.lineNumber, word.startColumn, position.lineNumber, word.endColumn);\n\n\t\t// Multiple results\n\t\tif (results.length > 1) {\n\n\t\t\tlet combinedRange = linkRange;\n\t\t\tfor (const { originSelectionRange } of results) {\n\t\t\t\tif (originSelectionRange) {\n\t\t\t\t\tcombinedRange = Range.plusRange(combinedRange, originSelectionRange);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.addDecoration(\n\t\t\t\tcombinedRange,\n\t\t\t\tnew MarkdownString().appendText(nls.localize('multipleResults', \"Click to show {0} definitions.\", results.length))\n\t\t\t);\n\t\t} else {\n\t\t\t// Single result\n\t\t\tconst result = results[0];\n\n\t\t\tif (!result.uri) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treturn this.textModelResolverService.createModelReference(result.uri).then(ref => {\n\n\t\t\t\tif (!ref.object || !ref.object.textEditorModel) {\n\t\t\t\t\tref.dispose();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst { object: { textEditorModel } } = ref;\n\t\t\t\tconst { startLineNumber } = result.range;\n\n\t\t\t\tif (startLineNumber < 1 || startLineNumber > textEditorModel.getLineCount()) {\n\t\t\t\t\t// invalid range\n\t\t\t\t\tref.dispose();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst previewValue = this.getPreviewValue(textEditorModel, startLineNumber, result);\n\t\t\t\tconst languageId = this.languageService.guessLanguageIdByFilepathOrFirstLine(textEditorModel.uri);\n\t\t\t\tthis.addDecoration(\n\t\t\t\t\tlinkRange,\n\t\t\t\t\tpreviewValue ? new MarkdownString().appendCodeblock(languageId ? languageId : '', previewValue) : undefined\n\t\t\t\t);\n\t\t\t\tref.dispose();\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate getPreviewValue(textEditorModel: ITextModel, startLineNumber: number, result: LocationLink) {\n\t\tlet rangeToUse = result.range;\n\t\tconst numberOfLinesInRange = rangeToUse.endLineNumber - rangeToUse.startLineNumber;\n\t\tif (numberOfLinesInRange >= GotoDefinitionAtPositionEditorContribution.MAX_SOURCE_PREVIEW_LINES) {\n\t\t\trangeToUse = this.getPreviewRangeBasedOnIndentation(textEditorModel, startLineNumber);\n\t\t}\n\t\trangeToUse = textEditorModel.validateRange(rangeToUse);\n\t\tconst previewValue = this.stripIndentationFromPreviewRange(textEditorModel, startLineNumber, rangeToUse);\n\t\treturn previewValue;\n\t}\n\n\tprivate stripIndentationFromPreviewRange(textEditorModel: ITextModel, startLineNumber: number, previewRange: IRange) {\n\t\tconst startIndent = textEditorModel.getLineFirstNonWhitespaceColumn(startLineNumber);\n\t\tlet minIndent = startIndent;\n\n\t\tfor (let endLineNumber = startLineNumber + 1; endLineNumber < previewRange.endLineNumber; endLineNumber++) {\n\t\t\tconst endIndent = textEditorModel.getLineFirstNonWhitespaceColumn(endLineNumber);\n\t\t\tminIndent = Math.min(minIndent, endIndent);\n\t\t}\n\n\t\tconst previewValue = textEditorModel.getValueInRange(previewRange).replace(new RegExp(`^\\\\s{${minIndent - 1}}`, 'gm'), '').trim();\n\t\treturn previewValue;\n\t}\n\n\tprivate getPreviewRangeBasedOnIndentation(textEditorModel: ITextModel, startLineNumber: number) {\n\t\tconst startIndent = textEditorModel.getLineFirstNonWhitespaceColumn(startLineNumber);\n\t\tconst maxLineNumber = Math.min(textEditorModel.getLineCount(), startLineNumber + GotoDefinitionAtPositionEditorContribution.MAX_SOURCE_PREVIEW_LINES);\n\t\tlet endLineNumber = startLineNumber + 1;\n\n\t\tfor (; endLineNumber < maxLineNumber; endLineNumber++) {\n\t\t\tconst endIndent = textEditorModel.getLineFirstNonWhitespaceColumn(endLineNumber);\n\n\t\t\tif (startIndent === endIndent) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn new Range(startLineNumber, 1, endLineNumber + 1, 1);\n\t}\n\n\tprivate addDecoration(range: Range, hoverMessage: MarkdownString | undefined): void {\n\n\t\tconst newDecorations: IModelDeltaDecoration = {\n\t\t\trange: range,\n\t\t\toptions: {\n\t\t\t\tdescription: 'goto-definition-link',\n\t\t\t\tinlineClassName: 'goto-definition-link',\n\t\t\t\thoverMessage\n\t\t\t}\n\t\t};\n\n\t\tthis.linkDecorations.set([newDecorations]);\n\t}\n\n\tprivate removeLinkDecorations(): void {\n\t\tthis.linkDecorations.clear();\n\t}\n\n\tprivate isEnabled(mouseEvent: ClickLinkMouseEvent, withKey?: ClickLinkKeyboardEvent): boolean {\n\t\treturn this.editor.hasModel()\n\t\t\t&& mouseEvent.isLeftClick\n\t\t\t&& mouseEvent.isNoneOrSingleMouseDown\n\t\t\t&& mouseEvent.target.type === MouseTargetType.CONTENT_TEXT\n\t\t\t&& !(mouseEvent.target.detail.injectedText?.options instanceof ModelDecorationInjectedTextOptions)\n\t\t\t&& (mouseEvent.hasTriggerModifier || (withKey ? withKey.keyCodeIsTriggerKey : false))\n\t\t\t&& this.languageFeaturesService.definitionProvider.has(this.editor.getModel());\n\t}\n\n\tprivate findDefinition(position: Position, token: CancellationToken): Promise<LocationLink[] | null> {\n\t\tconst model = this.editor.getModel();\n\t\tif (!model) {\n\t\t\treturn Promise.resolve(null);\n\t\t}\n\n\t\treturn getDefinitionsAtPosition(this.languageFeaturesService.definitionProvider, model, position, false, token);\n\t}\n\n\tprivate gotoDefinition(position: Position, openToSide: boolean): Promise<any> {\n\t\tthis.editor.setPosition(position);\n\t\treturn this.editor.invokeWithinContext((accessor) => {\n\t\t\tconst canPeek = !openToSide && this.editor.getOption(EditorOption.definitionLinkOpensInPeek) && !this.isInPeekEditor(accessor);\n\t\t\tconst action = new DefinitionAction({ openToSide, openInPeek: canPeek, muteMessage: true }, { title: { value: '', original: '' }, id: '', precondition: undefined });\n\t\t\treturn action.run(accessor);\n\t\t});\n\t}\n\n\tprivate isInPeekEditor(accessor: ServicesAccessor): boolean | undefined {\n\t\tconst contextKeyService = accessor.get(IContextKeyService);\n\t\treturn PeekContext.inPeekEditor.getValue(contextKeyService);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.toUnhook.dispose();\n\t\tthis.toUnhookForKeyboard.dispose();\n\t}\n}\n\nregisterEditorContribution(GotoDefinitionAtPositionEditorContribution.ID, GotoDefinitionAtPositionEditorContribution, EditorContributionInstantiation.BeforeFirstInteraction);\n"]}
1
+ {"version":3,"sources":["vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAGhG,OAAO,EAAqB,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAEjG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,gCAAgC,CAAC;AACxC,OAAO,EAAuB,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAE/F,OAAO,EAAmC,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAGtH,OAAO,EAAU,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAIjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAA+C,MAAM,uBAAuB,CAAC;AACtG,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yDAAyD,CAAC;AAE7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AAC3F,OAAO,EAAE,kCAAkC,EAAE,MAAM,uCAAuC,CAAC;AAEpF,IAAM,0CAA0C,GAAhD,MAAM,0CAA0C;;aAE/B,OAAE,GAAG,yCAAH,AAA4C,CAAC;aACtD,6BAAwB,GAAG,CAAH,AAAI,CAAC;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AAW,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,CAAC;YACrK,OAAO,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;IACJ,CAAC;IAEO,cAAc,CAAC,QAA0B;QAChD,MAAM,iBAAiB,GAAG,QAAQ,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAC3D,OAAO,WAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IAC7D,CAAC;IAEM,OAAO;QACb,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC;IACpC,CAAC;;AA7RW,0CAA0C;IAcpD,WAAA,iBAAiB,CAAA;IACjB,WAAA,gBAAgB,CAAA;IAChB,WAAA,wBAAwB,CAAA;GAhBd,0CAA0C,CA8RtD;;AAED,0BAA0B,CAAC,0CAA0C,CAAC,EAAE,EAAE,0CAA0C,iEAAyD,CAAC","file":"goToDefinitionAtPosition.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 { IKeyboardEvent } from '../../../../../base/browser/keyboardEvent.js';\nimport { CancelablePromise, createCancelablePromise } from '../../../../../base/common/async.js';\nimport { CancellationToken } from '../../../../../base/common/cancellation.js';\nimport { onUnexpectedError } from '../../../../../base/common/errors.js';\nimport { MarkdownString } from '../../../../../base/common/htmlContent.js';\nimport { DisposableStore } from '../../../../../base/common/lifecycle.js';\nimport './goToDefinitionAtPosition.css';\nimport { CodeEditorStateFlag, EditorState } from '../../../editorState/browser/editorState.js';\nimport { ICodeEditor, MouseTargetType } from '../../../../browser/editorBrowser.js';\nimport { EditorContributionInstantiation, registerEditorContribution } from '../../../../browser/editorExtensions.js';\nimport { EditorOption } from '../../../../common/config/editorOptions.js';\nimport { Position } from '../../../../common/core/position.js';\nimport { IRange, Range } from '../../../../common/core/range.js';\nimport { IEditorContribution, IEditorDecorationsCollection } from '../../../../common/editorCommon.js';\nimport { IModelDeltaDecoration, ITextModel } from '../../../../common/model.js';\nimport { LocationLink } from '../../../../common/languages.js';\nimport { ILanguageService } from '../../../../common/languages/language.js';\nimport { ITextModelService } from '../../../../common/services/resolverService.js';\nimport { ClickLinkGesture, ClickLinkKeyboardEvent, ClickLinkMouseEvent } from './clickLinkGesture.js';\nimport { PeekContext } from '../../../peekView/browser/peekView.js';\nimport * as nls from '../../../../../nls.js';\nimport { IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js';\nimport { ServicesAccessor } from '../../../../../platform/instantiation/common/instantiation.js';\nimport { DefinitionAction } from '../goToCommands.js';\nimport { getDefinitionsAtPosition } from '../goToSymbol.js';\nimport { IWordAtPosition } from '../../../../common/core/wordHelper.js';\nimport { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js';\nimport { ModelDecorationInjectedTextOptions } from '../../../../common/model/textModel.js';\n\nexport class GotoDefinitionAtPositionEditorContribution implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.gotodefinitionatposition';\n\tstatic readonly MAX_SOURCE_PREVIEW_LINES = 8;\n\n\tprivate readonly editor: ICodeEditor;\n\tprivate readonly toUnhook = new DisposableStore();\n\tprivate readonly toUnhookForKeyboard = new DisposableStore();\n\tprivate readonly linkDecorations: IEditorDecorationsCollection;\n\tprivate currentWordAtPosition: IWordAtPosition | null = null;\n\tprivate previousPromise: CancelablePromise<LocationLink[] | null> | null = null;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@ITextModelService private readonly textModelResolverService: ITextModelService,\n\t\t@ILanguageService private readonly languageService: ILanguageService,\n\t\t@ILanguageFeaturesService private readonly languageFeaturesService: ILanguageFeaturesService,\n\t) {\n\t\tthis.editor = editor;\n\t\tthis.linkDecorations = this.editor.createDecorationsCollection();\n\n\t\tconst linkGesture = new ClickLinkGesture(editor);\n\t\tthis.toUnhook.add(linkGesture);\n\n\t\tthis.toUnhook.add(linkGesture.onMouseMoveOrRelevantKeyDown(([mouseEvent, keyboardEvent]) => {\n\t\t\tthis.startFindDefinitionFromMouse(mouseEvent, keyboardEvent ?? undefined);\n\t\t}));\n\n\t\tthis.toUnhook.add(linkGesture.onExecute((mouseEvent: ClickLinkMouseEvent) => {\n\t\t\tif (this.isEnabled(mouseEvent)) {\n\t\t\t\tthis.gotoDefinition(mouseEvent.target.position!, mouseEvent.hasSideBySideModifier)\n\t\t\t\t\t.catch((error: Error) => {\n\t\t\t\t\t\tonUnexpectedError(error);\n\t\t\t\t\t})\n\t\t\t\t\t.finally(() => {\n\t\t\t\t\t\tthis.removeLinkDecorations();\n\t\t\t\t\t});\n\t\t\t}\n\t\t}));\n\n\t\tthis.toUnhook.add(linkGesture.onCancel(() => {\n\t\t\tthis.removeLinkDecorations();\n\t\t\tthis.currentWordAtPosition = null;\n\t\t}));\n\t}\n\n\tstatic get(editor: ICodeEditor): GotoDefinitionAtPositionEditorContribution | null {\n\t\treturn editor.getContribution<GotoDefinitionAtPositionEditorContribution>(GotoDefinitionAtPositionEditorContribution.ID);\n\t}\n\n\tasync startFindDefinitionFromCursor(position: Position) {\n\t\t// For issue: https://github.com/microsoft/vscode/issues/46257\n\t\t// equivalent to mouse move with meta/ctrl key\n\n\t\t// First find the definition and add decorations\n\t\t// to the editor to be shown with the content hover widget\n\t\tawait this.startFindDefinition(position);\n\t\t// Add listeners for editor cursor move and key down events\n\t\t// Dismiss the \"extended\" editor decorations when the user hides\n\t\t// the hover widget. There is no event for the widget itself so these\n\t\t// serve as a best effort. After removing the link decorations, the hover\n\t\t// widget is clean and will only show declarations per next request.\n\t\tthis.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(() => {\n\t\t\tthis.currentWordAtPosition = null;\n\t\t\tthis.removeLinkDecorations();\n\t\t\tthis.toUnhookForKeyboard.clear();\n\t\t}));\n\t\tthis.toUnhookForKeyboard.add(this.editor.onKeyDown((e: IKeyboardEvent) => {\n\t\t\tif (e) {\n\t\t\t\tthis.currentWordAtPosition = null;\n\t\t\t\tthis.removeLinkDecorations();\n\t\t\t\tthis.toUnhookForKeyboard.clear();\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate startFindDefinitionFromMouse(mouseEvent: ClickLinkMouseEvent, withKey?: ClickLinkKeyboardEvent): void {\n\n\t\t// check if we are active and on a content widget\n\t\tif (mouseEvent.target.type === MouseTargetType.CONTENT_WIDGET && this.linkDecorations.length > 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.editor.hasModel() || !this.isEnabled(mouseEvent, withKey)) {\n\t\t\tthis.currentWordAtPosition = null;\n\t\t\tthis.removeLinkDecorations();\n\t\t\treturn;\n\t\t}\n\n\t\tconst position = mouseEvent.target.position!;\n\n\t\tthis.startFindDefinition(position);\n\t}\n\n\tprivate async startFindDefinition(position: Position): Promise<void> {\n\n\t\t// Dispose listeners for updating decorations when using keyboard to show definition hover\n\t\tthis.toUnhookForKeyboard.clear();\n\n\t\t// Find word at mouse position\n\t\tconst word = position ? this.editor.getModel()?.getWordAtPosition(position) : null;\n\t\tif (!word) {\n\t\t\tthis.currentWordAtPosition = null;\n\t\t\tthis.removeLinkDecorations();\n\t\t\treturn;\n\t\t}\n\n\t\t// Return early if word at position is still the same\n\t\tif (this.currentWordAtPosition && this.currentWordAtPosition.startColumn === word.startColumn && this.currentWordAtPosition.endColumn === word.endColumn && this.currentWordAtPosition.word === word.word) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.currentWordAtPosition = word;\n\n\t\t// Find definition and decorate word if found\n\t\tconst state = new EditorState(this.editor, CodeEditorStateFlag.Position | CodeEditorStateFlag.Value | CodeEditorStateFlag.Selection | CodeEditorStateFlag.Scroll);\n\n\t\tif (this.previousPromise) {\n\t\t\tthis.previousPromise.cancel();\n\t\t\tthis.previousPromise = null;\n\t\t}\n\n\t\tthis.previousPromise = createCancelablePromise(token => this.findDefinition(position, token));\n\n\t\tlet results: LocationLink[] | null;\n\t\ttry {\n\t\t\tresults = await this.previousPromise;\n\n\t\t} catch (error) {\n\t\t\tonUnexpectedError(error);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!results || !results.length || !state.validate(this.editor)) {\n\t\t\tthis.removeLinkDecorations();\n\t\t\treturn;\n\t\t}\n\n\t\tconst linkRange = results[0].originSelectionRange\n\t\t\t? Range.lift(results[0].originSelectionRange)\n\t\t\t: new Range(position.lineNumber, word.startColumn, position.lineNumber, word.endColumn);\n\n\t\t// Multiple results\n\t\tif (results.length > 1) {\n\n\t\t\tlet combinedRange = linkRange;\n\t\t\tfor (const { originSelectionRange } of results) {\n\t\t\t\tif (originSelectionRange) {\n\t\t\t\t\tcombinedRange = Range.plusRange(combinedRange, originSelectionRange);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.addDecoration(\n\t\t\t\tcombinedRange,\n\t\t\t\tnew MarkdownString().appendText(nls.localize('multipleResults', \"Click to show {0} definitions.\", results.length))\n\t\t\t);\n\t\t} else {\n\t\t\t// Single result\n\t\t\tconst result = results[0];\n\n\t\t\tif (!result.uri) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treturn this.textModelResolverService.createModelReference(result.uri).then(ref => {\n\n\t\t\t\tif (!ref.object || !ref.object.textEditorModel) {\n\t\t\t\t\tref.dispose();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst { object: { textEditorModel } } = ref;\n\t\t\t\tconst { startLineNumber } = result.range;\n\n\t\t\t\tif (startLineNumber < 1 || startLineNumber > textEditorModel.getLineCount()) {\n\t\t\t\t\t// invalid range\n\t\t\t\t\tref.dispose();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst previewValue = this.getPreviewValue(textEditorModel, startLineNumber, result);\n\t\t\t\tconst languageId = this.languageService.guessLanguageIdByFilepathOrFirstLine(textEditorModel.uri);\n\t\t\t\tthis.addDecoration(\n\t\t\t\t\tlinkRange,\n\t\t\t\t\tpreviewValue ? new MarkdownString().appendCodeblock(languageId ? languageId : '', previewValue) : undefined\n\t\t\t\t);\n\t\t\t\tref.dispose();\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate getPreviewValue(textEditorModel: ITextModel, startLineNumber: number, result: LocationLink) {\n\t\tlet rangeToUse = result.range;\n\t\tconst numberOfLinesInRange = rangeToUse.endLineNumber - rangeToUse.startLineNumber;\n\t\tif (numberOfLinesInRange >= GotoDefinitionAtPositionEditorContribution.MAX_SOURCE_PREVIEW_LINES) {\n\t\t\trangeToUse = this.getPreviewRangeBasedOnIndentation(textEditorModel, startLineNumber);\n\t\t}\n\t\trangeToUse = textEditorModel.validateRange(rangeToUse);\n\t\tconst previewValue = this.stripIndentationFromPreviewRange(textEditorModel, startLineNumber, rangeToUse);\n\t\treturn previewValue;\n\t}\n\n\tprivate stripIndentationFromPreviewRange(textEditorModel: ITextModel, startLineNumber: number, previewRange: IRange) {\n\t\tconst startIndent = textEditorModel.getLineFirstNonWhitespaceColumn(startLineNumber);\n\t\tlet minIndent = startIndent;\n\n\t\tfor (let endLineNumber = startLineNumber + 1; endLineNumber < previewRange.endLineNumber; endLineNumber++) {\n\t\t\tconst endIndent = textEditorModel.getLineFirstNonWhitespaceColumn(endLineNumber);\n\t\t\tminIndent = Math.min(minIndent, endIndent);\n\t\t}\n\n\t\tconst previewValue = textEditorModel.getValueInRange(previewRange).replace(new RegExp(`^\\\\s{${minIndent - 1}}`, 'gm'), '').trim();\n\t\treturn previewValue;\n\t}\n\n\tprivate getPreviewRangeBasedOnIndentation(textEditorModel: ITextModel, startLineNumber: number) {\n\t\tconst startIndent = textEditorModel.getLineFirstNonWhitespaceColumn(startLineNumber);\n\t\tconst maxLineNumber = Math.min(textEditorModel.getLineCount(), startLineNumber + GotoDefinitionAtPositionEditorContribution.MAX_SOURCE_PREVIEW_LINES);\n\t\tlet endLineNumber = startLineNumber + 1;\n\n\t\tfor (; endLineNumber < maxLineNumber; endLineNumber++) {\n\t\t\tconst endIndent = textEditorModel.getLineFirstNonWhitespaceColumn(endLineNumber);\n\n\t\t\tif (startIndent === endIndent) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn new Range(startLineNumber, 1, endLineNumber + 1, 1);\n\t}\n\n\tprivate addDecoration(range: Range, hoverMessage: MarkdownString | undefined): void {\n\n\t\tconst newDecorations: IModelDeltaDecoration = {\n\t\t\trange: range,\n\t\t\toptions: {\n\t\t\t\tdescription: 'goto-definition-link',\n\t\t\t\tinlineClassName: 'goto-definition-link',\n\t\t\t\thoverMessage\n\t\t\t}\n\t\t};\n\n\t\tthis.linkDecorations.set([newDecorations]);\n\t}\n\n\tprivate removeLinkDecorations(): void {\n\t\tthis.linkDecorations.clear();\n\t}\n\n\tprivate isEnabled(mouseEvent: ClickLinkMouseEvent, withKey?: ClickLinkKeyboardEvent): boolean {\n\t\treturn this.editor.hasModel()\n\t\t\t&& mouseEvent.isLeftClick\n\t\t\t&& mouseEvent.isNoneOrSingleMouseDown\n\t\t\t&& mouseEvent.target.type === MouseTargetType.CONTENT_TEXT\n\t\t\t&& !(mouseEvent.target.detail.injectedText?.options instanceof ModelDecorationInjectedTextOptions)\n\t\t\t&& (mouseEvent.hasTriggerModifier || (withKey ? withKey.keyCodeIsTriggerKey : false))\n\t\t\t&& this.languageFeaturesService.definitionProvider.has(this.editor.getModel());\n\t}\n\n\tprivate findDefinition(position: Position, token: CancellationToken): Promise<LocationLink[] | null> {\n\t\tconst model = this.editor.getModel();\n\t\tif (!model) {\n\t\t\treturn Promise.resolve(null);\n\t\t}\n\n\t\treturn getDefinitionsAtPosition(this.languageFeaturesService.definitionProvider, model, position, false, token);\n\t}\n\n\tprivate async gotoDefinition(position: Position, openToSide: boolean): Promise<unknown> {\n\t\tthis.editor.setPosition(position);\n\t\treturn this.editor.invokeWithinContext((accessor) => {\n\t\t\tconst canPeek = !openToSide && this.editor.getOption(EditorOption.definitionLinkOpensInPeek) && !this.isInPeekEditor(accessor);\n\t\t\tconst action = new DefinitionAction({ openToSide, openInPeek: canPeek, muteMessage: true }, { title: { value: '', original: '' }, id: '', precondition: undefined });\n\t\t\treturn action.run(accessor);\n\t\t});\n\t}\n\n\tprivate isInPeekEditor(accessor: ServicesAccessor): boolean | undefined {\n\t\tconst contextKeyService = accessor.get(IContextKeyService);\n\t\treturn PeekContext.inPeekEditor.getValue(contextKeyService);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.toUnhook.dispose();\n\t\tthis.toUnhookForKeyboard.dispose();\n\t}\n}\n\nregisterEditorContribution(GotoDefinitionAtPositionEditorContribution.ID, GotoDefinitionAtPositionEditorContribution, EditorContributionInstantiation.BeforeFirstInteraction);\n"]}