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Y,CAAC,GAErB,CACA,OAAAttB,GACIlD,MAAMkD,UACN7G,KAAKwD,OAAOktB,oBAAoB1wB,KACpC,EAEJg7B,EAAqBY,OAAS,qCAC9B,IAAIC,EAAwB,cAAoC,KAC5D,WAAAh8B,CAAY+U,EAAIuY,EAASnS,GACrBrX,QACA3D,KAAK4U,GAAKA,EACV5U,KAAKmtB,QAAUA,EACfntB,KAAKgb,sBAAwBA,EAE7Bhb,KAAK87B,WAAa,IAClB97B,KAAK+7B,aAAe/7B,KAAKgG,UAAU,IAAI,MACvChG,KAAKg8B,eAAiB,IAAI,KAC1Bh8B,KAAKi8B,iBAAmB,EACxBj8B,KAAKk8B,oBAAsB/O,EAAQqJ,6BACvC,CACA,eAAM2F,CAAUhxB,EAAU+gB,EAAO7V,GAC7B,MAAM+lB,EAAcp8B,KAAKi8B,mBACzBj8B,KAAKq8B,kBAAoBD,EACzBp8B,KAAK4G,QACL5G,KAAK+7B,aAAatyB,OAAQ,SAAkB,KACxC,MAAMlE,EAAQ,kBAAoB4F,GACZnL,KAAKk8B,oBAAoB/1B,IAAI,CAAC,CAC5CZ,MAAOA,EACPE,QAASo1B,KAEC16B,OAAS,IACvBH,KAAKg8B,eAAevyB,MAAQzJ,KAAKgb,sBAAsBK,eAAe2f,EAAsBh7B,KAAK4U,GAAI5U,KAAKmtB,QAAS5nB,EAAO2mB,EAAO7V,GACrI,GACDrW,KAAK87B,YACR,IACI,aAAazlB,CACjB,CACA,QACQrW,KAAKq8B,oBAAsBD,IAC3Bp8B,KAAK4G,QACL5G,KAAKq8B,uBAAoB93B,EAEjC,CACJ,CACA,KAAAqC,GACI5G,KAAK+7B,aAAan1B,QAClB5G,KAAKk8B,oBAAoBt1B,QACzB5G,KAAKg8B,eAAep1B,OACxB,GAEJi1B,EAAwBx5B,EAAW,CAC/Bc,EAAQ,EAAG,OACZ04B,E","sources":["file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/commandIds.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/ghostText.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/ghostTextWidget.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletionContextKeys.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/provideInlineCompletions.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/singleTextEdit.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsSource.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/suggestWidgetInlineCompletionProvider.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/commands.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/hoverParticipant.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsAccessibleView.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHintsWidget.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/utils.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineEdit/browser/ghostTextWidget.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineEdit/browser/inlineEditHintsWidget.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineEdit/browser/inlineEditController.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineEdit/browser/commands.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineEdit/browser/commandIds.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineEdit/browser/hoverParticipant.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineEdit/browser/inlineEdit.contribution.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/inlineProgress/browser/inlineProgress.js"],"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 *--------------------------------------------------------------------------------------------*/\nexport const inlineSuggestCommitId = 'editor.action.inlineSuggest.commit';\nexport const showPreviousInlineSuggestionActionId = 'editor.action.inlineSuggest.showPrevious';\nexport const showNextInlineSuggestionActionId = 'editor.action.inlineSuggest.showNext';\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { equals } from '../../../../base/common/arrays.js';\nimport { splitLines } from '../../../../base/common/strings.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { SingleTextEdit, TextEdit } from '../../../common/core/textEdit.js';\nexport class GhostText {\n constructor(lineNumber, parts) {\n this.lineNumber = lineNumber;\n this.parts = parts;\n }\n equals(other) {\n return this.lineNumber === other.lineNumber &&\n this.parts.length === other.parts.length &&\n this.parts.every((part, index) => part.equals(other.parts[index]));\n }\n renderForScreenReader(lineText) {\n if (this.parts.length === 0) {\n return '';\n }\n const lastPart = this.parts[this.parts.length - 1];\n const cappedLineText = lineText.substr(0, lastPart.column - 1);\n const text = new TextEdit([\n ...this.parts.map(p => new SingleTextEdit(Range.fromPositions(new Position(1, p.column)), p.lines.join('\\n'))),\n ]).applyToString(cappedLineText);\n return text.substring(this.parts[0].column - 1);\n }\n isEmpty() {\n return this.parts.every(p => p.lines.length === 0);\n }\n get lineCount() {\n return 1 + this.parts.reduce((r, p) => r + p.lines.length - 1, 0);\n }\n}\nexport class GhostTextPart {\n constructor(column, text, \n /**\n * Indicates if this part is a preview of an inline suggestion when a suggestion is previewed.\n */\n preview) {\n this.column = column;\n this.text = text;\n this.preview = preview;\n this.lines = splitLines(this.text);\n }\n equals(other) {\n return this.column === other.column &&\n this.lines.length === other.lines.length &&\n this.lines.every((line, index) => line === other.lines[index]);\n }\n}\nexport class GhostTextReplacement {\n constructor(lineNumber, columnRange, text, additionalReservedLineCount = 0) {\n this.lineNumber = lineNumber;\n this.columnRange = columnRange;\n this.text = text;\n this.additionalReservedLineCount = additionalReservedLineCount;\n this.parts = [\n new GhostTextPart(this.columnRange.endColumnExclusive, this.text, false),\n ];\n this.newLines = splitLines(this.text);\n }\n renderForScreenReader(_lineText) {\n return this.newLines.join('\\n');\n }\n get lineCount() {\n return this.newLines.length;\n }\n isEmpty() {\n return this.parts.every(p => p.lines.length === 0);\n }\n equals(other) {\n return this.lineNumber === other.lineNumber &&\n this.columnRange.equals(other.columnRange) &&\n this.newLines.length === other.newLines.length &&\n this.newLines.every((line, index) => line === other.newLines[index]) &&\n this.additionalReservedLineCount === other.additionalReservedLineCount;\n }\n}\nexport function ghostTextsOrReplacementsEqual(a, b) {\n return equals(a, b, ghostTextOrReplacementEquals);\n}\nexport function ghostTextOrReplacementEquals(a, b) {\n if (a === b) {\n return true;\n }\n if (!a || !b) {\n return false;\n }\n if (a instanceof GhostText && b instanceof GhostText) {\n return a.equals(b);\n }\n if (a instanceof GhostTextReplacement && b instanceof GhostTextReplacement) {\n return a.equals(b);\n }\n return false;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nimport { createTrustedTypesPolicy } from '../../../../base/browser/trustedTypes.js';\nimport { Event } from '../../../../base/common/event.js';\nimport { Disposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { autorun, derived, observableFromEvent, observableSignalFromEvent, observableValue } from '../../../../base/common/observable.js';\nimport * as strings from '../../../../base/common/strings.js';\nimport './ghostText.css';\nimport { applyFontInfo } from '../../../browser/config/domFontInfo.js';\nimport { EditorFontLigatures } from '../../../common/config/editorOptions.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { StringBuilder } from '../../../common/core/stringBuilder.js';\nimport { ILanguageService } from '../../../common/languages/language.js';\nimport { InjectedTextCursorStops } from '../../../common/model.js';\nimport { LineTokens } from '../../../common/tokens/lineTokens.js';\nimport { LineDecoration } from '../../../common/viewLayout/lineDecorations.js';\nimport { RenderLineInput, renderViewLine } from '../../../common/viewLayout/viewLineRenderer.js';\nimport { GhostTextReplacement } from './ghostText.js';\nimport { ColumnRange, applyObservableDecorations } from './utils.js';\nexport const GHOST_TEXT_DESCRIPTION = 'ghost-text';\nlet GhostTextWidget = class GhostTextWidget extends Disposable {\n constructor(editor, model, languageService) {\n super();\n this.editor = editor;\n this.model = model;\n this.languageService = languageService;\n this.isDisposed = observableValue(this, false);\n this.currentTextModel = observableFromEvent(this.editor.onDidChangeModel, () => /** @description editor.model */ this.editor.getModel());\n this.uiState = derived(this, reader => {\n if (this.isDisposed.read(reader)) {\n return undefined;\n }\n const textModel = this.currentTextModel.read(reader);\n if (textModel !== this.model.targetTextModel.read(reader)) {\n return undefined;\n }\n const ghostText = this.model.ghostText.read(reader);\n if (!ghostText) {\n return undefined;\n }\n const replacedRange = ghostText instanceof GhostTextReplacement ? ghostText.columnRange : undefined;\n const inlineTexts = [];\n const additionalLines = [];\n function addToAdditionalLines(lines, className) {\n if (additionalLines.length > 0) {\n const lastLine = additionalLines[additionalLines.length - 1];\n if (className) {\n lastLine.decorations.push(new LineDecoration(lastLine.content.length + 1, lastLine.content.length + 1 + lines[0].length, className, 0 /* InlineDecorationType.Regular */));\n }\n lastLine.content += lines[0];\n lines = lines.slice(1);\n }\n for (const line of lines) {\n additionalLines.push({\n content: line,\n decorations: className ? [new LineDecoration(1, line.length + 1, className, 0 /* InlineDecorationType.Regular */)] : []\n });\n }\n }\n const textBufferLine = textModel.getLineContent(ghostText.lineNumber);\n let hiddenTextStartColumn = undefined;\n let lastIdx = 0;\n for (const part of ghostText.parts) {\n let lines = part.lines;\n if (hiddenTextStartColumn === undefined) {\n inlineTexts.push({\n column: part.column,\n text: lines[0],\n preview: part.preview,\n });\n lines = lines.slice(1);\n }\n else {\n addToAdditionalLines([textBufferLine.substring(lastIdx, part.column - 1)], undefined);\n }\n if (lines.length > 0) {\n addToAdditionalLines(lines, GHOST_TEXT_DESCRIPTION);\n if (hiddenTextStartColumn === undefined && part.column <= textBufferLine.length) {\n hiddenTextStartColumn = part.column;\n }\n }\n lastIdx = part.column - 1;\n }\n if (hiddenTextStartColumn !== undefined) {\n addToAdditionalLines([textBufferLine.substring(lastIdx)], undefined);\n }\n const hiddenRange = hiddenTextStartColumn !== undefined ? new ColumnRange(hiddenTextStartColumn, textBufferLine.length + 1) : undefined;\n return {\n replacedRange,\n inlineTexts,\n additionalLines,\n hiddenRange,\n lineNumber: ghostText.lineNumber,\n additionalReservedLineCount: this.model.minReservedLineCount.read(reader),\n targetTextModel: textModel,\n };\n });\n this.decorations = derived(this, reader => {\n const uiState = this.uiState.read(reader);\n if (!uiState) {\n return [];\n }\n const decorations = [];\n if (uiState.replacedRange) {\n decorations.push({\n range: uiState.replacedRange.toRange(uiState.lineNumber),\n options: { inlineClassName: 'inline-completion-text-to-replace', description: 'GhostTextReplacement' }\n });\n }\n if (uiState.hiddenRange) {\n decorations.push({\n range: uiState.hiddenRange.toRange(uiState.lineNumber),\n options: { inlineClassName: 'ghost-text-hidden', description: 'ghost-text-hidden', }\n });\n }\n for (const p of uiState.inlineTexts) {\n decorations.push({\n range: Range.fromPositions(new Position(uiState.lineNumber, p.column)),\n options: {\n description: GHOST_TEXT_DESCRIPTION,\n after: { content: p.text, inlineClassName: p.preview ? 'ghost-text-decoration-preview' : 'ghost-text-decoration', cursorStops: InjectedTextCursorStops.Left },\n showIfCollapsed: true,\n }\n });\n }\n return decorations;\n });\n this.additionalLinesWidget = this._register(new AdditionalLinesWidget(this.editor, this.languageService.languageIdCodec, derived(reader => {\n /** @description lines */\n const uiState = this.uiState.read(reader);\n return uiState ? {\n lineNumber: uiState.lineNumber,\n additionalLines: uiState.additionalLines,\n minReservedLineCount: uiState.additionalReservedLineCount,\n targetTextModel: uiState.targetTextModel,\n } : undefined;\n })));\n this._register(toDisposable(() => { this.isDisposed.set(true, undefined); }));\n this._register(applyObservableDecorations(this.editor, this.decorations));\n }\n ownsViewZone(viewZoneId) {\n return this.additionalLinesWidget.viewZoneId === viewZoneId;\n }\n};\nGhostTextWidget = __decorate([\n __param(2, ILanguageService)\n], GhostTextWidget);\nexport { GhostTextWidget };\nexport class AdditionalLinesWidget extends Disposable {\n get viewZoneId() { return this._viewZoneId; }\n constructor(editor, languageIdCodec, lines) {\n super();\n this.editor = editor;\n this.languageIdCodec = languageIdCodec;\n this.lines = lines;\n this._viewZoneId = undefined;\n this.editorOptionsChanged = observableSignalFromEvent('editorOptionChanged', Event.filter(this.editor.onDidChangeConfiguration, e => e.hasChanged(33 /* EditorOption.disableMonospaceOptimizations */)\n || e.hasChanged(117 /* EditorOption.stopRenderingLineAfter */)\n || e.hasChanged(99 /* EditorOption.renderWhitespace */)\n || e.hasChanged(94 /* EditorOption.renderControlCharacters */)\n || e.hasChanged(51 /* EditorOption.fontLigatures */)\n || e.hasChanged(50 /* EditorOption.fontInfo */)\n || e.hasChanged(67 /* EditorOption.lineHeight */)));\n this._register(autorun(reader => {\n /** @description update view zone */\n const lines = this.lines.read(reader);\n this.editorOptionsChanged.read(reader);\n if (lines) {\n this.updateLines(lines.lineNumber, lines.additionalLines, lines.minReservedLineCount);\n }\n else {\n this.clear();\n }\n }));\n }\n dispose() {\n super.dispose();\n this.clear();\n }\n clear() {\n this.editor.changeViewZones((changeAccessor) => {\n if (this._viewZoneId) {\n changeAccessor.removeZone(this._viewZoneId);\n this._viewZoneId = undefined;\n }\n });\n }\n updateLines(lineNumber, additionalLines, minReservedLineCount) {\n const textModel = this.editor.getModel();\n if (!textModel) {\n return;\n }\n const { tabSize } = textModel.getOptions();\n this.editor.changeViewZones((changeAccessor) => {\n if (this._viewZoneId) {\n changeAccessor.removeZone(this._viewZoneId);\n this._viewZoneId = undefined;\n }\n const heightInLines = Math.max(additionalLines.length, minReservedLineCount);\n if (heightInLines > 0) {\n const domNode = document.createElement('div');\n renderLines(domNode, tabSize, additionalLines, this.editor.getOptions(), this.languageIdCodec);\n this._viewZoneId = changeAccessor.addZone({\n afterLineNumber: lineNumber,\n heightInLines: heightInLines,\n domNode,\n afterColumnAffinity: 1 /* PositionAffinity.Right */\n });\n }\n });\n }\n}\nfunction renderLines(domNode, tabSize, lines, opts, languageIdCodec) {\n const disableMonospaceOptimizations = opts.get(33 /* EditorOption.disableMonospaceOptimizations */);\n const stopRenderingLineAfter = opts.get(117 /* EditorOption.stopRenderingLineAfter */);\n // To avoid visual confusion, we don't want to render visible whitespace\n const renderWhitespace = 'none';\n const renderControlCharacters = opts.get(94 /* EditorOption.renderControlCharacters */);\n const fontLigatures = opts.get(51 /* EditorOption.fontLigatures */);\n const fontInfo = opts.get(50 /* EditorOption.fontInfo */);\n const lineHeight = opts.get(67 /* EditorOption.lineHeight */);\n const sb = new StringBuilder(10000);\n sb.appendString('
');\n for (let i = 0, len = lines.length; i < len; i++) {\n const lineData = lines[i];\n const line = lineData.content;\n sb.appendString('
');\n const isBasicASCII = strings.isBasicASCII(line);\n const containsRTL = strings.containsRTL(line);\n const lineTokens = LineTokens.createEmpty(line, languageIdCodec);\n renderViewLine(new RenderLineInput((fontInfo.isMonospace && !disableMonospaceOptimizations), fontInfo.canUseHalfwidthRightwardsArrow, line, false, isBasicASCII, containsRTL, 0, lineTokens, lineData.decorations, tabSize, 0, fontInfo.spaceWidth, fontInfo.middotWidth, fontInfo.wsmiddotWidth, stopRenderingLineAfter, renderWhitespace, renderControlCharacters, fontLigatures !== EditorFontLigatures.OFF, null), sb);\n sb.appendString('
');\n }\n sb.appendString('
');\n applyFontInfo(domNode, fontInfo);\n const html = sb.build();\n const trustedhtml = ttPolicy ? ttPolicy.createHTML(html) : html;\n domNode.innerHTML = trustedhtml;\n}\nexport const ttPolicy = createTrustedTypesPolicy('editorGhostText', { createHTML: value => value });\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { autorun } from '../../../../base/common/observable.js';\nimport { firstNonWhitespaceIndex } from '../../../../base/common/strings.js';\nimport { CursorColumns } from '../../../common/core/cursorColumns.js';\nimport { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';\nimport { Disposable } from '../../../../base/common/lifecycle.js';\nimport { localize } from '../../../../nls.js';\nexport class InlineCompletionContextKeys extends Disposable {\n constructor(contextKeyService, model) {\n super();\n this.contextKeyService = contextKeyService;\n this.model = model;\n this.inlineCompletionVisible = InlineCompletionContextKeys.inlineSuggestionVisible.bindTo(this.contextKeyService);\n this.inlineCompletionSuggestsIndentation = InlineCompletionContextKeys.inlineSuggestionHasIndentation.bindTo(this.contextKeyService);\n this.inlineCompletionSuggestsIndentationLessThanTabSize = InlineCompletionContextKeys.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService);\n this.suppressSuggestions = InlineCompletionContextKeys.suppressSuggestions.bindTo(this.contextKeyService);\n this._register(autorun(reader => {\n /** @description update context key: inlineCompletionVisible, suppressSuggestions */\n const model = this.model.read(reader);\n const state = model === null || model === void 0 ? void 0 : model.state.read(reader);\n const isInlineCompletionVisible = !!(state === null || state === void 0 ? void 0 : state.inlineCompletion) && (state === null || state === void 0 ? void 0 : state.primaryGhostText) !== undefined && !(state === null || state === void 0 ? void 0 : state.primaryGhostText.isEmpty());\n this.inlineCompletionVisible.set(isInlineCompletionVisible);\n if ((state === null || state === void 0 ? void 0 : state.primaryGhostText) && (state === null || state === void 0 ? void 0 : state.inlineCompletion)) {\n this.suppressSuggestions.set(state.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions);\n }\n }));\n this._register(autorun(reader => {\n /** @description update context key: inlineCompletionSuggestsIndentation, inlineCompletionSuggestsIndentationLessThanTabSize */\n const model = this.model.read(reader);\n let startsWithIndentation = false;\n let startsWithIndentationLessThanTabSize = true;\n const ghostText = model === null || model === void 0 ? void 0 : model.primaryGhostText.read(reader);\n if (!!(model === null || model === void 0 ? void 0 : model.selectedSuggestItem) && ghostText && ghostText.parts.length > 0) {\n const { column, lines } = ghostText.parts[0];\n const firstLine = lines[0];\n const indentationEndColumn = model.textModel.getLineIndentColumn(ghostText.lineNumber);\n const inIndentation = column <= indentationEndColumn;\n if (inIndentation) {\n let firstNonWsIdx = firstNonWhitespaceIndex(firstLine);\n if (firstNonWsIdx === -1) {\n firstNonWsIdx = firstLine.length - 1;\n }\n startsWithIndentation = firstNonWsIdx > 0;\n const tabSize = model.textModel.getOptions().tabSize;\n const visibleColumnIndentation = CursorColumns.visibleColumnFromColumn(firstLine, firstNonWsIdx + 1, tabSize);\n startsWithIndentationLessThanTabSize = visibleColumnIndentation < tabSize;\n }\n }\n this.inlineCompletionSuggestsIndentation.set(startsWithIndentation);\n this.inlineCompletionSuggestsIndentationLessThanTabSize.set(startsWithIndentationLessThanTabSize);\n }));\n }\n}\nInlineCompletionContextKeys.inlineSuggestionVisible = new RawContextKey('inlineSuggestionVisible', false, localize('inlineSuggestionVisible', \"Whether an inline suggestion is visible\"));\nInlineCompletionContextKeys.inlineSuggestionHasIndentation = new RawContextKey('inlineSuggestionHasIndentation', false, localize('inlineSuggestionHasIndentation', \"Whether the inline suggestion starts with whitespace\"));\nInlineCompletionContextKeys.inlineSuggestionHasIndentationLessThanTabSize = new RawContextKey('inlineSuggestionHasIndentationLessThanTabSize', true, localize('inlineSuggestionHasIndentationLessThanTabSize', \"Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab\"));\nInlineCompletionContextKeys.suppressSuggestions = new RawContextKey('inlineSuggestionSuppressSuggestions', undefined, localize('suppressSuggestions', \"Whether suggestions should be suppressed for the current suggestion\"));\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { assertNever } from '../../../../base/common/assert.js';\nimport { DeferredPromise } from '../../../../base/common/async.js';\nimport { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { SetMap } from '../../../../base/common/map.js';\nimport { onUnexpectedExternalError } from '../../../../base/common/errors.js';\nimport { Range } from '../../../common/core/range.js';\nimport { fixBracketsInLine } from '../../../common/model/bracketPairsTextModelPart/fixBrackets.js';\nimport { getReadonlyEmptyArray } from './utils.js';\nimport { SnippetParser, Text } from '../../snippet/browser/snippetParser.js';\nexport async function provideInlineCompletions(registry, position, model, context, token = CancellationToken.None, languageConfigurationService) {\n // Important: Don't use position after the await calls, as the model could have been changed in the meantime!\n const defaultReplaceRange = getDefaultRange(position, model);\n const providers = registry.all(model);\n const multiMap = new SetMap();\n for (const provider of providers) {\n if (provider.groupId) {\n multiMap.add(provider.groupId, provider);\n }\n }\n function getPreferredProviders(provider) {\n if (!provider.yieldsToGroupIds) {\n return [];\n }\n const result = [];\n for (const groupId of provider.yieldsToGroupIds || []) {\n const providers = multiMap.get(groupId);\n for (const p of providers) {\n result.push(p);\n }\n }\n return result;\n }\n const states = new Map();\n const seen = new Set();\n function findPreferredProviderCircle(provider, stack) {\n stack = [...stack, provider];\n if (seen.has(provider)) {\n return stack;\n }\n seen.add(provider);\n try {\n const preferred = getPreferredProviders(provider);\n for (const p of preferred) {\n const c = findPreferredProviderCircle(p, stack);\n if (c) {\n return c;\n }\n }\n }\n finally {\n seen.delete(provider);\n }\n return undefined;\n }\n function processProvider(provider) {\n const state = states.get(provider);\n if (state) {\n return state;\n }\n const circle = findPreferredProviderCircle(provider, []);\n if (circle) {\n onUnexpectedExternalError(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${circle.map(s => s.toString ? s.toString() : ('' + s)).join(' -> ')}`));\n }\n const deferredPromise = new DeferredPromise();\n states.set(provider, deferredPromise.p);\n (async () => {\n if (!circle) {\n const preferred = getPreferredProviders(provider);\n for (const p of preferred) {\n const result = await processProvider(p);\n if (result && result.items.length > 0) {\n // Skip provider\n return undefined;\n }\n }\n }\n try {\n const completions = await provider.provideInlineCompletions(model, position, context, token);\n return completions;\n }\n catch (e) {\n onUnexpectedExternalError(e);\n return undefined;\n }\n })().then(c => deferredPromise.complete(c), e => deferredPromise.error(e));\n return deferredPromise.p;\n }\n const providerResults = await Promise.all(providers.map(async (provider) => ({ provider, completions: await processProvider(provider) })));\n const itemsByHash = new Map();\n const lists = [];\n for (const result of providerResults) {\n const completions = result.completions;\n if (!completions) {\n continue;\n }\n const list = new InlineCompletionList(completions, result.provider);\n lists.push(list);\n for (const item of completions.items) {\n const inlineCompletionItem = InlineCompletionItem.from(item, list, defaultReplaceRange, model, languageConfigurationService);\n itemsByHash.set(inlineCompletionItem.hash(), inlineCompletionItem);\n }\n }\n return new InlineCompletionProviderResult(Array.from(itemsByHash.values()), new Set(itemsByHash.keys()), lists);\n}\nexport class InlineCompletionProviderResult {\n constructor(\n /**\n * Free of duplicates.\n */\n completions, hashs, providerResults) {\n this.completions = completions;\n this.hashs = hashs;\n this.providerResults = providerResults;\n }\n has(item) {\n return this.hashs.has(item.hash());\n }\n dispose() {\n for (const result of this.providerResults) {\n result.removeRef();\n }\n }\n}\n/**\n * A ref counted pointer to the computed `InlineCompletions` and the `InlineCompletionsProvider` that\n * computed them.\n */\nexport class InlineCompletionList {\n constructor(inlineCompletions, provider) {\n this.inlineCompletions = inlineCompletions;\n this.provider = provider;\n this.refCount = 1;\n }\n addRef() {\n this.refCount++;\n }\n removeRef() {\n this.refCount--;\n if (this.refCount === 0) {\n this.provider.freeInlineCompletions(this.inlineCompletions);\n }\n }\n}\nexport class InlineCompletionItem {\n static from(inlineCompletion, source, defaultReplaceRange, textModel, languageConfigurationService) {\n let insertText;\n let snippetInfo;\n let range = inlineCompletion.range ? Range.lift(inlineCompletion.range) : defaultReplaceRange;\n if (typeof inlineCompletion.insertText === 'string') {\n insertText = inlineCompletion.insertText;\n if (languageConfigurationService && inlineCompletion.completeBracketPairs) {\n insertText = closeBrackets(insertText, range.getStartPosition(), textModel, languageConfigurationService);\n // Modify range depending on if brackets are added or removed\n const diff = insertText.length - inlineCompletion.insertText.length;\n if (diff !== 0) {\n range = new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn + diff);\n }\n }\n snippetInfo = undefined;\n }\n else if ('snippet' in inlineCompletion.insertText) {\n const preBracketCompletionLength = inlineCompletion.insertText.snippet.length;\n if (languageConfigurationService && inlineCompletion.completeBracketPairs) {\n inlineCompletion.insertText.snippet = closeBrackets(inlineCompletion.insertText.snippet, range.getStartPosition(), textModel, languageConfigurationService);\n // Modify range depending on if brackets are added or removed\n const diff = inlineCompletion.insertText.snippet.length - preBracketCompletionLength;\n if (diff !== 0) {\n range = new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn + diff);\n }\n }\n const snippet = new SnippetParser().parse(inlineCompletion.insertText.snippet);\n if (snippet.children.length === 1 && snippet.children[0] instanceof Text) {\n insertText = snippet.children[0].value;\n snippetInfo = undefined;\n }\n else {\n insertText = snippet.toString();\n snippetInfo = {\n snippet: inlineCompletion.insertText.snippet,\n range: range\n };\n }\n }\n else {\n assertNever(inlineCompletion.insertText);\n }\n return new InlineCompletionItem(insertText, inlineCompletion.command, range, insertText, snippetInfo, inlineCompletion.additionalTextEdits || getReadonlyEmptyArray(), inlineCompletion, source);\n }\n constructor(filterText, command, range, insertText, snippetInfo, additionalTextEdits, \n /**\n * A reference to the original inline completion this inline completion has been constructed from.\n * Used for event data to ensure referential equality.\n */\n sourceInlineCompletion, \n /**\n * A reference to the original inline completion list this inline completion has been constructed from.\n * Used for event data to ensure referential equality.\n */\n source) {\n this.filterText = filterText;\n this.command = command;\n this.range = range;\n this.insertText = insertText;\n this.snippetInfo = snippetInfo;\n this.additionalTextEdits = additionalTextEdits;\n this.sourceInlineCompletion = sourceInlineCompletion;\n this.source = source;\n filterText = filterText.replace(/\\r\\n|\\r/g, '\\n');\n insertText = filterText.replace(/\\r\\n|\\r/g, '\\n');\n }\n withRange(updatedRange) {\n return new InlineCompletionItem(this.filterText, this.command, updatedRange, this.insertText, this.snippetInfo, this.additionalTextEdits, this.sourceInlineCompletion, this.source);\n }\n hash() {\n return JSON.stringify({ insertText: this.insertText, range: this.range.toString() });\n }\n}\nfunction getDefaultRange(position, model) {\n const word = model.getWordAtPosition(position);\n const maxColumn = model.getLineMaxColumn(position.lineNumber);\n // By default, always replace up until the end of the current line.\n // This default might be subject to change!\n return word\n ? new Range(position.lineNumber, word.startColumn, position.lineNumber, maxColumn)\n : Range.fromPositions(position, position.with(undefined, maxColumn));\n}\nfunction closeBrackets(text, position, model, languageConfigurationService) {\n const lineStart = model.getLineContent(position.lineNumber).substring(0, position.column - 1);\n const newLine = lineStart + text;\n const newTokens = model.tokenization.tokenizeLineWithEdit(position, newLine.length - (position.column - 1), text);\n const slicedTokens = newTokens === null || newTokens === void 0 ? void 0 : newTokens.sliceAndInflate(position.column - 1, newLine.length, 0);\n if (!slicedTokens) {\n return text;\n }\n const newText = fixBracketsInLine(slicedTokens, languageConfigurationService);\n return newText;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { LcsDiff } from '../../../../base/common/diff/diff.js';\nimport { commonPrefixLength, getLeadingWhitespace } from '../../../../base/common/strings.js';\nimport { Range } from '../../../common/core/range.js';\nimport { TextLength } from '../../../common/core/textLength.js';\nimport { SingleTextEdit } from '../../../common/core/textEdit.js';\nimport { GhostText, GhostTextPart } from './ghostText.js';\nexport function singleTextRemoveCommonPrefix(edit, model, validModelRange) {\n const modelRange = validModelRange ? edit.range.intersectRanges(validModelRange) : edit.range;\n if (!modelRange) {\n return edit;\n }\n const valueToReplace = model.getValueInRange(modelRange, 1 /* EndOfLinePreference.LF */);\n const commonPrefixLen = commonPrefixLength(valueToReplace, edit.text);\n const start = TextLength.ofText(valueToReplace.substring(0, commonPrefixLen)).addToPosition(edit.range.getStartPosition());\n const text = edit.text.substring(commonPrefixLen);\n const range = Range.fromPositions(start, edit.range.getEndPosition());\n return new SingleTextEdit(range, text);\n}\nexport function singleTextEditAugments(edit, base) {\n // The augmented completion must replace the base range, but can replace even more\n return edit.text.startsWith(base.text) && rangeExtends(edit.range, base.range);\n}\n/**\n * @param previewSuffixLength Sets where to split `inlineCompletion.text`.\n * \tIf the text is `hello` and the suffix length is 2, the non-preview part is `hel` and the preview-part is `lo`.\n*/\nexport function computeGhostText(edit, model, mode, cursorPosition, previewSuffixLength = 0) {\n let e = singleTextRemoveCommonPrefix(edit, model);\n if (e.range.endLineNumber !== e.range.startLineNumber) {\n // This edit might span multiple lines, but the first lines must be a common prefix.\n return undefined;\n }\n const sourceLine = model.getLineContent(e.range.startLineNumber);\n const sourceIndentationLength = getLeadingWhitespace(sourceLine).length;\n const suggestionTouchesIndentation = e.range.startColumn - 1 <= sourceIndentationLength;\n if (suggestionTouchesIndentation) {\n // source: ··········[······abc]\n // ^^^^^^^^^ inlineCompletion.range\n // ^^^^^^^^^^ ^^^^^^ sourceIndentationLength\n // ^^^^^^ replacedIndentation.length\n // ^^^ rangeThatDoesNotReplaceIndentation\n // inlineCompletion.text: '··foo'\n // ^^ suggestionAddedIndentationLength\n const suggestionAddedIndentationLength = getLeadingWhitespace(e.text).length;\n const replacedIndentation = sourceLine.substring(e.range.startColumn - 1, sourceIndentationLength);\n const [startPosition, endPosition] = [e.range.getStartPosition(), e.range.getEndPosition()];\n const newStartPosition = startPosition.column + replacedIndentation.length <= endPosition.column\n ? startPosition.delta(0, replacedIndentation.length)\n : endPosition;\n const rangeThatDoesNotReplaceIndentation = Range.fromPositions(newStartPosition, endPosition);\n const suggestionWithoutIndentationChange = e.text.startsWith(replacedIndentation)\n // Adds more indentation without changing existing indentation: We can add ghost text for this\n ? e.text.substring(replacedIndentation.length)\n // Changes or removes existing indentation. Only add ghost text for the non-indentation part.\n : e.text.substring(suggestionAddedIndentationLength);\n e = new SingleTextEdit(rangeThatDoesNotReplaceIndentation, suggestionWithoutIndentationChange);\n }\n // This is a single line string\n const valueToBeReplaced = model.getValueInRange(e.range);\n const changes = cachingDiff(valueToBeReplaced, e.text);\n if (!changes) {\n // No ghost text in case the diff would be too slow to compute\n return undefined;\n }\n const lineNumber = e.range.startLineNumber;\n const parts = new Array();\n if (mode === 'prefix') {\n const filteredChanges = changes.filter(c => c.originalLength === 0);\n if (filteredChanges.length > 1 || filteredChanges.length === 1 && filteredChanges[0].originalStart !== valueToBeReplaced.length) {\n // Prefixes only have a single change.\n return undefined;\n }\n }\n const previewStartInCompletionText = e.text.length - previewSuffixLength;\n for (const c of changes) {\n const insertColumn = e.range.startColumn + c.originalStart + c.originalLength;\n if (mode === 'subwordSmart' && cursorPosition && cursorPosition.lineNumber === e.range.startLineNumber && insertColumn < cursorPosition.column) {\n // No ghost text before cursor\n return undefined;\n }\n if (c.originalLength > 0) {\n return undefined;\n }\n if (c.modifiedLength === 0) {\n continue;\n }\n const modifiedEnd = c.modifiedStart + c.modifiedLength;\n const nonPreviewTextEnd = Math.max(c.modifiedStart, Math.min(modifiedEnd, previewStartInCompletionText));\n const nonPreviewText = e.text.substring(c.modifiedStart, nonPreviewTextEnd);\n const italicText = e.text.substring(nonPreviewTextEnd, Math.max(c.modifiedStart, modifiedEnd));\n if (nonPreviewText.length > 0) {\n parts.push(new GhostTextPart(insertColumn, nonPreviewText, false));\n }\n if (italicText.length > 0) {\n parts.push(new GhostTextPart(insertColumn, italicText, true));\n }\n }\n return new GhostText(lineNumber, parts);\n}\nfunction rangeExtends(extendingRange, rangeToExtend) {\n return rangeToExtend.getStartPosition().equals(extendingRange.getStartPosition())\n && rangeToExtend.getEndPosition().isBeforeOrEqual(extendingRange.getEndPosition());\n}\nlet lastRequest = undefined;\nfunction cachingDiff(originalValue, newValue) {\n if ((lastRequest === null || lastRequest === void 0 ? void 0 : lastRequest.originalValue) === originalValue && (lastRequest === null || lastRequest === void 0 ? void 0 : lastRequest.newValue) === newValue) {\n return lastRequest === null || lastRequest === void 0 ? void 0 : lastRequest.changes;\n }\n else {\n let changes = smartDiff(originalValue, newValue, true);\n if (changes) {\n const deletedChars = deletedCharacters(changes);\n if (deletedChars > 0) {\n // For performance reasons, don't compute diff if there is nothing to improve\n const newChanges = smartDiff(originalValue, newValue, false);\n if (newChanges && deletedCharacters(newChanges) < deletedChars) {\n // Disabling smartness seems to be better here\n changes = newChanges;\n }\n }\n }\n lastRequest = {\n originalValue,\n newValue,\n changes\n };\n return changes;\n }\n}\nfunction deletedCharacters(changes) {\n let sum = 0;\n for (const c of changes) {\n sum += c.originalLength;\n }\n return sum;\n}\n/**\n * When matching `if ()` with `if (f() = 1) { g(); }`,\n * align it like this: `if ( )`\n * Not like this:\t\t\t `if ( )`\n * Also not like this:\t\t `if ( )`.\n *\n * The parenthesis are preprocessed to ensure that they match correctly.\n */\nfunction smartDiff(originalValue, newValue, smartBracketMatching) {\n if (originalValue.length > 5000 || newValue.length > 5000) {\n // We don't want to work on strings that are too big\n return undefined;\n }\n function getMaxCharCode(val) {\n let maxCharCode = 0;\n for (let i = 0, len = val.length; i < len; i++) {\n const charCode = val.charCodeAt(i);\n if (charCode > maxCharCode) {\n maxCharCode = charCode;\n }\n }\n return maxCharCode;\n }\n const maxCharCode = Math.max(getMaxCharCode(originalValue), getMaxCharCode(newValue));\n function getUniqueCharCode(id) {\n if (id < 0) {\n throw new Error('unexpected');\n }\n return maxCharCode + id + 1;\n }\n function getElements(source) {\n let level = 0;\n let group = 0;\n const characters = new Int32Array(source.length);\n for (let i = 0, len = source.length; i < len; i++) {\n // TODO support more brackets\n if (smartBracketMatching && source[i] === '(') {\n const id = group * 100 + level;\n characters[i] = getUniqueCharCode(2 * id);\n level++;\n }\n else if (smartBracketMatching && source[i] === ')') {\n level = Math.max(level - 1, 0);\n const id = group * 100 + level;\n characters[i] = getUniqueCharCode(2 * id + 1);\n if (level === 0) {\n group++;\n }\n }\n else {\n characters[i] = source.charCodeAt(i);\n }\n }\n return characters;\n }\n const elements1 = getElements(originalValue);\n const elements2 = getElements(newValue);\n return new LcsDiff({ getElements: () => elements1 }, { getElements: () => elements2 }).ComputeDiff(false).changes;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nimport { CancellationTokenSource } from '../../../../base/common/cancellation.js';\nimport { equalsIfDefined, itemEquals } from '../../../../base/common/equals.js';\nimport { matchesSubString } from '../../../../base/common/filters.js';\nimport { Disposable, MutableDisposable } from '../../../../base/common/lifecycle.js';\nimport { derivedOpts, disposableObservableValue, transaction } from '../../../../base/common/observable.js';\nimport { Range } from '../../../common/core/range.js';\nimport { SingleTextEdit } from '../../../common/core/textEdit.js';\nimport { TextLength } from '../../../common/core/textLength.js';\nimport { InlineCompletionTriggerKind } from '../../../common/languages.js';\nimport { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { provideInlineCompletions } from './provideInlineCompletions.js';\nimport { singleTextRemoveCommonPrefix } from './singleTextEdit.js';\nlet InlineCompletionsSource = class InlineCompletionsSource extends Disposable {\n constructor(textModel, versionId, _debounceValue, languageFeaturesService, languageConfigurationService) {\n super();\n this.textModel = textModel;\n this.versionId = versionId;\n this._debounceValue = _debounceValue;\n this.languageFeaturesService = languageFeaturesService;\n this.languageConfigurationService = languageConfigurationService;\n this._updateOperation = this._register(new MutableDisposable());\n this.inlineCompletions = disposableObservableValue('inlineCompletions', undefined);\n this.suggestWidgetInlineCompletions = disposableObservableValue('suggestWidgetInlineCompletions', undefined);\n this._register(this.textModel.onDidChangeContent(() => {\n this._updateOperation.clear();\n }));\n }\n fetch(position, context, activeInlineCompletion) {\n var _a, _b;\n const request = new UpdateRequest(position, context, this.textModel.getVersionId());\n const target = context.selectedSuggestionInfo ? this.suggestWidgetInlineCompletions : this.inlineCompletions;\n if ((_a = this._updateOperation.value) === null || _a === void 0 ? void 0 : _a.request.satisfies(request)) {\n return this._updateOperation.value.promise;\n }\n else if ((_b = target.get()) === null || _b === void 0 ? void 0 : _b.request.satisfies(request)) {\n return Promise.resolve(true);\n }\n const updateOngoing = !!this._updateOperation.value;\n this._updateOperation.clear();\n const source = new CancellationTokenSource();\n const promise = (async () => {\n const shouldDebounce = updateOngoing || context.triggerKind === InlineCompletionTriggerKind.Automatic;\n if (shouldDebounce) {\n // This debounces the operation\n await wait(this._debounceValue.get(this.textModel), source.token);\n }\n if (source.token.isCancellationRequested || this.textModel.getVersionId() !== request.versionId) {\n return false;\n }\n const startTime = new Date();\n const updatedCompletions = await provideInlineCompletions(this.languageFeaturesService.inlineCompletionsProvider, position, this.textModel, context, source.token, this.languageConfigurationService);\n if (source.token.isCancellationRequested || this.textModel.getVersionId() !== request.versionId) {\n return false;\n }\n const endTime = new Date();\n this._debounceValue.update(this.textModel, endTime.getTime() - startTime.getTime());\n const completions = new UpToDateInlineCompletions(updatedCompletions, request, this.textModel, this.versionId);\n if (activeInlineCompletion) {\n const asInlineCompletion = activeInlineCompletion.toInlineCompletion(undefined);\n if (activeInlineCompletion.canBeReused(this.textModel, position) && !updatedCompletions.has(asInlineCompletion)) {\n completions.prepend(activeInlineCompletion.inlineCompletion, asInlineCompletion.range, true);\n }\n }\n this._updateOperation.clear();\n transaction(tx => {\n /** @description Update completions with provider result */\n target.set(completions, tx);\n });\n return true;\n })();\n const updateOperation = new UpdateOperation(request, source, promise);\n this._updateOperation.value = updateOperation;\n return promise;\n }\n clear(tx) {\n this._updateOperation.clear();\n this.inlineCompletions.set(undefined, tx);\n this.suggestWidgetInlineCompletions.set(undefined, tx);\n }\n clearSuggestWidgetInlineCompletions(tx) {\n var _a;\n if ((_a = this._updateOperation.value) === null || _a === void 0 ? void 0 : _a.request.context.selectedSuggestionInfo) {\n this._updateOperation.clear();\n }\n this.suggestWidgetInlineCompletions.set(undefined, tx);\n }\n cancelUpdate() {\n this._updateOperation.clear();\n }\n};\nInlineCompletionsSource = __decorate([\n __param(3, ILanguageFeaturesService),\n __param(4, ILanguageConfigurationService)\n], InlineCompletionsSource);\nexport { InlineCompletionsSource };\nfunction wait(ms, cancellationToken) {\n return new Promise(resolve => {\n let d = undefined;\n const handle = setTimeout(() => {\n if (d) {\n d.dispose();\n }\n resolve();\n }, ms);\n if (cancellationToken) {\n d = cancellationToken.onCancellationRequested(() => {\n clearTimeout(handle);\n if (d) {\n d.dispose();\n }\n resolve();\n });\n }\n });\n}\nclass UpdateRequest {\n constructor(position, context, versionId) {\n this.position = position;\n this.context = context;\n this.versionId = versionId;\n }\n satisfies(other) {\n return this.position.equals(other.position)\n && equalsIfDefined(this.context.selectedSuggestionInfo, other.context.selectedSuggestionInfo, itemEquals())\n && (other.context.triggerKind === InlineCompletionTriggerKind.Automatic\n || this.context.triggerKind === InlineCompletionTriggerKind.Explicit)\n && this.versionId === other.versionId;\n }\n}\nclass UpdateOperation {\n constructor(request, cancellationTokenSource, promise) {\n this.request = request;\n this.cancellationTokenSource = cancellationTokenSource;\n this.promise = promise;\n }\n dispose() {\n this.cancellationTokenSource.cancel();\n }\n}\nexport class UpToDateInlineCompletions {\n get inlineCompletions() { return this._inlineCompletions; }\n constructor(inlineCompletionProviderResult, request, _textModel, _versionId) {\n this.inlineCompletionProviderResult = inlineCompletionProviderResult;\n this.request = request;\n this._textModel = _textModel;\n this._versionId = _versionId;\n this._refCount = 1;\n this._prependedInlineCompletionItems = [];\n const ids = _textModel.deltaDecorations([], inlineCompletionProviderResult.completions.map(i => ({\n range: i.range,\n options: {\n description: 'inline-completion-tracking-range'\n },\n })));\n this._inlineCompletions = inlineCompletionProviderResult.completions.map((i, index) => new InlineCompletionWithUpdatedRange(i, ids[index], this._textModel, this._versionId));\n }\n clone() {\n this._refCount++;\n return this;\n }\n dispose() {\n this._refCount--;\n if (this._refCount === 0) {\n setTimeout(() => {\n // To fix https://github.com/microsoft/vscode/issues/188348\n if (!this._textModel.isDisposed()) {\n // This is just cleanup. It's ok if it happens with a delay.\n this._textModel.deltaDecorations(this._inlineCompletions.map(i => i.decorationId), []);\n }\n }, 0);\n this.inlineCompletionProviderResult.dispose();\n for (const i of this._prependedInlineCompletionItems) {\n i.source.removeRef();\n }\n }\n }\n prepend(inlineCompletion, range, addRefToSource) {\n if (addRefToSource) {\n inlineCompletion.source.addRef();\n }\n const id = this._textModel.deltaDecorations([], [{\n range,\n options: {\n description: 'inline-completion-tracking-range'\n },\n }])[0];\n this._inlineCompletions.unshift(new InlineCompletionWithUpdatedRange(inlineCompletion, id, this._textModel, this._versionId));\n this._prependedInlineCompletionItems.push(inlineCompletion);\n }\n}\nexport class InlineCompletionWithUpdatedRange {\n get forwardStable() {\n var _a;\n return (_a = this.inlineCompletion.source.inlineCompletions.enableForwardStability) !== null && _a !== void 0 ? _a : false;\n }\n constructor(inlineCompletion, decorationId, _textModel, _modelVersion) {\n this.inlineCompletion = inlineCompletion;\n this.decorationId = decorationId;\n this._textModel = _textModel;\n this._modelVersion = _modelVersion;\n this.semanticId = JSON.stringify([\n this.inlineCompletion.filterText,\n this.inlineCompletion.insertText,\n this.inlineCompletion.range.getStartPosition().toString()\n ]);\n this._updatedRange = derivedOpts({ owner: this, equalsFn: Range.equalsRange }, reader => {\n this._modelVersion.read(reader);\n return this._textModel.getDecorationRange(this.decorationId);\n });\n }\n toInlineCompletion(reader) {\n var _a;\n return this.inlineCompletion.withRange((_a = this._updatedRange.read(reader)) !== null && _a !== void 0 ? _a : emptyRange);\n }\n toSingleTextEdit(reader) {\n var _a;\n return new SingleTextEdit((_a = this._updatedRange.read(reader)) !== null && _a !== void 0 ? _a : emptyRange, this.inlineCompletion.insertText);\n }\n isVisible(model, cursorPosition, reader) {\n const minimizedReplacement = singleTextRemoveCommonPrefix(this._toFilterTextReplacement(reader), model);\n const updatedRange = this._updatedRange.read(reader);\n if (!updatedRange\n || !this.inlineCompletion.range.getStartPosition().equals(updatedRange.getStartPosition())\n || cursorPosition.lineNumber !== minimizedReplacement.range.startLineNumber) {\n return false;\n }\n // We might consider comparing by .toLowerText, but this requires GhostTextReplacement\n const originalValue = model.getValueInRange(minimizedReplacement.range, 1 /* EndOfLinePreference.LF */);\n const filterText = minimizedReplacement.text;\n const cursorPosIndex = Math.max(0, cursorPosition.column - minimizedReplacement.range.startColumn);\n let filterTextBefore = filterText.substring(0, cursorPosIndex);\n let filterTextAfter = filterText.substring(cursorPosIndex);\n let originalValueBefore = originalValue.substring(0, cursorPosIndex);\n let originalValueAfter = originalValue.substring(cursorPosIndex);\n const originalValueIndent = model.getLineIndentColumn(minimizedReplacement.range.startLineNumber);\n if (minimizedReplacement.range.startColumn <= originalValueIndent) {\n // Remove indentation\n originalValueBefore = originalValueBefore.trimStart();\n if (originalValueBefore.length === 0) {\n originalValueAfter = originalValueAfter.trimStart();\n }\n filterTextBefore = filterTextBefore.trimStart();\n if (filterTextBefore.length === 0) {\n filterTextAfter = filterTextAfter.trimStart();\n }\n }\n return filterTextBefore.startsWith(originalValueBefore)\n && !!matchesSubString(originalValueAfter, filterTextAfter);\n }\n canBeReused(model, position) {\n const updatedRange = this._updatedRange.read(undefined);\n const result = !!updatedRange\n && updatedRange.containsPosition(position)\n && this.isVisible(model, position, undefined)\n && TextLength.ofRange(updatedRange).isGreaterThanOrEqualTo(TextLength.ofRange(this.inlineCompletion.range));\n return result;\n }\n _toFilterTextReplacement(reader) {\n var _a;\n return new SingleTextEdit((_a = this._updatedRange.read(reader)) !== null && _a !== void 0 ? _a : emptyRange, this.inlineCompletion.filterText);\n }\n}\nconst emptyRange = new Range(1, 1, 1, 1);\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nimport { Permutation } from '../../../../base/common/arrays.js';\nimport { mapFindFirst } from '../../../../base/common/arraysFind.js';\nimport { itemsEquals } from '../../../../base/common/equals.js';\nimport { BugIndicatingError, onUnexpectedError, onUnexpectedExternalError } from '../../../../base/common/errors.js';\nimport { Disposable } from '../../../../base/common/lifecycle.js';\nimport { autorun, derived, derivedHandleChanges, derivedOpts, observableSignal, observableValue, recomputeInitiallyAndOnChange, subtransaction, transaction } from '../../../../base/common/observable.js';\nimport { commonPrefixLength, splitLinesIncludeSeparators } from '../../../../base/common/strings.js';\nimport { isDefined } from '../../../../base/common/types.js';\nimport { EditOperation } from '../../../common/core/editOperation.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { Selection } from '../../../common/core/selection.js';\nimport { SingleTextEdit, TextEdit } from '../../../common/core/textEdit.js';\nimport { TextLength } from '../../../common/core/textLength.js';\nimport { InlineCompletionTriggerKind } from '../../../common/languages.js';\nimport { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js';\nimport { GhostText, ghostTextOrReplacementEquals, ghostTextsOrReplacementsEqual } from './ghostText.js';\nimport { InlineCompletionsSource } from './inlineCompletionsSource.js';\nimport { computeGhostText, singleTextEditAugments, singleTextRemoveCommonPrefix } from './singleTextEdit.js';\nimport { addPositions, subtractPositions } from './utils.js';\nimport { SnippetController2 } from '../../snippet/browser/snippetController2.js';\nimport { ICommandService } from '../../../../platform/commands/common/commands.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nexport var VersionIdChangeReason;\n(function (VersionIdChangeReason) {\n VersionIdChangeReason[VersionIdChangeReason[\"Undo\"] = 0] = \"Undo\";\n VersionIdChangeReason[VersionIdChangeReason[\"Redo\"] = 1] = \"Redo\";\n VersionIdChangeReason[VersionIdChangeReason[\"AcceptWord\"] = 2] = \"AcceptWord\";\n VersionIdChangeReason[VersionIdChangeReason[\"Other\"] = 3] = \"Other\";\n})(VersionIdChangeReason || (VersionIdChangeReason = {}));\nlet InlineCompletionsModel = class InlineCompletionsModel extends Disposable {\n get isAcceptingPartially() { return this._isAcceptingPartially; }\n constructor(textModel, selectedSuggestItem, textModelVersionId, _positions, _debounceValue, _suggestPreviewEnabled, _suggestPreviewMode, _inlineSuggestMode, _enabled, _instantiationService, _commandService, _languageConfigurationService) {\n super();\n this.textModel = textModel;\n this.selectedSuggestItem = selectedSuggestItem;\n this.textModelVersionId = textModelVersionId;\n this._positions = _positions;\n this._debounceValue = _debounceValue;\n this._suggestPreviewEnabled = _suggestPreviewEnabled;\n this._suggestPreviewMode = _suggestPreviewMode;\n this._inlineSuggestMode = _inlineSuggestMode;\n this._enabled = _enabled;\n this._instantiationService = _instantiationService;\n this._commandService = _commandService;\n this._languageConfigurationService = _languageConfigurationService;\n this._source = this._register(this._instantiationService.createInstance(InlineCompletionsSource, this.textModel, this.textModelVersionId, this._debounceValue));\n this._isActive = observableValue(this, false);\n this._forceUpdateExplicitlySignal = observableSignal(this);\n // We use a semantic id to keep the same inline completion selected even if the provider reorders the completions.\n this._selectedInlineCompletionId = observableValue(this, undefined);\n this._primaryPosition = derived(this, reader => { var _a; return (_a = this._positions.read(reader)[0]) !== null && _a !== void 0 ? _a : new Position(1, 1); });\n this._isAcceptingPartially = false;\n this._preserveCurrentCompletionReasons = new Set([\n VersionIdChangeReason.Redo,\n VersionIdChangeReason.Undo,\n VersionIdChangeReason.AcceptWord,\n ]);\n this._fetchInlineCompletionsPromise = derivedHandleChanges({\n owner: this,\n createEmptyChangeSummary: () => ({\n preserveCurrentCompletion: false,\n inlineCompletionTriggerKind: InlineCompletionTriggerKind.Automatic\n }),\n handleChange: (ctx, changeSummary) => {\n /** @description fetch inline completions */\n if (ctx.didChange(this.textModelVersionId) && this._preserveCurrentCompletionReasons.has(ctx.change)) {\n changeSummary.preserveCurrentCompletion = true;\n }\n else if (ctx.didChange(this._forceUpdateExplicitlySignal)) {\n changeSummary.inlineCompletionTriggerKind = InlineCompletionTriggerKind.Explicit;\n }\n return true;\n },\n }, (reader, changeSummary) => {\n this._forceUpdateExplicitlySignal.read(reader);\n const shouldUpdate = (this._enabled.read(reader) && this.selectedSuggestItem.read(reader)) || this._isActive.read(reader);\n if (!shouldUpdate) {\n this._source.cancelUpdate();\n return undefined;\n }\n this.textModelVersionId.read(reader); // Refetch on text change\n const suggestWidgetInlineCompletions = this._source.suggestWidgetInlineCompletions.get();\n const suggestItem = this.selectedSuggestItem.read(reader);\n if (suggestWidgetInlineCompletions && !suggestItem) {\n const inlineCompletions = this._source.inlineCompletions.get();\n transaction(tx => {\n /** @description Seed inline completions with (newer) suggest widget inline completions */\n if (!inlineCompletions || suggestWidgetInlineCompletions.request.versionId > inlineCompletions.request.versionId) {\n this._source.inlineCompletions.set(suggestWidgetInlineCompletions.clone(), tx);\n }\n this._source.clearSuggestWidgetInlineCompletions(tx);\n });\n }\n const cursorPosition = this._primaryPosition.read(reader);\n const context = {\n triggerKind: changeSummary.inlineCompletionTriggerKind,\n selectedSuggestionInfo: suggestItem === null || suggestItem === void 0 ? void 0 : suggestItem.toSelectedSuggestionInfo(),\n };\n const itemToPreserveCandidate = this.selectedInlineCompletion.get();\n const itemToPreserve = changeSummary.preserveCurrentCompletion || (itemToPreserveCandidate === null || itemToPreserveCandidate === void 0 ? void 0 : itemToPreserveCandidate.forwardStable)\n ? itemToPreserveCandidate : undefined;\n return this._source.fetch(cursorPosition, context, itemToPreserve);\n });\n this._filteredInlineCompletionItems = derivedOpts({ owner: this, equalsFn: itemsEquals() }, reader => {\n const c = this._source.inlineCompletions.read(reader);\n if (!c) {\n return [];\n }\n const cursorPosition = this._primaryPosition.read(reader);\n const filteredCompletions = c.inlineCompletions.filter(c => c.isVisible(this.textModel, cursorPosition, reader));\n return filteredCompletions;\n });\n this.selectedInlineCompletionIndex = derived(this, (reader) => {\n const selectedInlineCompletionId = this._selectedInlineCompletionId.read(reader);\n const filteredCompletions = this._filteredInlineCompletionItems.read(reader);\n const idx = this._selectedInlineCompletionId === undefined ? -1\n : filteredCompletions.findIndex(v => v.semanticId === selectedInlineCompletionId);\n if (idx === -1) {\n // Reset the selection so that the selection does not jump back when it appears again\n this._selectedInlineCompletionId.set(undefined, undefined);\n return 0;\n }\n return idx;\n });\n this.selectedInlineCompletion = derived(this, (reader) => {\n const filteredCompletions = this._filteredInlineCompletionItems.read(reader);\n const idx = this.selectedInlineCompletionIndex.read(reader);\n return filteredCompletions[idx];\n });\n this.activeCommands = derivedOpts({ owner: this, equalsFn: itemsEquals() }, r => { var _a, _b; return (_b = (_a = this.selectedInlineCompletion.read(r)) === null || _a === void 0 ? void 0 : _a.inlineCompletion.source.inlineCompletions.commands) !== null && _b !== void 0 ? _b : []; });\n this.lastTriggerKind = this._source.inlineCompletions.map(this, v => v === null || v === void 0 ? void 0 : v.request.context.triggerKind);\n this.inlineCompletionsCount = derived(this, reader => {\n if (this.lastTriggerKind.read(reader) === InlineCompletionTriggerKind.Explicit) {\n return this._filteredInlineCompletionItems.read(reader).length;\n }\n else {\n return undefined;\n }\n });\n this.state = derivedOpts({\n owner: this,\n equalsFn: (a, b) => {\n if (!a || !b) {\n return a === b;\n }\n return ghostTextsOrReplacementsEqual(a.ghostTexts, b.ghostTexts)\n && a.inlineCompletion === b.inlineCompletion\n && a.suggestItem === b.suggestItem;\n }\n }, (reader) => {\n var _a, _b;\n const model = this.textModel;\n const suggestItem = this.selectedSuggestItem.read(reader);\n if (suggestItem) {\n const suggestCompletionEdit = singleTextRemoveCommonPrefix(suggestItem.toSingleTextEdit(), model);\n const augmentation = this._computeAugmentation(suggestCompletionEdit, reader);\n const isSuggestionPreviewEnabled = this._suggestPreviewEnabled.read(reader);\n if (!isSuggestionPreviewEnabled && !augmentation) {\n return undefined;\n }\n const fullEdit = (_a = augmentation === null || augmentation === void 0 ? void 0 : augmentation.edit) !== null && _a !== void 0 ? _a : suggestCompletionEdit;\n const fullEditPreviewLength = augmentation ? augmentation.edit.text.length - suggestCompletionEdit.text.length : 0;\n const mode = this._suggestPreviewMode.read(reader);\n const positions = this._positions.read(reader);\n const edits = [fullEdit, ...getSecondaryEdits(this.textModel, positions, fullEdit)];\n const ghostTexts = edits\n .map((edit, idx) => computeGhostText(edit, model, mode, positions[idx], fullEditPreviewLength))\n .filter(isDefined);\n const primaryGhostText = (_b = ghostTexts[0]) !== null && _b !== void 0 ? _b : new GhostText(fullEdit.range.endLineNumber, []);\n return { edits, primaryGhostText, ghostTexts, inlineCompletion: augmentation === null || augmentation === void 0 ? void 0 : augmentation.completion, suggestItem };\n }\n else {\n if (!this._isActive.read(reader)) {\n return undefined;\n }\n const inlineCompletion = this.selectedInlineCompletion.read(reader);\n if (!inlineCompletion) {\n return undefined;\n }\n const replacement = inlineCompletion.toSingleTextEdit(reader);\n const mode = this._inlineSuggestMode.read(reader);\n const positions = this._positions.read(reader);\n const edits = [replacement, ...getSecondaryEdits(this.textModel, positions, replacement)];\n const ghostTexts = edits\n .map((edit, idx) => computeGhostText(edit, model, mode, positions[idx], 0))\n .filter(isDefined);\n if (!ghostTexts[0]) {\n return undefined;\n }\n return { edits, primaryGhostText: ghostTexts[0], ghostTexts, inlineCompletion, suggestItem: undefined };\n }\n });\n this.ghostTexts = derivedOpts({\n owner: this,\n equalsFn: ghostTextsOrReplacementsEqual\n }, reader => {\n const v = this.state.read(reader);\n if (!v) {\n return undefined;\n }\n return v.ghostTexts;\n });\n this.primaryGhostText = derivedOpts({\n owner: this,\n equalsFn: ghostTextOrReplacementEquals\n }, reader => {\n const v = this.state.read(reader);\n if (!v) {\n return undefined;\n }\n return v === null || v === void 0 ? void 0 : v.primaryGhostText;\n });\n this._register(recomputeInitiallyAndOnChange(this._fetchInlineCompletionsPromise));\n let lastItem = undefined;\n this._register(autorun(reader => {\n var _a, _b;\n /** @description call handleItemDidShow */\n const item = this.state.read(reader);\n const completion = item === null || item === void 0 ? void 0 : item.inlineCompletion;\n if ((completion === null || completion === void 0 ? void 0 : completion.semanticId) !== (lastItem === null || lastItem === void 0 ? void 0 : lastItem.semanticId)) {\n lastItem = completion;\n if (completion) {\n const i = completion.inlineCompletion;\n const src = i.source;\n (_b = (_a = src.provider).handleItemDidShow) === null || _b === void 0 ? void 0 : _b.call(_a, src.inlineCompletions, i.sourceInlineCompletion, i.insertText);\n }\n }\n }));\n }\n async trigger(tx) {\n this._isActive.set(true, tx);\n await this._fetchInlineCompletionsPromise.get();\n }\n async triggerExplicitly(tx) {\n subtransaction(tx, tx => {\n this._isActive.set(true, tx);\n this._forceUpdateExplicitlySignal.trigger(tx);\n });\n await this._fetchInlineCompletionsPromise.get();\n }\n stop(tx) {\n subtransaction(tx, tx => {\n this._isActive.set(false, tx);\n this._source.clear(tx);\n });\n }\n _computeAugmentation(suggestCompletion, reader) {\n const model = this.textModel;\n const suggestWidgetInlineCompletions = this._source.suggestWidgetInlineCompletions.read(reader);\n const candidateInlineCompletions = suggestWidgetInlineCompletions\n ? suggestWidgetInlineCompletions.inlineCompletions\n : [this.selectedInlineCompletion.read(reader)].filter(isDefined);\n const augmentedCompletion = mapFindFirst(candidateInlineCompletions, completion => {\n let r = completion.toSingleTextEdit(reader);\n r = singleTextRemoveCommonPrefix(r, model, Range.fromPositions(r.range.getStartPosition(), suggestCompletion.range.getEndPosition()));\n return singleTextEditAugments(r, suggestCompletion) ? { completion, edit: r } : undefined;\n });\n return augmentedCompletion;\n }\n async _deltaSelectedInlineCompletionIndex(delta) {\n await this.triggerExplicitly();\n const completions = this._filteredInlineCompletionItems.get() || [];\n if (completions.length > 0) {\n const newIdx = (this.selectedInlineCompletionIndex.get() + delta + completions.length) % completions.length;\n this._selectedInlineCompletionId.set(completions[newIdx].semanticId, undefined);\n }\n else {\n this._selectedInlineCompletionId.set(undefined, undefined);\n }\n }\n async next() {\n await this._deltaSelectedInlineCompletionIndex(1);\n }\n async previous() {\n await this._deltaSelectedInlineCompletionIndex(-1);\n }\n async accept(editor) {\n var _a;\n if (editor.getModel() !== this.textModel) {\n throw new BugIndicatingError();\n }\n const state = this.state.get();\n if (!state || state.primaryGhostText.isEmpty() || !state.inlineCompletion) {\n return;\n }\n const completion = state.inlineCompletion.toInlineCompletion(undefined);\n editor.pushUndoStop();\n if (completion.snippetInfo) {\n editor.executeEdits('inlineSuggestion.accept', [\n EditOperation.replace(completion.range, ''),\n ...completion.additionalTextEdits\n ]);\n editor.setPosition(completion.snippetInfo.range.getStartPosition(), 'inlineCompletionAccept');\n (_a = SnippetController2.get(editor)) === null || _a === void 0 ? void 0 : _a.insert(completion.snippetInfo.snippet, { undoStopBefore: false });\n }\n else {\n const edits = state.edits;\n const selections = getEndPositionsAfterApplying(edits).map(p => Selection.fromPositions(p));\n editor.executeEdits('inlineSuggestion.accept', [\n ...edits.map(edit => EditOperation.replace(edit.range, edit.text)),\n ...completion.additionalTextEdits\n ]);\n editor.setSelections(selections, 'inlineCompletionAccept');\n }\n if (completion.command) {\n // Make sure the completion list will not be disposed.\n completion.source.addRef();\n }\n // Reset before invoking the command, since the command might cause a follow up trigger.\n transaction(tx => {\n this._source.clear(tx);\n // Potentially, isActive will get set back to true by the typing or accept inline suggest event\n // if automatic inline suggestions are enabled.\n this._isActive.set(false, tx);\n });\n if (completion.command) {\n await this._commandService\n .executeCommand(completion.command.id, ...(completion.command.arguments || []))\n .then(undefined, onUnexpectedExternalError);\n completion.source.removeRef();\n }\n }\n async acceptNextWord(editor) {\n await this._acceptNext(editor, (pos, text) => {\n const langId = this.textModel.getLanguageIdAtPosition(pos.lineNumber, pos.column);\n const config = this._languageConfigurationService.getLanguageConfiguration(langId);\n const wordRegExp = new RegExp(config.wordDefinition.source, config.wordDefinition.flags.replace('g', ''));\n const m1 = text.match(wordRegExp);\n let acceptUntilIndexExclusive = 0;\n if (m1 && m1.index !== undefined) {\n if (m1.index === 0) {\n acceptUntilIndexExclusive = m1[0].length;\n }\n else {\n acceptUntilIndexExclusive = m1.index;\n }\n }\n else {\n acceptUntilIndexExclusive = text.length;\n }\n const wsRegExp = /\\s+/g;\n const m2 = wsRegExp.exec(text);\n if (m2 && m2.index !== undefined) {\n if (m2.index + m2[0].length < acceptUntilIndexExclusive) {\n acceptUntilIndexExclusive = m2.index + m2[0].length;\n }\n }\n return acceptUntilIndexExclusive;\n }, 0 /* PartialAcceptTriggerKind.Word */);\n }\n async acceptNextLine(editor) {\n await this._acceptNext(editor, (pos, text) => {\n const m = text.match(/\\n/);\n if (m && m.index !== undefined) {\n return m.index + 1;\n }\n return text.length;\n }, 1 /* PartialAcceptTriggerKind.Line */);\n }\n async _acceptNext(editor, getAcceptUntilIndex, kind) {\n if (editor.getModel() !== this.textModel) {\n throw new BugIndicatingError();\n }\n const state = this.state.get();\n if (!state || state.primaryGhostText.isEmpty() || !state.inlineCompletion) {\n return;\n }\n const ghostText = state.primaryGhostText;\n const completion = state.inlineCompletion.toInlineCompletion(undefined);\n if (completion.snippetInfo || completion.filterText !== completion.insertText) {\n // not in WYSIWYG mode, partial commit might change completion, thus it is not supported\n await this.accept(editor);\n return;\n }\n const firstPart = ghostText.parts[0];\n const ghostTextPos = new Position(ghostText.lineNumber, firstPart.column);\n const ghostTextVal = firstPart.text;\n const acceptUntilIndexExclusive = getAcceptUntilIndex(ghostTextPos, ghostTextVal);\n if (acceptUntilIndexExclusive === ghostTextVal.length && ghostText.parts.length === 1) {\n this.accept(editor);\n return;\n }\n const partialGhostTextVal = ghostTextVal.substring(0, acceptUntilIndexExclusive);\n const positions = this._positions.get();\n const cursorPosition = positions[0];\n // Executing the edit might free the completion, so we have to hold a reference on it.\n completion.source.addRef();\n try {\n this._isAcceptingPartially = true;\n try {\n editor.pushUndoStop();\n const replaceRange = Range.fromPositions(cursorPosition, ghostTextPos);\n const newText = editor.getModel().getValueInRange(replaceRange) + partialGhostTextVal;\n const primaryEdit = new SingleTextEdit(replaceRange, newText);\n const edits = [primaryEdit, ...getSecondaryEdits(this.textModel, positions, primaryEdit)];\n const selections = getEndPositionsAfterApplying(edits).map(p => Selection.fromPositions(p));\n editor.executeEdits('inlineSuggestion.accept', edits.map(edit => EditOperation.replace(edit.range, edit.text)));\n editor.setSelections(selections, 'inlineCompletionPartialAccept');\n editor.revealPositionInCenterIfOutsideViewport(editor.getPosition(), 1 /* ScrollType.Immediate */);\n }\n finally {\n this._isAcceptingPartially = false;\n }\n if (completion.source.provider.handlePartialAccept) {\n const acceptedRange = Range.fromPositions(completion.range.getStartPosition(), TextLength.ofText(partialGhostTextVal).addToPosition(ghostTextPos));\n // This assumes that the inline completion and the model use the same EOL style.\n const text = editor.getModel().getValueInRange(acceptedRange, 1 /* EndOfLinePreference.LF */);\n completion.source.provider.handlePartialAccept(completion.source.inlineCompletions, completion.sourceInlineCompletion, text.length, {\n kind,\n });\n }\n }\n finally {\n completion.source.removeRef();\n }\n }\n handleSuggestAccepted(item) {\n var _a, _b;\n const itemEdit = singleTextRemoveCommonPrefix(item.toSingleTextEdit(), this.textModel);\n const augmentedCompletion = this._computeAugmentation(itemEdit, undefined);\n if (!augmentedCompletion) {\n return;\n }\n const inlineCompletion = augmentedCompletion.completion.inlineCompletion;\n (_b = (_a = inlineCompletion.source.provider).handlePartialAccept) === null || _b === void 0 ? void 0 : _b.call(_a, inlineCompletion.source.inlineCompletions, inlineCompletion.sourceInlineCompletion, itemEdit.text.length, {\n kind: 2 /* PartialAcceptTriggerKind.Suggest */,\n });\n }\n};\nInlineCompletionsModel = __decorate([\n __param(9, IInstantiationService),\n __param(10, ICommandService),\n __param(11, ILanguageConfigurationService)\n], InlineCompletionsModel);\nexport { InlineCompletionsModel };\nexport function getSecondaryEdits(textModel, positions, primaryEdit) {\n if (positions.length === 1) {\n // No secondary cursor positions\n return [];\n }\n const primaryPosition = positions[0];\n const secondaryPositions = positions.slice(1);\n const primaryEditStartPosition = primaryEdit.range.getStartPosition();\n const primaryEditEndPosition = primaryEdit.range.getEndPosition();\n const replacedTextAfterPrimaryCursor = textModel.getValueInRange(Range.fromPositions(primaryPosition, primaryEditEndPosition));\n const positionWithinTextEdit = subtractPositions(primaryPosition, primaryEditStartPosition);\n if (positionWithinTextEdit.lineNumber < 1) {\n onUnexpectedError(new BugIndicatingError(`positionWithinTextEdit line number should be bigger than 0.\n\t\t\tInvalid subtraction between ${primaryPosition.toString()} and ${primaryEditStartPosition.toString()}`));\n return [];\n }\n const secondaryEditText = substringPos(primaryEdit.text, positionWithinTextEdit);\n return secondaryPositions.map(pos => {\n const posEnd = addPositions(subtractPositions(pos, primaryEditStartPosition), primaryEditEndPosition);\n const textAfterSecondaryCursor = textModel.getValueInRange(Range.fromPositions(pos, posEnd));\n const l = commonPrefixLength(replacedTextAfterPrimaryCursor, textAfterSecondaryCursor);\n const range = Range.fromPositions(pos, pos.delta(0, l));\n return new SingleTextEdit(range, secondaryEditText);\n });\n}\nfunction substringPos(text, pos) {\n let subtext = '';\n const lines = splitLinesIncludeSeparators(text);\n for (let i = pos.lineNumber - 1; i < lines.length; i++) {\n subtext += lines[i].substring(i === pos.lineNumber - 1 ? pos.column - 1 : 0);\n }\n return subtext;\n}\nfunction getEndPositionsAfterApplying(edits) {\n const sortPerm = Permutation.createSortPermutation(edits, (edit1, edit2) => Range.compareRangesUsingStarts(edit1.range, edit2.range));\n const edit = new TextEdit(sortPerm.apply(edits));\n const sortedNewRanges = edit.getNewRanges();\n const newRanges = sortPerm.inverse().apply(sortedNewRanges);\n return newRanges.map(range => range.getEndPosition());\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Event } from '../../../../base/common/event.js';\nimport { Disposable } from '../../../../base/common/lifecycle.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { SelectedSuggestionInfo } from '../../../common/languages.js';\nimport { SnippetParser } from '../../snippet/browser/snippetParser.js';\nimport { SnippetSession } from '../../snippet/browser/snippetSession.js';\nimport { SuggestController } from '../../suggest/browser/suggestController.js';\nimport { observableValue, transaction } from '../../../../base/common/observable.js';\nimport { SingleTextEdit } from '../../../common/core/textEdit.js';\nimport { compareBy, numberComparator } from '../../../../base/common/arrays.js';\nimport { findFirstMax } from '../../../../base/common/arraysFind.js';\nimport { singleTextEditAugments, singleTextRemoveCommonPrefix } from './singleTextEdit.js';\nexport class SuggestWidgetAdaptor extends Disposable {\n get selectedItem() {\n return this._selectedItem;\n }\n constructor(editor, suggestControllerPreselector, checkModelVersion, onWillAccept) {\n super();\n this.editor = editor;\n this.suggestControllerPreselector = suggestControllerPreselector;\n this.checkModelVersion = checkModelVersion;\n this.onWillAccept = onWillAccept;\n this.isSuggestWidgetVisible = false;\n this.isShiftKeyPressed = false;\n this._isActive = false;\n this._currentSuggestItemInfo = undefined;\n this._selectedItem = observableValue(this, undefined);\n // See the command acceptAlternativeSelectedSuggestion that is bound to shift+tab\n this._register(editor.onKeyDown(e => {\n if (e.shiftKey && !this.isShiftKeyPressed) {\n this.isShiftKeyPressed = true;\n this.update(this._isActive);\n }\n }));\n this._register(editor.onKeyUp(e => {\n if (e.shiftKey && this.isShiftKeyPressed) {\n this.isShiftKeyPressed = false;\n this.update(this._isActive);\n }\n }));\n const suggestController = SuggestController.get(this.editor);\n if (suggestController) {\n this._register(suggestController.registerSelector({\n priority: 100,\n select: (model, pos, suggestItems) => {\n transaction(tx => this.checkModelVersion(tx));\n const textModel = this.editor.getModel();\n if (!textModel) {\n // Should not happen\n return -1;\n }\n const i = this.suggestControllerPreselector();\n const itemToPreselect = i ? singleTextRemoveCommonPrefix(i, textModel) : undefined;\n if (!itemToPreselect) {\n return -1;\n }\n const position = Position.lift(pos);\n const candidates = suggestItems\n .map((suggestItem, index) => {\n const suggestItemInfo = SuggestItemInfo.fromSuggestion(suggestController, textModel, position, suggestItem, this.isShiftKeyPressed);\n const suggestItemTextEdit = singleTextRemoveCommonPrefix(suggestItemInfo.toSingleTextEdit(), textModel);\n const valid = singleTextEditAugments(itemToPreselect, suggestItemTextEdit);\n return { index, valid, prefixLength: suggestItemTextEdit.text.length, suggestItem };\n })\n .filter(item => item && item.valid && item.prefixLength > 0);\n const result = findFirstMax(candidates, compareBy(s => s.prefixLength, numberComparator));\n return result ? result.index : -1;\n }\n }));\n let isBoundToSuggestWidget = false;\n const bindToSuggestWidget = () => {\n if (isBoundToSuggestWidget) {\n return;\n }\n isBoundToSuggestWidget = true;\n this._register(suggestController.widget.value.onDidShow(() => {\n this.isSuggestWidgetVisible = true;\n this.update(true);\n }));\n this._register(suggestController.widget.value.onDidHide(() => {\n this.isSuggestWidgetVisible = false;\n this.update(false);\n }));\n this._register(suggestController.widget.value.onDidFocus(() => {\n this.isSuggestWidgetVisible = true;\n this.update(true);\n }));\n };\n this._register(Event.once(suggestController.model.onDidTrigger)(e => {\n bindToSuggestWidget();\n }));\n this._register(suggestController.onWillInsertSuggestItem(e => {\n const position = this.editor.getPosition();\n const model = this.editor.getModel();\n if (!position || !model) {\n return undefined;\n }\n const suggestItemInfo = SuggestItemInfo.fromSuggestion(suggestController, model, position, e.item, this.isShiftKeyPressed);\n this.onWillAccept(suggestItemInfo);\n }));\n }\n this.update(this._isActive);\n }\n update(newActive) {\n const newInlineCompletion = this.getSuggestItemInfo();\n if (this._isActive !== newActive || !suggestItemInfoEquals(this._currentSuggestItemInfo, newInlineCompletion)) {\n this._isActive = newActive;\n this._currentSuggestItemInfo = newInlineCompletion;\n transaction(tx => {\n /** @description Update state from suggest widget */\n this.checkModelVersion(tx);\n this._selectedItem.set(this._isActive ? this._currentSuggestItemInfo : undefined, tx);\n });\n }\n }\n getSuggestItemInfo() {\n const suggestController = SuggestController.get(this.editor);\n if (!suggestController || !this.isSuggestWidgetVisible) {\n return undefined;\n }\n const focusedItem = suggestController.widget.value.getFocusedItem();\n const position = this.editor.getPosition();\n const model = this.editor.getModel();\n if (!focusedItem || !position || !model) {\n return undefined;\n }\n return SuggestItemInfo.fromSuggestion(suggestController, model, position, focusedItem.item, this.isShiftKeyPressed);\n }\n stopForceRenderingAbove() {\n const suggestController = SuggestController.get(this.editor);\n suggestController === null || suggestController === void 0 ? void 0 : suggestController.stopForceRenderingAbove();\n }\n forceRenderingAbove() {\n const suggestController = SuggestController.get(this.editor);\n suggestController === null || suggestController === void 0 ? void 0 : suggestController.forceRenderingAbove();\n }\n}\nexport class SuggestItemInfo {\n static fromSuggestion(suggestController, model, position, item, toggleMode) {\n let { insertText } = item.completion;\n let isSnippetText = false;\n if (item.completion.insertTextRules & 4 /* CompletionItemInsertTextRule.InsertAsSnippet */) {\n const snippet = new SnippetParser().parse(insertText);\n if (snippet.children.length < 100) {\n // Adjust whitespace is expensive.\n SnippetSession.adjustWhitespace(model, position, true, snippet);\n }\n insertText = snippet.toString();\n isSnippetText = true;\n }\n const info = suggestController.getOverwriteInfo(item, toggleMode);\n return new SuggestItemInfo(Range.fromPositions(position.delta(0, -info.overwriteBefore), position.delta(0, Math.max(info.overwriteAfter, 0))), insertText, item.completion.kind, isSnippetText);\n }\n constructor(range, insertText, completionItemKind, isSnippetText) {\n this.range = range;\n this.insertText = insertText;\n this.completionItemKind = completionItemKind;\n this.isSnippetText = isSnippetText;\n }\n equals(other) {\n return this.range.equalsRange(other.range)\n && this.insertText === other.insertText\n && this.completionItemKind === other.completionItemKind\n && this.isSnippetText === other.isSnippetText;\n }\n toSelectedSuggestionInfo() {\n return new SelectedSuggestionInfo(this.range, this.insertText, this.completionItemKind, this.isSnippetText);\n }\n toSingleTextEdit() {\n return new SingleTextEdit(this.range, this.insertText);\n }\n}\nfunction suggestItemInfoEquals(a, b) {\n if (a === b) {\n return true;\n }\n if (!a || !b) {\n return false;\n }\n return a.equals(b);\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nvar InlineCompletionsController_1;\nimport { createStyleSheet2 } from '../../../../base/browser/dom.js';\nimport { alert } from '../../../../base/browser/ui/aria/aria.js';\nimport { timeout } from '../../../../base/common/async.js';\nimport { cancelOnDispose } from '../../../../base/common/cancellation.js';\nimport { itemEquals, itemsEquals } from '../../../../base/common/equals.js';\nimport { Disposable, DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { autorun, autorunHandleChanges, constObservable, derived, disposableObservableValue, observableFromEvent, observableSignal, observableValue, transaction, waitForState } from '../../../../base/common/observable.js';\nimport { observableValueOpts } from '../../../../base/common/observableInternal/base.js';\nimport { mapObservableArrayCached } from '../../../../base/common/observableInternal/utils.js';\nimport { isUndefined } from '../../../../base/common/types.js';\nimport { CoreEditingCommands } from '../../../browser/coreCommands.js';\nimport { Position } from '../../../common/core/position.js';\nimport { ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { inlineSuggestCommitId } from './commandIds.js';\nimport { GhostTextWidget } from './ghostTextWidget.js';\nimport { InlineCompletionContextKeys } from './inlineCompletionContextKeys.js';\nimport { InlineCompletionsHintsWidget, InlineSuggestionHintsContentWidget } from './inlineCompletionsHintsWidget.js';\nimport { InlineCompletionsModel, VersionIdChangeReason } from './inlineCompletionsModel.js';\nimport { SuggestWidgetAdaptor } from './suggestWidgetInlineCompletionProvider.js';\nimport { localize } from '../../../../nls.js';\nimport { IAccessibilityService } from '../../../../platform/accessibility/common/accessibility.js';\nimport { AccessibilitySignal, IAccessibilitySignalService } from '../../../../platform/accessibilitySignal/browser/accessibilitySignalService.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 { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nlet InlineCompletionsController = InlineCompletionsController_1 = class InlineCompletionsController extends Disposable {\n static get(editor) {\n return editor.getContribution(InlineCompletionsController_1.ID);\n }\n constructor(editor, _instantiationService, _contextKeyService, _configurationService, _commandService, _debounceService, _languageFeaturesService, _accessibilitySignalService, _keybindingService, _accessibilityService) {\n super();\n this.editor = editor;\n this._instantiationService = _instantiationService;\n this._contextKeyService = _contextKeyService;\n this._configurationService = _configurationService;\n this._commandService = _commandService;\n this._debounceService = _debounceService;\n this._languageFeaturesService = _languageFeaturesService;\n this._accessibilitySignalService = _accessibilitySignalService;\n this._keybindingService = _keybindingService;\n this._accessibilityService = _accessibilityService;\n this.model = this._register(disposableObservableValue('inlineCompletionModel', undefined));\n this._textModelVersionId = observableValue(this, -1);\n this._positions = observableValueOpts({ owner: this, equalsFn: itemsEquals(itemEquals()) }, [new Position(1, 1)]);\n this._suggestWidgetAdaptor = this._register(new SuggestWidgetAdaptor(this.editor, () => { var _a, _b; return (_b = (_a = this.model.get()) === null || _a === void 0 ? void 0 : _a.selectedInlineCompletion.get()) === null || _b === void 0 ? void 0 : _b.toSingleTextEdit(undefined); }, (tx) => this.updateObservables(tx, VersionIdChangeReason.Other), (item) => {\n transaction(tx => {\n var _a;\n /** @description InlineCompletionsController.handleSuggestAccepted */\n this.updateObservables(tx, VersionIdChangeReason.Other);\n (_a = this.model.get()) === null || _a === void 0 ? void 0 : _a.handleSuggestAccepted(item);\n });\n }));\n this._enabledInConfig = observableFromEvent(this.editor.onDidChangeConfiguration, () => this.editor.getOption(62 /* EditorOption.inlineSuggest */).enabled);\n this._isScreenReaderEnabled = observableFromEvent(this._accessibilityService.onDidChangeScreenReaderOptimized, () => this._accessibilityService.isScreenReaderOptimized());\n this._editorDictationInProgress = observableFromEvent(this._contextKeyService.onDidChangeContext, () => this._contextKeyService.getContext(this.editor.getDomNode()).getValue('editorDictation.inProgress') === true);\n this._enabled = derived(this, reader => this._enabledInConfig.read(reader) && (!this._isScreenReaderEnabled.read(reader) || !this._editorDictationInProgress.read(reader)));\n this._fontFamily = observableFromEvent(this.editor.onDidChangeConfiguration, () => this.editor.getOption(62 /* EditorOption.inlineSuggest */).fontFamily);\n this._ghostTexts = derived(this, (reader) => {\n var _a;\n const model = this.model.read(reader);\n return (_a = model === null || model === void 0 ? void 0 : model.ghostTexts.read(reader)) !== null && _a !== void 0 ? _a : [];\n });\n this._stablizedGhostTexts = convertItemsToStableObservables(this._ghostTexts, this._store);\n this._ghostTextWidgets = mapObservableArrayCached(this, this._stablizedGhostTexts, (ghostText, store) => {\n return store.add(this._instantiationService.createInstance(GhostTextWidget, this.editor, {\n ghostText: ghostText,\n minReservedLineCount: constObservable(0),\n targetTextModel: this.model.map(v => v === null || v === void 0 ? void 0 : v.textModel),\n }));\n }).recomputeInitiallyAndOnChange(this._store);\n this._debounceValue = this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider, 'InlineCompletionsDebounce', { min: 50, max: 50 });\n this._playAccessibilitySignal = observableSignal(this);\n this._isReadonly = observableFromEvent(this.editor.onDidChangeConfiguration, () => this.editor.getOption(91 /* EditorOption.readOnly */));\n this._textModel = observableFromEvent(this.editor.onDidChangeModel, () => this.editor.getModel());\n this._textModelIfWritable = derived(reader => this._isReadonly.read(reader) ? undefined : this._textModel.read(reader));\n this._register(new InlineCompletionContextKeys(this._contextKeyService, this.model));\n this._register(autorun(reader => {\n /** @description InlineCompletionsController.update model */\n const textModel = this._textModelIfWritable.read(reader);\n transaction(tx => {\n /** @description InlineCompletionsController.onDidChangeModel/readonly */\n this.model.set(undefined, tx);\n this.updateObservables(tx, VersionIdChangeReason.Other);\n if (textModel) {\n const model = _instantiationService.createInstance(InlineCompletionsModel, textModel, this._suggestWidgetAdaptor.selectedItem, this._textModelVersionId, this._positions, this._debounceValue, observableFromEvent(editor.onDidChangeConfiguration, () => editor.getOption(118 /* EditorOption.suggest */).preview), observableFromEvent(editor.onDidChangeConfiguration, () => editor.getOption(118 /* EditorOption.suggest */).previewMode), observableFromEvent(editor.onDidChangeConfiguration, () => editor.getOption(62 /* EditorOption.inlineSuggest */).mode), this._enabled);\n this.model.set(model, tx);\n }\n });\n }));\n const styleElement = this._register(createStyleSheet2());\n this._register(autorun(reader => {\n const fontFamily = this._fontFamily.read(reader);\n styleElement.setStyle(fontFamily === '' || fontFamily === 'default' ? `` : `\n.monaco-editor .ghost-text-decoration,\n.monaco-editor .ghost-text-decoration-preview,\n.monaco-editor .ghost-text {\n\tfont-family: ${fontFamily};\n}`);\n }));\n const getReason = (e) => {\n var _a;\n if (e.isUndoing) {\n return VersionIdChangeReason.Undo;\n }\n if (e.isRedoing) {\n return VersionIdChangeReason.Redo;\n }\n if ((_a = this.model.get()) === null || _a === void 0 ? void 0 : _a.isAcceptingPartially) {\n return VersionIdChangeReason.AcceptWord;\n }\n return VersionIdChangeReason.Other;\n };\n this._register(editor.onDidChangeModelContent((e) => transaction(tx => \n /** @description InlineCompletionsController.onDidChangeModelContent */\n this.updateObservables(tx, getReason(e)))));\n this._register(editor.onDidChangeCursorPosition(e => transaction(tx => {\n var _a;\n /** @description InlineCompletionsController.onDidChangeCursorPosition */\n this.updateObservables(tx, VersionIdChangeReason.Other);\n if (e.reason === 3 /* CursorChangeReason.Explicit */ || e.source === 'api') {\n (_a = this.model.get()) === null || _a === void 0 ? void 0 : _a.stop(tx);\n }\n })));\n this._register(editor.onDidType(() => transaction(tx => {\n var _a;\n /** @description InlineCompletionsController.onDidType */\n this.updateObservables(tx, VersionIdChangeReason.Other);\n if (this._enabled.get()) {\n (_a = this.model.get()) === null || _a === void 0 ? void 0 : _a.trigger(tx);\n }\n })));\n this._register(this._commandService.onDidExecuteCommand((e) => {\n // These commands don't trigger onDidType.\n const commands = new Set([\n CoreEditingCommands.Tab.id,\n CoreEditingCommands.DeleteLeft.id,\n CoreEditingCommands.DeleteRight.id,\n inlineSuggestCommitId,\n 'acceptSelectedSuggestion',\n ]);\n if (commands.has(e.commandId) && editor.hasTextFocus() && this._enabled.get()) {\n transaction(tx => {\n var _a;\n /** @description onDidExecuteCommand */\n (_a = this.model.get()) === null || _a === void 0 ? void 0 : _a.trigger(tx);\n });\n }\n }));\n this._register(this.editor.onDidBlurEditorWidget(() => {\n // This is a hidden setting very useful for debugging\n if (this._contextKeyService.getContextKeyValue('accessibleViewIsShown') || this._configurationService.getValue('editor.inlineSuggest.keepOnBlur') ||\n editor.getOption(62 /* EditorOption.inlineSuggest */).keepOnBlur) {\n return;\n }\n if (InlineSuggestionHintsContentWidget.dropDownVisible) {\n return;\n }\n transaction(tx => {\n var _a;\n /** @description InlineCompletionsController.onDidBlurEditorWidget */\n (_a = this.model.get()) === null || _a === void 0 ? void 0 : _a.stop(tx);\n });\n }));\n this._register(autorun(reader => {\n var _a;\n /** @description InlineCompletionsController.forceRenderingAbove */\n const state = (_a = this.model.read(reader)) === null || _a === void 0 ? void 0 : _a.state.read(reader);\n if (state === null || state === void 0 ? void 0 : state.suggestItem) {\n if (state.primaryGhostText.lineCount >= 2) {\n this._suggestWidgetAdaptor.forceRenderingAbove();\n }\n }\n else {\n this._suggestWidgetAdaptor.stopForceRenderingAbove();\n }\n }));\n this._register(toDisposable(() => {\n this._suggestWidgetAdaptor.stopForceRenderingAbove();\n }));\n const cancellationStore = this._register(new DisposableStore());\n let lastInlineCompletionId = undefined;\n this._register(autorunHandleChanges({\n handleChange: (context, changeSummary) => {\n if (context.didChange(this._playAccessibilitySignal)) {\n lastInlineCompletionId = undefined;\n }\n return true;\n },\n }, async (reader, _) => {\n /** @description InlineCompletionsController.playAccessibilitySignalAndReadSuggestion */\n this._playAccessibilitySignal.read(reader);\n const model = this.model.read(reader);\n const state = model === null || model === void 0 ? void 0 : model.state.read(reader);\n if (!model || !state || !state.inlineCompletion) {\n lastInlineCompletionId = undefined;\n return;\n }\n if (state.inlineCompletion.semanticId !== lastInlineCompletionId) {\n cancellationStore.clear();\n lastInlineCompletionId = state.inlineCompletion.semanticId;\n const lineText = model.textModel.getLineContent(state.primaryGhostText.lineNumber);\n await timeout(50, cancelOnDispose(cancellationStore));\n await waitForState(this._suggestWidgetAdaptor.selectedItem, isUndefined, () => false, cancelOnDispose(cancellationStore));\n await this._accessibilitySignalService.playSignal(AccessibilitySignal.inlineSuggestion);\n if (this.editor.getOption(8 /* EditorOption.screenReaderAnnounceInlineSuggestion */)) {\n this.provideScreenReaderUpdate(state.primaryGhostText.renderForScreenReader(lineText));\n }\n }\n }));\n this._register(new InlineCompletionsHintsWidget(this.editor, this.model, this._instantiationService));\n this._register(this._configurationService.onDidChangeConfiguration(e => {\n if (e.affectsConfiguration('accessibility.verbosity.inlineCompletions')) {\n this.editor.updateOptions({ inlineCompletionsAccessibilityVerbose: this._configurationService.getValue('accessibility.verbosity.inlineCompletions') });\n }\n }));\n this.editor.updateOptions({ inlineCompletionsAccessibilityVerbose: this._configurationService.getValue('accessibility.verbosity.inlineCompletions') });\n }\n playAccessibilitySignal(tx) {\n this._playAccessibilitySignal.trigger(tx);\n }\n provideScreenReaderUpdate(content) {\n const accessibleViewShowing = this._contextKeyService.getContextKeyValue('accessibleViewIsShown');\n const accessibleViewKeybinding = this._keybindingService.lookupKeybinding('editor.action.accessibleView');\n let hint;\n if (!accessibleViewShowing && accessibleViewKeybinding && this.editor.getOption(149 /* EditorOption.inlineCompletionsAccessibilityVerbose */)) {\n hint = localize('showAccessibleViewHint', \"Inspect this in the accessible view ({0})\", accessibleViewKeybinding.getAriaLabel());\n }\n hint ? alert(content + ', ' + hint) : alert(content);\n }\n /**\n * Copies over the relevant state from the text model to observables.\n * This solves all kind of eventing issues, as we make sure we always operate on the latest state,\n * regardless of who calls into us.\n */\n updateObservables(tx, changeReason) {\n var _a, _b, _c;\n const newModel = this.editor.getModel();\n this._textModelVersionId.set((_a = newModel === null || newModel === void 0 ? void 0 : newModel.getVersionId()) !== null && _a !== void 0 ? _a : -1, tx, changeReason);\n this._positions.set((_c = (_b = this.editor.getSelections()) === null || _b === void 0 ? void 0 : _b.map(selection => selection.getPosition())) !== null && _c !== void 0 ? _c : [new Position(1, 1)], tx);\n }\n shouldShowHoverAt(range) {\n var _a;\n const ghostText = (_a = this.model.get()) === null || _a === void 0 ? void 0 : _a.primaryGhostText.get();\n if (ghostText) {\n return ghostText.parts.some(p => range.containsPosition(new Position(ghostText.lineNumber, p.column)));\n }\n return false;\n }\n shouldShowHoverAtViewZone(viewZoneId) {\n var _a, _b;\n return (_b = (_a = this._ghostTextWidgets.get()[0]) === null || _a === void 0 ? void 0 : _a.ownsViewZone(viewZoneId)) !== null && _b !== void 0 ? _b : false;\n }\n};\nInlineCompletionsController.ID = 'editor.contrib.inlineCompletionsController';\nInlineCompletionsController = InlineCompletionsController_1 = __decorate([\n __param(1, IInstantiationService),\n __param(2, IContextKeyService),\n __param(3, IConfigurationService),\n __param(4, ICommandService),\n __param(5, ILanguageFeatureDebounceService),\n __param(6, ILanguageFeaturesService),\n __param(7, IAccessibilitySignalService),\n __param(8, IKeybindingService),\n __param(9, IAccessibilityService)\n], InlineCompletionsController);\nexport { InlineCompletionsController };\nfunction convertItemsToStableObservables(items, store) {\n const result = observableValue('result', []);\n const innerObservables = [];\n store.add(autorun(reader => {\n const itemsValue = items.read(reader);\n transaction(tx => {\n if (itemsValue.length !== innerObservables.length) {\n innerObservables.length = itemsValue.length;\n for (let i = 0; i < innerObservables.length; i++) {\n if (!innerObservables[i]) {\n innerObservables[i] = observableValue('item', itemsValue[i]);\n }\n }\n result.set([...innerObservables], tx);\n }\n innerObservables.forEach((o, i) => o.set(itemsValue[i], tx));\n });\n }));\n return result;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { transaction } from '../../../../base/common/observable.js';\nimport { asyncTransaction } from '../../../../base/common/observableInternal/base.js';\nimport { EditorAction } from '../../../browser/editorExtensions.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { showNextInlineSuggestionActionId, showPreviousInlineSuggestionActionId, inlineSuggestCommitId } from './commandIds.js';\nimport { InlineCompletionContextKeys } from './inlineCompletionContextKeys.js';\nimport { InlineCompletionsController } from './inlineCompletionsController.js';\nimport { Context as SuggestContext } from '../../suggest/browser/suggest.js';\nimport * as nls from '../../../../nls.js';\nimport { MenuId, Action2 } from '../../../../platform/actions/common/actions.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\nimport { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js';\nexport class ShowNextInlineSuggestionAction extends EditorAction {\n constructor() {\n super({\n id: ShowNextInlineSuggestionAction.ID,\n label: nls.localize('action.inlineSuggest.showNext', \"Show Next Inline Suggestion\"),\n alias: 'Show Next Inline Suggestion',\n precondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),\n kbOpts: {\n weight: 100,\n primary: 512 /* KeyMod.Alt */ | 94 /* KeyCode.BracketRight */,\n },\n });\n }\n async run(accessor, editor) {\n var _a;\n const controller = InlineCompletionsController.get(editor);\n (_a = controller === null || controller === void 0 ? void 0 : controller.model.get()) === null || _a === void 0 ? void 0 : _a.next();\n }\n}\nShowNextInlineSuggestionAction.ID = showNextInlineSuggestionActionId;\nexport class ShowPreviousInlineSuggestionAction extends EditorAction {\n constructor() {\n super({\n id: ShowPreviousInlineSuggestionAction.ID,\n label: nls.localize('action.inlineSuggest.showPrevious', \"Show Previous Inline Suggestion\"),\n alias: 'Show Previous Inline Suggestion',\n precondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),\n kbOpts: {\n weight: 100,\n primary: 512 /* KeyMod.Alt */ | 92 /* KeyCode.BracketLeft */,\n },\n });\n }\n async run(accessor, editor) {\n var _a;\n const controller = InlineCompletionsController.get(editor);\n (_a = controller === null || controller === void 0 ? void 0 : controller.model.get()) === null || _a === void 0 ? void 0 : _a.previous();\n }\n}\nShowPreviousInlineSuggestionAction.ID = showPreviousInlineSuggestionActionId;\nexport class TriggerInlineSuggestionAction extends EditorAction {\n constructor() {\n super({\n id: 'editor.action.inlineSuggest.trigger',\n label: nls.localize('action.inlineSuggest.trigger', \"Trigger Inline Suggestion\"),\n alias: 'Trigger Inline Suggestion',\n precondition: EditorContextKeys.writable\n });\n }\n async run(accessor, editor) {\n const controller = InlineCompletionsController.get(editor);\n await asyncTransaction(async (tx) => {\n var _a;\n /** @description triggerExplicitly from command */\n await ((_a = controller === null || controller === void 0 ? void 0 : controller.model.get()) === null || _a === void 0 ? void 0 : _a.triggerExplicitly(tx));\n controller === null || controller === void 0 ? void 0 : controller.playAccessibilitySignal(tx);\n });\n }\n}\nexport class AcceptNextWordOfInlineCompletion extends EditorAction {\n constructor() {\n super({\n id: 'editor.action.inlineSuggest.acceptNextWord',\n label: nls.localize('action.inlineSuggest.acceptNextWord', \"Accept Next Word Of Inline Suggestion\"),\n alias: 'Accept Next Word Of Inline Suggestion',\n precondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),\n kbOpts: {\n weight: 100 /* KeybindingWeight.EditorContrib */ + 1,\n primary: 2048 /* KeyMod.CtrlCmd */ | 17 /* KeyCode.RightArrow */,\n kbExpr: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),\n },\n menuOpts: [{\n menuId: MenuId.InlineSuggestionToolbar,\n title: nls.localize('acceptWord', 'Accept Word'),\n group: 'primary',\n order: 2,\n }],\n });\n }\n async run(accessor, editor) {\n var _a;\n const controller = InlineCompletionsController.get(editor);\n await ((_a = controller === null || controller === void 0 ? void 0 : controller.model.get()) === null || _a === void 0 ? void 0 : _a.acceptNextWord(controller.editor));\n }\n}\nexport class AcceptNextLineOfInlineCompletion extends EditorAction {\n constructor() {\n super({\n id: 'editor.action.inlineSuggest.acceptNextLine',\n label: nls.localize('action.inlineSuggest.acceptNextLine', \"Accept Next Line Of Inline Suggestion\"),\n alias: 'Accept Next Line Of Inline Suggestion',\n precondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),\n kbOpts: {\n weight: 100 /* KeybindingWeight.EditorContrib */ + 1,\n },\n menuOpts: [{\n menuId: MenuId.InlineSuggestionToolbar,\n title: nls.localize('acceptLine', 'Accept Line'),\n group: 'secondary',\n order: 2,\n }],\n });\n }\n async run(accessor, editor) {\n var _a;\n const controller = InlineCompletionsController.get(editor);\n await ((_a = controller === null || controller === void 0 ? void 0 : controller.model.get()) === null || _a === void 0 ? void 0 : _a.acceptNextLine(controller.editor));\n }\n}\nexport class AcceptInlineCompletion extends EditorAction {\n constructor() {\n super({\n id: inlineSuggestCommitId,\n label: nls.localize('action.inlineSuggest.accept', \"Accept Inline Suggestion\"),\n alias: 'Accept Inline Suggestion',\n precondition: InlineCompletionContextKeys.inlineSuggestionVisible,\n menuOpts: [{\n menuId: MenuId.InlineSuggestionToolbar,\n title: nls.localize('accept', \"Accept\"),\n group: 'primary',\n order: 1,\n }],\n kbOpts: {\n primary: 2 /* KeyCode.Tab */,\n weight: 200,\n kbExpr: ContextKeyExpr.and(InlineCompletionContextKeys.inlineSuggestionVisible, EditorContextKeys.tabMovesFocus.toNegated(), InlineCompletionContextKeys.inlineSuggestionHasIndentationLessThanTabSize, SuggestContext.Visible.toNegated(), EditorContextKeys.hoverFocused.toNegated()),\n }\n });\n }\n async run(accessor, editor) {\n var _a;\n const controller = InlineCompletionsController.get(editor);\n if (controller) {\n (_a = controller.model.get()) === null || _a === void 0 ? void 0 : _a.accept(controller.editor);\n controller.editor.focus();\n }\n }\n}\nexport class HideInlineCompletion extends EditorAction {\n constructor() {\n super({\n id: HideInlineCompletion.ID,\n label: nls.localize('action.inlineSuggest.hide', \"Hide Inline Suggestion\"),\n alias: 'Hide Inline Suggestion',\n precondition: InlineCompletionContextKeys.inlineSuggestionVisible,\n kbOpts: {\n weight: 100,\n primary: 9 /* KeyCode.Escape */,\n }\n });\n }\n async run(accessor, editor) {\n const controller = InlineCompletionsController.get(editor);\n transaction(tx => {\n var _a;\n (_a = controller === null || controller === void 0 ? void 0 : controller.model.get()) === null || _a === void 0 ? void 0 : _a.stop(tx);\n });\n }\n}\nHideInlineCompletion.ID = 'editor.action.inlineSuggest.hide';\nexport class ToggleAlwaysShowInlineSuggestionToolbar extends Action2 {\n constructor() {\n super({\n id: ToggleAlwaysShowInlineSuggestionToolbar.ID,\n title: nls.localize('action.inlineSuggest.alwaysShowToolbar', \"Always Show Toolbar\"),\n f1: false,\n precondition: undefined,\n menu: [{\n id: MenuId.InlineSuggestionToolbar,\n group: 'secondary',\n order: 10,\n }],\n toggled: ContextKeyExpr.equals('config.editor.inlineSuggest.showToolbar', 'always')\n });\n }\n async run(accessor, editor) {\n const configService = accessor.get(IConfigurationService);\n const currentValue = configService.getValue('editor.inlineSuggest.showToolbar');\n const newValue = currentValue === 'always' ? 'onHover' : 'always';\n configService.updateValue('editor.inlineSuggest.showToolbar', newValue);\n }\n}\nToggleAlwaysShowInlineSuggestionToolbar.ID = 'editor.action.inlineSuggest.toggleAlwaysShowToolbar';\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nimport * as dom from '../../../../base/browser/dom.js';\nimport { MarkdownString } from '../../../../base/common/htmlContent.js';\nimport { DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { autorun, constObservable } from '../../../../base/common/observable.js';\nimport { Range } from '../../../common/core/range.js';\nimport { ILanguageService } from '../../../common/languages/language.js';\nimport { HoverForeignElementAnchor } from '../../hover/browser/hoverTypes.js';\nimport { InlineCompletionsController } from './inlineCompletionsController.js';\nimport { InlineSuggestionHintsContentWidget } from './inlineCompletionsHintsWidget.js';\nimport { MarkdownRenderer } from '../../../browser/widget/markdownRenderer/browser/markdownRenderer.js';\nimport * as nls from '../../../../nls.js';\nimport { IAccessibilityService } from '../../../../platform/accessibility/common/accessibility.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { IOpenerService } from '../../../../platform/opener/common/opener.js';\nimport { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';\nexport class InlineCompletionsHover {\n constructor(owner, range, controller) {\n this.owner = owner;\n this.range = range;\n this.controller = controller;\n }\n isValidForHoverAnchor(anchor) {\n return (anchor.type === 1 /* HoverAnchorType.Range */\n && this.range.startColumn <= anchor.range.startColumn\n && this.range.endColumn >= anchor.range.endColumn);\n }\n}\nlet InlineCompletionsHoverParticipant = class InlineCompletionsHoverParticipant {\n constructor(_editor, _languageService, _openerService, accessibilityService, _instantiationService, _telemetryService) {\n this._editor = _editor;\n this._languageService = _languageService;\n this._openerService = _openerService;\n this.accessibilityService = accessibilityService;\n this._instantiationService = _instantiationService;\n this._telemetryService = _telemetryService;\n this.hoverOrdinal = 4;\n }\n suggestHoverAnchor(mouseEvent) {\n const controller = InlineCompletionsController.get(this._editor);\n if (!controller) {\n return null;\n }\n const target = mouseEvent.target;\n if (target.type === 8 /* MouseTargetType.CONTENT_VIEW_ZONE */) {\n // handle the case where the mouse is over the view zone\n const viewZoneData = target.detail;\n if (controller.shouldShowHoverAtViewZone(viewZoneData.viewZoneId)) {\n return new HoverForeignElementAnchor(1000, this, Range.fromPositions(this._editor.getModel().validatePosition(viewZoneData.positionBefore || viewZoneData.position)), mouseEvent.event.posx, mouseEvent.event.posy, false);\n }\n }\n if (target.type === 7 /* MouseTargetType.CONTENT_EMPTY */) {\n // handle the case where the mouse is over the empty portion of a line following ghost text\n if (controller.shouldShowHoverAt(target.range)) {\n return new HoverForeignElementAnchor(1000, this, target.range, mouseEvent.event.posx, mouseEvent.event.posy, false);\n }\n }\n if (target.type === 6 /* MouseTargetType.CONTENT_TEXT */) {\n // handle the case where the mouse is directly over ghost text\n const mightBeForeignElement = target.detail.mightBeForeignElement;\n if (mightBeForeignElement && controller.shouldShowHoverAt(target.range)) {\n return new HoverForeignElementAnchor(1000, this, target.range, mouseEvent.event.posx, mouseEvent.event.posy, false);\n }\n }\n return null;\n }\n computeSync(anchor, lineDecorations) {\n if (this._editor.getOption(62 /* EditorOption.inlineSuggest */).showToolbar !== 'onHover') {\n return [];\n }\n const controller = InlineCompletionsController.get(this._editor);\n if (controller && controller.shouldShowHoverAt(anchor.range)) {\n return [new InlineCompletionsHover(this, anchor.range, controller)];\n }\n return [];\n }\n renderHoverParts(context, hoverParts) {\n const disposableStore = new DisposableStore();\n const part = hoverParts[0];\n this._telemetryService.publicLog2('inlineCompletionHover.shown');\n if (this.accessibilityService.isScreenReaderOptimized() && !this._editor.getOption(8 /* EditorOption.screenReaderAnnounceInlineSuggestion */)) {\n this.renderScreenReaderText(context, part, disposableStore);\n }\n const model = part.controller.model.get();\n const w = this._instantiationService.createInstance(InlineSuggestionHintsContentWidget, this._editor, false, constObservable(null), model.selectedInlineCompletionIndex, model.inlineCompletionsCount, model.activeCommands);\n context.fragment.appendChild(w.getDomNode());\n model.triggerExplicitly();\n disposableStore.add(w);\n return disposableStore;\n }\n renderScreenReaderText(context, part, disposableStore) {\n const $ = dom.$;\n const markdownHoverElement = $('div.hover-row.markdown-hover');\n const hoverContentsElement = dom.append(markdownHoverElement, $('div.hover-contents', { ['aria-live']: 'assertive' }));\n const renderer = disposableStore.add(new MarkdownRenderer({ editor: this._editor }, this._languageService, this._openerService));\n const render = (code) => {\n disposableStore.add(renderer.onDidRenderAsync(() => {\n hoverContentsElement.className = 'hover-contents code-hover-contents';\n context.onContentsChanged();\n }));\n const inlineSuggestionAvailable = nls.localize('inlineSuggestionFollows', \"Suggestion:\");\n const renderedContents = disposableStore.add(renderer.render(new MarkdownString().appendText(inlineSuggestionAvailable).appendCodeblock('text', code)));\n hoverContentsElement.replaceChildren(renderedContents.element);\n };\n disposableStore.add(autorun(reader => {\n var _a;\n /** @description update hover */\n const ghostText = (_a = part.controller.model.read(reader)) === null || _a === void 0 ? void 0 : _a.primaryGhostText.read(reader);\n if (ghostText) {\n const lineText = this._editor.getModel().getLineContent(ghostText.lineNumber);\n render(ghostText.renderForScreenReader(lineText));\n }\n else {\n dom.reset(hoverContentsElement);\n }\n }));\n context.fragment.appendChild(markdownHoverElement);\n }\n};\nInlineCompletionsHoverParticipant = __decorate([\n __param(1, ILanguageService),\n __param(2, IOpenerService),\n __param(3, IAccessibilityService),\n __param(4, IInstantiationService),\n __param(5, ITelemetryService)\n], InlineCompletionsHoverParticipant);\nexport { InlineCompletionsHoverParticipant };\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Disposable } from '../../../../base/common/lifecycle.js';\nexport class InlineCompletionsAccessibleView extends Disposable {\n constructor() {\n super();\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { registerEditorAction, registerEditorContribution } from '../../../browser/editorExtensions.js';\nimport { HoverParticipantRegistry } from '../../hover/browser/hoverTypes.js';\nimport { TriggerInlineSuggestionAction, ShowNextInlineSuggestionAction, ShowPreviousInlineSuggestionAction, AcceptNextWordOfInlineCompletion, AcceptInlineCompletion, HideInlineCompletion, ToggleAlwaysShowInlineSuggestionToolbar, AcceptNextLineOfInlineCompletion } from './commands.js';\nimport { InlineCompletionsHoverParticipant } from './hoverParticipant.js';\nimport { InlineCompletionsAccessibleView } from './inlineCompletionsAccessibleView.js';\nimport { InlineCompletionsController } from './inlineCompletionsController.js';\nimport { AccessibleViewRegistry } from '../../../../platform/accessibility/browser/accessibleViewRegistry.js';\nimport { registerAction2 } from '../../../../platform/actions/common/actions.js';\nregisterEditorContribution(InlineCompletionsController.ID, InlineCompletionsController, 3 /* EditorContributionInstantiation.Eventually */);\nregisterEditorAction(TriggerInlineSuggestionAction);\nregisterEditorAction(ShowNextInlineSuggestionAction);\nregisterEditorAction(ShowPreviousInlineSuggestionAction);\nregisterEditorAction(AcceptNextWordOfInlineCompletion);\nregisterEditorAction(AcceptNextLineOfInlineCompletion);\nregisterEditorAction(AcceptInlineCompletion);\nregisterEditorAction(HideInlineCompletion);\nregisterAction2(ToggleAlwaysShowInlineSuggestionToolbar);\nHoverParticipantRegistry.register(InlineCompletionsHoverParticipant);\nAccessibleViewRegistry.register(new InlineCompletionsAccessibleView());\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nvar InlineSuggestionHintsContentWidget_1;\nimport { h } from '../../../../base/browser/dom.js';\nimport { ActionViewItem } from '../../../../base/browser/ui/actionbar/actionViewItems.js';\nimport { KeybindingLabel, unthemedKeybindingLabelOptions } from '../../../../base/browser/ui/keybindingLabel/keybindingLabel.js';\nimport { Action, Separator } from '../../../../base/common/actions.js';\nimport { equals } from '../../../../base/common/arrays.js';\nimport { RunOnceScheduler } from '../../../../base/common/async.js';\nimport { Codicon } from '../../../../base/common/codicons.js';\nimport { Disposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { autorun, autorunWithStore, derived, derivedObservableWithCache, observableFromEvent } from '../../../../base/common/observable.js';\nimport { derivedWithStore } from '../../../../base/common/observableInternal/derived.js';\nimport { OS } from '../../../../base/common/platform.js';\nimport { ThemeIcon } from '../../../../base/common/themables.js';\nimport './inlineCompletionsHintsWidget.css';\nimport { Position } from '../../../common/core/position.js';\nimport { InlineCompletionTriggerKind } from '../../../common/languages.js';\nimport { showNextInlineSuggestionActionId, showPreviousInlineSuggestionActionId } from './commandIds.js';\nimport { localize } from '../../../../nls.js';\nimport { MenuEntryActionViewItem, createAndFillInActionBarActions } from '../../../../platform/actions/browser/menuEntryActionViewItem.js';\nimport { WorkbenchToolBar } from '../../../../platform/actions/browser/toolbar.js';\nimport { IMenuService, MenuId, MenuItemAction } from '../../../../platform/actions/common/actions.js';\nimport { ICommandService } from '../../../../platform/commands/common/commands.js';\nimport { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';\nimport { registerIcon } from '../../../../platform/theme/common/iconRegistry.js';\nlet InlineCompletionsHintsWidget = class InlineCompletionsHintsWidget extends Disposable {\n constructor(editor, model, instantiationService) {\n super();\n this.editor = editor;\n this.model = model;\n this.instantiationService = instantiationService;\n this.alwaysShowToolbar = observableFromEvent(this.editor.onDidChangeConfiguration, () => this.editor.getOption(62 /* EditorOption.inlineSuggest */).showToolbar === 'always');\n this.sessionPosition = undefined;\n this.position = derived(this, reader => {\n var _a, _b, _c;\n const ghostText = (_a = this.model.read(reader)) === null || _a === void 0 ? void 0 : _a.primaryGhostText.read(reader);\n if (!this.alwaysShowToolbar.read(reader) || !ghostText || ghostText.parts.length === 0) {\n this.sessionPosition = undefined;\n return null;\n }\n const firstColumn = ghostText.parts[0].column;\n if (this.sessionPosition && this.sessionPosition.lineNumber !== ghostText.lineNumber) {\n this.sessionPosition = undefined;\n }\n const position = new Position(ghostText.lineNumber, Math.min(firstColumn, (_c = (_b = this.sessionPosition) === null || _b === void 0 ? void 0 : _b.column) !== null && _c !== void 0 ? _c : Number.MAX_SAFE_INTEGER));\n this.sessionPosition = position;\n return position;\n });\n this._register(autorunWithStore((reader, store) => {\n /** @description setup content widget */\n const model = this.model.read(reader);\n if (!model || !this.alwaysShowToolbar.read(reader)) {\n return;\n }\n const contentWidgetValue = derivedWithStore((reader, store) => {\n const contentWidget = store.add(this.instantiationService.createInstance(InlineSuggestionHintsContentWidget, this.editor, true, this.position, model.selectedInlineCompletionIndex, model.inlineCompletionsCount, model.activeCommands));\n editor.addContentWidget(contentWidget);\n store.add(toDisposable(() => editor.removeContentWidget(contentWidget)));\n store.add(autorun(reader => {\n /** @description request explicit */\n const position = this.position.read(reader);\n if (!position) {\n return;\n }\n if (model.lastTriggerKind.read(reader) !== InlineCompletionTriggerKind.Explicit) {\n model.triggerExplicitly();\n }\n }));\n return contentWidget;\n });\n const hadPosition = derivedObservableWithCache(this, (reader, lastValue) => !!this.position.read(reader) || !!lastValue);\n store.add(autorun(reader => {\n if (hadPosition.read(reader)) {\n contentWidgetValue.read(reader);\n }\n }));\n }));\n }\n};\nInlineCompletionsHintsWidget = __decorate([\n __param(2, IInstantiationService)\n], InlineCompletionsHintsWidget);\nexport { InlineCompletionsHintsWidget };\nconst inlineSuggestionHintsNextIcon = registerIcon('inline-suggestion-hints-next', Codicon.chevronRight, localize('parameterHintsNextIcon', 'Icon for show next parameter hint.'));\nconst inlineSuggestionHintsPreviousIcon = registerIcon('inline-suggestion-hints-previous', Codicon.chevronLeft, localize('parameterHintsPreviousIcon', 'Icon for show previous parameter hint.'));\nlet InlineSuggestionHintsContentWidget = InlineSuggestionHintsContentWidget_1 = class InlineSuggestionHintsContentWidget extends Disposable {\n static get dropDownVisible() { return this._dropDownVisible; }\n createCommandAction(commandId, label, iconClassName) {\n const action = new Action(commandId, label, iconClassName, true, () => this._commandService.executeCommand(commandId));\n const kb = this.keybindingService.lookupKeybinding(commandId, this._contextKeyService);\n let tooltip = label;\n if (kb) {\n tooltip = localize({ key: 'content', comment: ['A label', 'A keybinding'] }, '{0} ({1})', label, kb.getLabel());\n }\n action.tooltip = tooltip;\n return action;\n }\n constructor(editor, withBorder, _position, _currentSuggestionIdx, _suggestionCount, _extraCommands, _commandService, instantiationService, keybindingService, _contextKeyService, _menuService) {\n super();\n this.editor = editor;\n this.withBorder = withBorder;\n this._position = _position;\n this._currentSuggestionIdx = _currentSuggestionIdx;\n this._suggestionCount = _suggestionCount;\n this._extraCommands = _extraCommands;\n this._commandService = _commandService;\n this.keybindingService = keybindingService;\n this._contextKeyService = _contextKeyService;\n this._menuService = _menuService;\n this.id = `InlineSuggestionHintsContentWidget${InlineSuggestionHintsContentWidget_1.id++}`;\n this.allowEditorOverflow = true;\n this.suppressMouseDown = false;\n this.nodes = h('div.inlineSuggestionsHints', { className: this.withBorder ? '.withBorder' : '' }, [\n h('div@toolBar'),\n ]);\n this.previousAction = this.createCommandAction(showPreviousInlineSuggestionActionId, localize('previous', 'Previous'), ThemeIcon.asClassName(inlineSuggestionHintsPreviousIcon));\n this.availableSuggestionCountAction = new Action('inlineSuggestionHints.availableSuggestionCount', '', undefined, false);\n this.nextAction = this.createCommandAction(showNextInlineSuggestionActionId, localize('next', 'Next'), ThemeIcon.asClassName(inlineSuggestionHintsNextIcon));\n // TODO@hediet: deprecate MenuId.InlineCompletionsActions\n this.inlineCompletionsActionsMenus = this._register(this._menuService.createMenu(MenuId.InlineCompletionsActions, this._contextKeyService));\n this.clearAvailableSuggestionCountLabelDebounced = this._register(new RunOnceScheduler(() => {\n this.availableSuggestionCountAction.label = '';\n }, 100));\n this.disableButtonsDebounced = this._register(new RunOnceScheduler(() => {\n this.previousAction.enabled = this.nextAction.enabled = false;\n }, 100));\n this.toolBar = this._register(instantiationService.createInstance(CustomizedMenuWorkbenchToolBar, this.nodes.toolBar, MenuId.InlineSuggestionToolbar, {\n menuOptions: { renderShortTitle: true },\n toolbarOptions: { primaryGroup: g => g.startsWith('primary') },\n actionViewItemProvider: (action, options) => {\n if (action instanceof MenuItemAction) {\n return instantiationService.createInstance(StatusBarViewItem, action, undefined);\n }\n if (action === this.availableSuggestionCountAction) {\n const a = new ActionViewItemWithClassName(undefined, action, { label: true, icon: false });\n a.setClass('availableSuggestionCount');\n return a;\n }\n return undefined;\n },\n telemetrySource: 'InlineSuggestionToolbar',\n }));\n this.toolBar.setPrependedPrimaryActions([\n this.previousAction,\n this.availableSuggestionCountAction,\n this.nextAction,\n ]);\n this._register(this.toolBar.onDidChangeDropdownVisibility(e => {\n InlineSuggestionHintsContentWidget_1._dropDownVisible = e;\n }));\n this._register(autorun(reader => {\n /** @description update position */\n this._position.read(reader);\n this.editor.layoutContentWidget(this);\n }));\n this._register(autorun(reader => {\n /** @description counts */\n const suggestionCount = this._suggestionCount.read(reader);\n const currentSuggestionIdx = this._currentSuggestionIdx.read(reader);\n if (suggestionCount !== undefined) {\n this.clearAvailableSuggestionCountLabelDebounced.cancel();\n this.availableSuggestionCountAction.label = `${currentSuggestionIdx + 1}/${suggestionCount}`;\n }\n else {\n this.clearAvailableSuggestionCountLabelDebounced.schedule();\n }\n if (suggestionCount !== undefined && suggestionCount > 1) {\n this.disableButtonsDebounced.cancel();\n this.previousAction.enabled = this.nextAction.enabled = true;\n }\n else {\n this.disableButtonsDebounced.schedule();\n }\n }));\n this._register(autorun(reader => {\n /** @description extra commands */\n const extraCommands = this._extraCommands.read(reader);\n const extraActions = extraCommands.map(c => ({\n class: undefined,\n id: c.id,\n enabled: true,\n tooltip: c.tooltip || '',\n label: c.title,\n run: (event) => {\n return this._commandService.executeCommand(c.id);\n },\n }));\n for (const [_, group] of this.inlineCompletionsActionsMenus.getActions()) {\n for (const action of group) {\n if (action instanceof MenuItemAction) {\n extraActions.push(action);\n }\n }\n }\n if (extraActions.length > 0) {\n extraActions.unshift(new Separator());\n }\n this.toolBar.setAdditionalSecondaryActions(extraActions);\n }));\n }\n getId() { return this.id; }\n getDomNode() {\n return this.nodes.root;\n }\n getPosition() {\n return {\n position: this._position.get(),\n preference: [1 /* ContentWidgetPositionPreference.ABOVE */, 2 /* ContentWidgetPositionPreference.BELOW */],\n positionAffinity: 3 /* PositionAffinity.LeftOfInjectedText */,\n };\n }\n};\nInlineSuggestionHintsContentWidget._dropDownVisible = false;\nInlineSuggestionHintsContentWidget.id = 0;\nInlineSuggestionHintsContentWidget = InlineSuggestionHintsContentWidget_1 = __decorate([\n __param(6, ICommandService),\n __param(7, IInstantiationService),\n __param(8, IKeybindingService),\n __param(9, IContextKeyService),\n __param(10, IMenuService)\n], InlineSuggestionHintsContentWidget);\nexport { InlineSuggestionHintsContentWidget };\nclass ActionViewItemWithClassName extends ActionViewItem {\n constructor() {\n super(...arguments);\n this._className = undefined;\n }\n setClass(className) {\n this._className = className;\n }\n render(container) {\n super.render(container);\n if (this._className) {\n container.classList.add(this._className);\n }\n }\n updateTooltip() {\n // NOOP, disable tooltip\n }\n}\nclass StatusBarViewItem extends MenuEntryActionViewItem {\n updateLabel() {\n const kb = this._keybindingService.lookupKeybinding(this._action.id, this._contextKeyService);\n if (!kb) {\n return super.updateLabel();\n }\n if (this.label) {\n const div = h('div.keybinding').root;\n const k = this._register(new KeybindingLabel(div, OS, { disableTitle: true, ...unthemedKeybindingLabelOptions }));\n k.set(kb);\n this.label.textContent = this._action.label;\n this.label.appendChild(div);\n this.label.classList.add('inlineSuggestionStatusBarItemLabel');\n }\n }\n updateTooltip() {\n // NOOP, disable tooltip\n }\n}\nlet CustomizedMenuWorkbenchToolBar = class CustomizedMenuWorkbenchToolBar extends WorkbenchToolBar {\n constructor(container, menuId, options2, menuService, contextKeyService, contextMenuService, keybindingService, commandService, telemetryService) {\n super(container, { resetMenu: menuId, ...options2 }, menuService, contextKeyService, contextMenuService, keybindingService, commandService, telemetryService);\n this.menuId = menuId;\n this.options2 = options2;\n this.menuService = menuService;\n this.contextKeyService = contextKeyService;\n this.menu = this._store.add(this.menuService.createMenu(this.menuId, this.contextKeyService, { emitEventsForSubmenuChanges: true }));\n this.additionalActions = [];\n this.prependedPrimaryActions = [];\n this._store.add(this.menu.onDidChange(() => this.updateToolbar()));\n this.updateToolbar();\n }\n updateToolbar() {\n var _a, _b, _c, _d, _e, _f, _g;\n const primary = [];\n const secondary = [];\n createAndFillInActionBarActions(this.menu, (_a = this.options2) === null || _a === void 0 ? void 0 : _a.menuOptions, { primary, secondary }, (_c = (_b = this.options2) === null || _b === void 0 ? void 0 : _b.toolbarOptions) === null || _c === void 0 ? void 0 : _c.primaryGroup, (_e = (_d = this.options2) === null || _d === void 0 ? void 0 : _d.toolbarOptions) === null || _e === void 0 ? void 0 : _e.shouldInlineSubmenu, (_g = (_f = this.options2) === null || _f === void 0 ? void 0 : _f.toolbarOptions) === null || _g === void 0 ? void 0 : _g.useSeparatorsInPrimaryActions);\n secondary.push(...this.additionalActions);\n primary.unshift(...this.prependedPrimaryActions);\n this.setActions(primary, secondary);\n }\n setPrependedPrimaryActions(actions) {\n if (equals(this.prependedPrimaryActions, actions, (a, b) => a === b)) {\n return;\n }\n this.prependedPrimaryActions = actions;\n this.updateToolbar();\n }\n setAdditionalSecondaryActions(actions) {\n if (equals(this.additionalActions, actions, (a, b) => a === b)) {\n return;\n }\n this.additionalActions = actions;\n this.updateToolbar();\n }\n};\nCustomizedMenuWorkbenchToolBar = __decorate([\n __param(3, IMenuService),\n __param(4, IContextKeyService),\n __param(5, IContextMenuService),\n __param(6, IKeybindingService),\n __param(7, ICommandService),\n __param(8, ITelemetryService)\n], CustomizedMenuWorkbenchToolBar);\nexport { CustomizedMenuWorkbenchToolBar };\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { autorunOpts } from '../../../../base/common/observable.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nconst array = [];\nexport function getReadonlyEmptyArray() {\n return array;\n}\nexport class ColumnRange {\n constructor(startColumn, endColumnExclusive) {\n this.startColumn = startColumn;\n this.endColumnExclusive = endColumnExclusive;\n if (startColumn > endColumnExclusive) {\n throw new BugIndicatingError(`startColumn ${startColumn} cannot be after endColumnExclusive ${endColumnExclusive}`);\n }\n }\n toRange(lineNumber) {\n return new Range(lineNumber, this.startColumn, lineNumber, this.endColumnExclusive);\n }\n equals(other) {\n return this.startColumn === other.startColumn\n && this.endColumnExclusive === other.endColumnExclusive;\n }\n}\nexport function applyObservableDecorations(editor, decorations) {\n const d = new DisposableStore();\n const decorationsCollection = editor.createDecorationsCollection();\n d.add(autorunOpts({ debugName: () => `Apply decorations from ${decorations.debugName}` }, reader => {\n const d = decorations.read(reader);\n decorationsCollection.set(d);\n }));\n d.add({\n dispose: () => {\n decorationsCollection.clear();\n }\n });\n return d;\n}\nexport function addPositions(pos1, pos2) {\n return new Position(pos1.lineNumber + pos2.lineNumber - 1, pos2.lineNumber === 1 ? pos1.column + pos2.column - 1 : pos2.column);\n}\nexport function subtractPositions(pos1, pos2) {\n return new Position(pos1.lineNumber - pos2.lineNumber + 1, pos1.lineNumber - pos2.lineNumber === 0 ? pos1.column - pos2.column + 1 : pos1.column);\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nimport { Disposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { derived, observableFromEvent, observableValue } from '../../../../base/common/observable.js';\nimport './inlineEdit.css';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { ILanguageService } from '../../../common/languages/language.js';\nimport { InjectedTextCursorStops } from '../../../common/model.js';\nimport { LineDecoration } from '../../../common/viewLayout/lineDecorations.js';\nimport { AdditionalLinesWidget } from '../../inlineCompletions/browser/ghostTextWidget.js';\nimport { ColumnRange, applyObservableDecorations } from '../../inlineCompletions/browser/utils.js';\nexport const INLINE_EDIT_DESCRIPTION = 'inline-edit';\nlet GhostTextWidget = class GhostTextWidget extends Disposable {\n constructor(editor, model, languageService) {\n super();\n this.editor = editor;\n this.model = model;\n this.languageService = languageService;\n this.isDisposed = observableValue(this, false);\n this.currentTextModel = observableFromEvent(this.editor.onDidChangeModel, () => /** @description editor.model */ this.editor.getModel());\n this.uiState = derived(this, reader => {\n var _a;\n if (this.isDisposed.read(reader)) {\n return undefined;\n }\n const textModel = this.currentTextModel.read(reader);\n if (textModel !== this.model.targetTextModel.read(reader)) {\n return undefined;\n }\n const ghostText = this.model.ghostText.read(reader);\n if (!ghostText) {\n return undefined;\n }\n let range = (_a = this.model.range) === null || _a === void 0 ? void 0 : _a.read(reader);\n //if range is empty, we want to remove it\n if (range && range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn) {\n range = undefined;\n }\n //check if both range and text are single line - in this case we want to do inline replacement\n //rather than replacing whole lines\n const isSingleLine = (range ? range.startLineNumber === range.endLineNumber : true) && ghostText.parts.length === 1 && ghostText.parts[0].lines.length === 1;\n //check if we're just removing code\n const isPureRemove = ghostText.parts.length === 1 && ghostText.parts[0].lines.every(l => l.length === 0);\n const inlineTexts = [];\n const additionalLines = [];\n function addToAdditionalLines(lines, className) {\n if (additionalLines.length > 0) {\n const lastLine = additionalLines[additionalLines.length - 1];\n if (className) {\n lastLine.decorations.push(new LineDecoration(lastLine.content.length + 1, lastLine.content.length + 1 + lines[0].length, className, 0 /* InlineDecorationType.Regular */));\n }\n lastLine.content += lines[0];\n lines = lines.slice(1);\n }\n for (const line of lines) {\n additionalLines.push({\n content: line,\n decorations: className ? [new LineDecoration(1, line.length + 1, className, 0 /* InlineDecorationType.Regular */)] : []\n });\n }\n }\n const textBufferLine = textModel.getLineContent(ghostText.lineNumber);\n let hiddenTextStartColumn = undefined;\n let lastIdx = 0;\n if (!isPureRemove) {\n for (const part of ghostText.parts) {\n let lines = part.lines;\n //If remove range is set, we want to push all new liens to virtual area\n if (range && !isSingleLine) {\n addToAdditionalLines(lines, INLINE_EDIT_DESCRIPTION);\n lines = [];\n }\n if (hiddenTextStartColumn === undefined) {\n inlineTexts.push({\n column: part.column,\n text: lines[0],\n preview: part.preview,\n });\n lines = lines.slice(1);\n }\n else {\n addToAdditionalLines([textBufferLine.substring(lastIdx, part.column - 1)], undefined);\n }\n if (lines.length > 0) {\n addToAdditionalLines(lines, INLINE_EDIT_DESCRIPTION);\n if (hiddenTextStartColumn === undefined && part.column <= textBufferLine.length) {\n hiddenTextStartColumn = part.column;\n }\n }\n lastIdx = part.column - 1;\n }\n if (hiddenTextStartColumn !== undefined) {\n addToAdditionalLines([textBufferLine.substring(lastIdx)], undefined);\n }\n }\n const hiddenRange = hiddenTextStartColumn !== undefined ? new ColumnRange(hiddenTextStartColumn, textBufferLine.length + 1) : undefined;\n const lineNumber = (isSingleLine || !range) ? ghostText.lineNumber : range.endLineNumber - 1;\n return {\n inlineTexts,\n additionalLines,\n hiddenRange,\n lineNumber,\n additionalReservedLineCount: this.model.minReservedLineCount.read(reader),\n targetTextModel: textModel,\n range,\n isSingleLine,\n isPureRemove,\n backgroundColoring: this.model.backgroundColoring.read(reader)\n };\n });\n this.decorations = derived(this, reader => {\n const uiState = this.uiState.read(reader);\n if (!uiState) {\n return [];\n }\n const decorations = [];\n if (uiState.hiddenRange) {\n decorations.push({\n range: uiState.hiddenRange.toRange(uiState.lineNumber),\n options: { inlineClassName: 'inline-edit-hidden', description: 'inline-edit-hidden', }\n });\n }\n if (uiState.range) {\n const ranges = [];\n if (uiState.isSingleLine) {\n ranges.push(uiState.range);\n }\n else if (uiState.isPureRemove) {\n const lines = uiState.range.endLineNumber - uiState.range.startLineNumber;\n for (let i = 0; i < lines; i++) {\n const line = uiState.range.startLineNumber + i;\n const firstNonWhitespace = uiState.targetTextModel.getLineFirstNonWhitespaceColumn(line);\n const lastNonWhitespace = uiState.targetTextModel.getLineLastNonWhitespaceColumn(line);\n const range = new Range(line, firstNonWhitespace, line, lastNonWhitespace);\n ranges.push(range);\n }\n }\n else {\n const lines = uiState.range.endLineNumber - uiState.range.startLineNumber;\n for (let i = 0; i < lines; i++) {\n const line = uiState.range.startLineNumber + i;\n const firstNonWhitespace = uiState.targetTextModel.getLineFirstNonWhitespaceColumn(line);\n const lastNonWhitespace = uiState.targetTextModel.getLineLastNonWhitespaceColumn(line);\n const range = new Range(line, firstNonWhitespace, line, lastNonWhitespace);\n ranges.push(range);\n }\n }\n const className = uiState.backgroundColoring ? 'inline-edit-remove backgroundColoring' : 'inline-edit-remove';\n for (const range of ranges) {\n decorations.push({\n range,\n options: { inlineClassName: className, description: 'inline-edit-remove', }\n });\n }\n }\n for (const p of uiState.inlineTexts) {\n decorations.push({\n range: Range.fromPositions(new Position(uiState.lineNumber, p.column)),\n options: {\n description: INLINE_EDIT_DESCRIPTION,\n after: { content: p.text, inlineClassName: p.preview ? 'inline-edit-decoration-preview' : 'inline-edit-decoration', cursorStops: InjectedTextCursorStops.Left },\n showIfCollapsed: true,\n }\n });\n }\n return decorations;\n });\n this.additionalLinesWidget = this._register(new AdditionalLinesWidget(this.editor, this.languageService.languageIdCodec, derived(reader => {\n /** @description lines */\n const uiState = this.uiState.read(reader);\n return uiState && !uiState.isPureRemove ? {\n lineNumber: uiState.lineNumber,\n additionalLines: uiState.additionalLines,\n minReservedLineCount: uiState.additionalReservedLineCount,\n targetTextModel: uiState.targetTextModel,\n } : undefined;\n })));\n this._register(toDisposable(() => { this.isDisposed.set(true, undefined); }));\n this._register(applyObservableDecorations(this.editor, this.decorations));\n }\n ownsViewZone(viewZoneId) {\n return this.additionalLinesWidget.viewZoneId === viewZoneId;\n }\n};\nGhostTextWidget = __decorate([\n __param(2, ILanguageService)\n], GhostTextWidget);\nexport { GhostTextWidget };\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nvar InlineEditHintsContentWidget_1;\nimport { h } from '../../../../base/browser/dom.js';\nimport { KeybindingLabel, unthemedKeybindingLabelOptions } from '../../../../base/browser/ui/keybindingLabel/keybindingLabel.js';\nimport { Separator } from '../../../../base/common/actions.js';\nimport { equals } from '../../../../base/common/arrays.js';\nimport { Disposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { autorun, autorunWithStore, derived, observableFromEvent } from '../../../../base/common/observable.js';\nimport { OS } from '../../../../base/common/platform.js';\nimport './inlineEditHintsWidget.css';\nimport { Position } from '../../../common/core/position.js';\nimport { MenuEntryActionViewItem, createAndFillInActionBarActions } from '../../../../platform/actions/browser/menuEntryActionViewItem.js';\nimport { WorkbenchToolBar } from '../../../../platform/actions/browser/toolbar.js';\nimport { IMenuService, MenuId, MenuItemAction } from '../../../../platform/actions/common/actions.js';\nimport { ICommandService } from '../../../../platform/commands/common/commands.js';\nimport { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';\nlet InlineEditHintsWidget = class InlineEditHintsWidget extends Disposable {\n constructor(editor, model, instantiationService) {\n super();\n this.editor = editor;\n this.model = model;\n this.instantiationService = instantiationService;\n this.alwaysShowToolbar = observableFromEvent(this.editor.onDidChangeConfiguration, () => this.editor.getOption(63 /* EditorOption.inlineEdit */).showToolbar === 'always');\n this.sessionPosition = undefined;\n this.position = derived(this, reader => {\n var _a, _b, _c;\n const ghostText = (_a = this.model.read(reader)) === null || _a === void 0 ? void 0 : _a.widget.model.ghostText.read(reader);\n if (!this.alwaysShowToolbar.read(reader) || !ghostText || ghostText.parts.length === 0) {\n this.sessionPosition = undefined;\n return null;\n }\n const firstColumn = ghostText.parts[0].column;\n if (this.sessionPosition && this.sessionPosition.lineNumber !== ghostText.lineNumber) {\n this.sessionPosition = undefined;\n }\n const position = new Position(ghostText.lineNumber, Math.min(firstColumn, (_c = (_b = this.sessionPosition) === null || _b === void 0 ? void 0 : _b.column) !== null && _c !== void 0 ? _c : Number.MAX_SAFE_INTEGER));\n this.sessionPosition = position;\n return position;\n });\n this._register(autorunWithStore((reader, store) => {\n /** @description setup content widget */\n const model = this.model.read(reader);\n if (!model || !this.alwaysShowToolbar.read(reader)) {\n return;\n }\n const contentWidget = store.add(this.instantiationService.createInstance(InlineEditHintsContentWidget, this.editor, true, this.position));\n editor.addContentWidget(contentWidget);\n store.add(toDisposable(() => editor.removeContentWidget(contentWidget)));\n }));\n }\n};\nInlineEditHintsWidget = __decorate([\n __param(2, IInstantiationService)\n], InlineEditHintsWidget);\nexport { InlineEditHintsWidget };\nlet InlineEditHintsContentWidget = InlineEditHintsContentWidget_1 = class InlineEditHintsContentWidget extends Disposable {\n constructor(editor, withBorder, _position, instantiationService, _contextKeyService, _menuService) {\n super();\n this.editor = editor;\n this.withBorder = withBorder;\n this._position = _position;\n this._contextKeyService = _contextKeyService;\n this._menuService = _menuService;\n this.id = `InlineEditHintsContentWidget${InlineEditHintsContentWidget_1.id++}`;\n this.allowEditorOverflow = true;\n this.suppressMouseDown = false;\n this.nodes = h('div.inlineEditHints', { className: this.withBorder ? '.withBorder' : '' }, [\n h('div@toolBar'),\n ]);\n this.inlineCompletionsActionsMenus = this._register(this._menuService.createMenu(MenuId.InlineEditActions, this._contextKeyService));\n this.toolBar = this._register(instantiationService.createInstance(CustomizedMenuWorkbenchToolBar, this.nodes.toolBar, this.editor, MenuId.InlineEditToolbar, {\n menuOptions: { renderShortTitle: true },\n toolbarOptions: { primaryGroup: g => g.startsWith('primary') },\n actionViewItemProvider: (action, options) => {\n if (action instanceof MenuItemAction) {\n return instantiationService.createInstance(StatusBarViewItem, action, undefined);\n }\n return undefined;\n },\n telemetrySource: 'InlineEditToolbar',\n }));\n this._register(this.toolBar.onDidChangeDropdownVisibility(e => {\n InlineEditHintsContentWidget_1._dropDownVisible = e;\n }));\n this._register(autorun(reader => {\n /** @description update position */\n this._position.read(reader);\n this.editor.layoutContentWidget(this);\n }));\n this._register(autorun(reader => {\n /** @description actions menu */\n const extraActions = [];\n for (const [_, group] of this.inlineCompletionsActionsMenus.getActions()) {\n for (const action of group) {\n if (action instanceof MenuItemAction) {\n extraActions.push(action);\n }\n }\n }\n if (extraActions.length > 0) {\n extraActions.unshift(new Separator());\n }\n this.toolBar.setAdditionalSecondaryActions(extraActions);\n }));\n }\n getId() { return this.id; }\n getDomNode() {\n return this.nodes.root;\n }\n getPosition() {\n return {\n position: this._position.get(),\n preference: [1 /* ContentWidgetPositionPreference.ABOVE */, 2 /* ContentWidgetPositionPreference.BELOW */],\n positionAffinity: 3 /* PositionAffinity.LeftOfInjectedText */,\n };\n }\n};\nInlineEditHintsContentWidget._dropDownVisible = false;\nInlineEditHintsContentWidget.id = 0;\nInlineEditHintsContentWidget = InlineEditHintsContentWidget_1 = __decorate([\n __param(3, IInstantiationService),\n __param(4, IContextKeyService),\n __param(5, IMenuService)\n], InlineEditHintsContentWidget);\nexport { InlineEditHintsContentWidget };\nclass StatusBarViewItem extends MenuEntryActionViewItem {\n updateLabel() {\n const kb = this._keybindingService.lookupKeybinding(this._action.id, this._contextKeyService);\n if (!kb) {\n return super.updateLabel();\n }\n if (this.label) {\n const div = h('div.keybinding').root;\n const k = this._register(new KeybindingLabel(div, OS, { disableTitle: true, ...unthemedKeybindingLabelOptions }));\n k.set(kb);\n this.label.textContent = this._action.label;\n this.label.appendChild(div);\n this.label.classList.add('inlineEditStatusBarItemLabel');\n }\n }\n updateTooltip() {\n // NOOP, disable tooltip\n }\n}\nlet CustomizedMenuWorkbenchToolBar = class CustomizedMenuWorkbenchToolBar extends WorkbenchToolBar {\n constructor(container, editor, menuId, options2, menuService, contextKeyService, contextMenuService, keybindingService, commandService, telemetryService) {\n super(container, { resetMenu: menuId, ...options2 }, menuService, contextKeyService, contextMenuService, keybindingService, commandService, telemetryService);\n this.editor = editor;\n this.menuId = menuId;\n this.options2 = options2;\n this.menuService = menuService;\n this.contextKeyService = contextKeyService;\n this.menu = this._store.add(this.menuService.createMenu(this.menuId, this.contextKeyService, { emitEventsForSubmenuChanges: true }));\n this.additionalActions = [];\n this.prependedPrimaryActions = [];\n this._store.add(this.menu.onDidChange(() => this.updateToolbar()));\n this._store.add(this.editor.onDidChangeCursorPosition(() => this.updateToolbar()));\n this.updateToolbar();\n }\n updateToolbar() {\n var _a, _b, _c, _d, _e, _f, _g;\n const primary = [];\n const secondary = [];\n createAndFillInActionBarActions(this.menu, (_a = this.options2) === null || _a === void 0 ? void 0 : _a.menuOptions, { primary, secondary }, (_c = (_b = this.options2) === null || _b === void 0 ? void 0 : _b.toolbarOptions) === null || _c === void 0 ? void 0 : _c.primaryGroup, (_e = (_d = this.options2) === null || _d === void 0 ? void 0 : _d.toolbarOptions) === null || _e === void 0 ? void 0 : _e.shouldInlineSubmenu, (_g = (_f = this.options2) === null || _f === void 0 ? void 0 : _f.toolbarOptions) === null || _g === void 0 ? void 0 : _g.useSeparatorsInPrimaryActions);\n secondary.push(...this.additionalActions);\n primary.unshift(...this.prependedPrimaryActions);\n this.setActions(primary, secondary);\n }\n setAdditionalSecondaryActions(actions) {\n if (equals(this.additionalActions, actions, (a, b) => a === b)) {\n return;\n }\n this.additionalActions = actions;\n this.updateToolbar();\n }\n};\nCustomizedMenuWorkbenchToolBar = __decorate([\n __param(4, IMenuService),\n __param(5, IContextKeyService),\n __param(6, IContextMenuService),\n __param(7, IKeybindingService),\n __param(8, ICommandService),\n __param(9, ITelemetryService)\n], CustomizedMenuWorkbenchToolBar);\nexport { CustomizedMenuWorkbenchToolBar };\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nvar InlineEditController_1;\nimport { Disposable } from '../../../../base/common/lifecycle.js';\nimport { autorun, constObservable, disposableObservableValue, observableFromEvent, observableSignalFromEvent, observableValue, transaction } from '../../../../base/common/observable.js';\nimport { EditOperation } from '../../../common/core/editOperation.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { GhostTextWidget } from './ghostTextWidget.js';\nimport { IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { InlineEditTriggerKind } from '../../../common/languages.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { CancellationTokenSource } from '../../../../base/common/cancellation.js';\nimport { GhostText, GhostTextPart } from '../../inlineCompletions/browser/ghostText.js';\nimport { ICommandService } from '../../../../platform/commands/common/commands.js';\nimport { InlineEditHintsWidget } from './inlineEditHintsWidget.js';\nimport { createStyleSheet2 } from '../../../../base/browser/dom.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\nimport { onUnexpectedExternalError } from '../../../../base/common/errors.js';\nexport class InlineEditWidget {\n constructor(widget, edit) {\n this.widget = widget;\n this.edit = edit;\n }\n dispose() {\n this.widget.dispose();\n }\n}\nlet InlineEditController = InlineEditController_1 = class InlineEditController extends Disposable {\n static get(editor) {\n return editor.getContribution(InlineEditController_1.ID);\n }\n constructor(editor, instantiationService, contextKeyService, languageFeaturesService, _commandService, _configurationService) {\n super();\n this.editor = editor;\n this.instantiationService = instantiationService;\n this.contextKeyService = contextKeyService;\n this.languageFeaturesService = languageFeaturesService;\n this._commandService = _commandService;\n this._configurationService = _configurationService;\n this._isVisibleContext = InlineEditController_1.inlineEditVisibleContext.bindTo(this.contextKeyService);\n this._isCursorAtInlineEditContext = InlineEditController_1.cursorAtInlineEditContext.bindTo(this.contextKeyService);\n this._currentEdit = this._register(disposableObservableValue(this, undefined));\n this._isAccepting = observableValue(this, false);\n this._enabled = observableFromEvent(this.editor.onDidChangeConfiguration, () => this.editor.getOption(63 /* EditorOption.inlineEdit */).enabled);\n this._fontFamily = observableFromEvent(this.editor.onDidChangeConfiguration, () => this.editor.getOption(63 /* EditorOption.inlineEdit */).fontFamily);\n this._backgroundColoring = observableFromEvent(this.editor.onDidChangeConfiguration, () => this.editor.getOption(63 /* EditorOption.inlineEdit */).backgroundColoring);\n //Automatically request inline edit when the content was changed\n //Cancel the previous request if there is one\n //Remove the previous ghost text\n const modelChangedSignal = observableSignalFromEvent('InlineEditController.modelContentChangedSignal', editor.onDidChangeModelContent);\n this._register(autorun(reader => {\n /** @description InlineEditController.modelContentChanged model */\n if (!this._enabled.read(reader)) {\n return;\n }\n modelChangedSignal.read(reader);\n if (this._isAccepting.read(reader)) {\n return;\n }\n this.getInlineEdit(editor, true);\n }));\n //Check if the cursor is at the ghost text\n const cursorPosition = observableFromEvent(editor.onDidChangeCursorPosition, () => editor.getPosition());\n this._register(autorun(reader => {\n /** @description InlineEditController.cursorPositionChanged model */\n if (!this._enabled.read(reader)) {\n return;\n }\n const pos = cursorPosition.read(reader);\n if (pos) {\n this.checkCursorPosition(pos);\n }\n }));\n //Perform stuff when the current edit has changed\n this._register(autorun((reader) => {\n /** @description InlineEditController.update model */\n const currentEdit = this._currentEdit.read(reader);\n this._isCursorAtInlineEditContext.set(false);\n if (!currentEdit) {\n this._isVisibleContext.set(false);\n return;\n }\n this._isVisibleContext.set(true);\n const pos = editor.getPosition();\n if (pos) {\n this.checkCursorPosition(pos);\n }\n }));\n //Clear suggestions on lost focus\n const editorBlurSingal = observableSignalFromEvent('InlineEditController.editorBlurSignal', editor.onDidBlurEditorWidget);\n this._register(autorun(async (reader) => {\n var _a;\n /** @description InlineEditController.editorBlur */\n if (!this._enabled.read(reader)) {\n return;\n }\n editorBlurSingal.read(reader);\n // This is a hidden setting very useful for debugging\n if (this._configurationService.getValue('editor.experimentalInlineEdit.keepOnBlur') || editor.getOption(63 /* EditorOption.inlineEdit */).keepOnBlur) {\n return;\n }\n (_a = this._currentRequestCts) === null || _a === void 0 ? void 0 : _a.dispose(true);\n this._currentRequestCts = undefined;\n await this.clear(false);\n }));\n //Invoke provider on focus\n const editorFocusSignal = observableSignalFromEvent('InlineEditController.editorFocusSignal', editor.onDidFocusEditorText);\n this._register(autorun(reader => {\n /** @description InlineEditController.editorFocus */\n if (!this._enabled.read(reader)) {\n return;\n }\n editorFocusSignal.read(reader);\n this.getInlineEdit(editor, true);\n }));\n //handle changes of font setting\n const styleElement = this._register(createStyleSheet2());\n this._register(autorun(reader => {\n const fontFamily = this._fontFamily.read(reader);\n styleElement.setStyle(fontFamily === '' || fontFamily === 'default' ? `` : `\n.monaco-editor .inline-edit-decoration,\n.monaco-editor .inline-edit-decoration-preview,\n.monaco-editor .inline-edit {\n\tfont-family: ${fontFamily};\n}`);\n }));\n this._register(new InlineEditHintsWidget(this.editor, this._currentEdit, this.instantiationService));\n }\n checkCursorPosition(position) {\n var _a;\n if (!this._currentEdit) {\n this._isCursorAtInlineEditContext.set(false);\n return;\n }\n const gt = (_a = this._currentEdit.get()) === null || _a === void 0 ? void 0 : _a.edit;\n if (!gt) {\n this._isCursorAtInlineEditContext.set(false);\n return;\n }\n this._isCursorAtInlineEditContext.set(Range.containsPosition(gt.range, position));\n }\n validateInlineEdit(editor, edit) {\n var _a, _b;\n //Multiline inline replacing edit must replace whole lines\n if (edit.text.includes('\\n') && edit.range.startLineNumber !== edit.range.endLineNumber && edit.range.startColumn !== edit.range.endColumn) {\n const firstColumn = edit.range.startColumn;\n if (firstColumn !== 1) {\n return false;\n }\n const lastLine = edit.range.endLineNumber;\n const lastColumn = edit.range.endColumn;\n const lineLength = (_b = (_a = editor.getModel()) === null || _a === void 0 ? void 0 : _a.getLineLength(lastLine)) !== null && _b !== void 0 ? _b : 0;\n if (lastColumn !== lineLength + 1) {\n return false;\n }\n }\n return true;\n }\n async fetchInlineEdit(editor, auto) {\n if (this._currentRequestCts) {\n this._currentRequestCts.dispose(true);\n }\n const model = editor.getModel();\n if (!model) {\n return;\n }\n const modelVersion = model.getVersionId();\n const providers = this.languageFeaturesService.inlineEditProvider.all(model);\n if (providers.length === 0) {\n return;\n }\n const provider = providers[0];\n this._currentRequestCts = new CancellationTokenSource();\n const token = this._currentRequestCts.token;\n const triggerKind = auto ? InlineEditTriggerKind.Automatic : InlineEditTriggerKind.Invoke;\n const shouldDebounce = auto;\n if (shouldDebounce) {\n await wait(50, token);\n }\n if (token.isCancellationRequested || model.isDisposed() || model.getVersionId() !== modelVersion) {\n return;\n }\n const edit = await provider.provideInlineEdit(model, { triggerKind }, token);\n if (!edit) {\n return;\n }\n if (token.isCancellationRequested || model.isDisposed() || model.getVersionId() !== modelVersion) {\n return;\n }\n if (!this.validateInlineEdit(editor, edit)) {\n return;\n }\n return edit;\n }\n async getInlineEdit(editor, auto) {\n var _a;\n this._isCursorAtInlineEditContext.set(false);\n await this.clear();\n const edit = await this.fetchInlineEdit(editor, auto);\n if (!edit) {\n return;\n }\n const line = edit.range.endLineNumber;\n const column = edit.range.endColumn;\n const textToDisplay = edit.text.endsWith('\\n') && !(edit.range.startLineNumber === edit.range.endLineNumber && edit.range.startColumn === edit.range.endColumn) ? edit.text.slice(0, -1) : edit.text;\n const ghostText = new GhostText(line, [new GhostTextPart(column, textToDisplay, false)]);\n const instance = this.instantiationService.createInstance(GhostTextWidget, this.editor, {\n ghostText: constObservable(ghostText),\n minReservedLineCount: constObservable(0),\n targetTextModel: constObservable((_a = this.editor.getModel()) !== null && _a !== void 0 ? _a : undefined),\n range: constObservable(edit.range),\n backgroundColoring: this._backgroundColoring\n });\n this._currentEdit.set(new InlineEditWidget(instance, edit), undefined);\n }\n async trigger() {\n await this.getInlineEdit(this.editor, false);\n }\n async jumpBack() {\n if (!this._jumpBackPosition) {\n return;\n }\n this.editor.setPosition(this._jumpBackPosition);\n //if position is outside viewports, scroll to it\n this.editor.revealPositionInCenterIfOutsideViewport(this._jumpBackPosition);\n }\n async accept() {\n var _a;\n this._isAccepting.set(true, undefined);\n const data = (_a = this._currentEdit.get()) === null || _a === void 0 ? void 0 : _a.edit;\n if (!data) {\n return;\n }\n //It should only happen in case of last line suggestion\n let text = data.text;\n if (data.text.startsWith('\\n')) {\n text = data.text.substring(1);\n }\n this.editor.pushUndoStop();\n this.editor.executeEdits('acceptCurrent', [EditOperation.replace(Range.lift(data.range), text)]);\n if (data.accepted) {\n await this._commandService\n .executeCommand(data.accepted.id, ...(data.accepted.arguments || []))\n .then(undefined, onUnexpectedExternalError);\n }\n this.freeEdit(data);\n transaction((tx) => {\n this._currentEdit.set(undefined, tx);\n this._isAccepting.set(false, tx);\n });\n }\n jumpToCurrent() {\n var _a, _b;\n this._jumpBackPosition = (_a = this.editor.getSelection()) === null || _a === void 0 ? void 0 : _a.getStartPosition();\n const data = (_b = this._currentEdit.get()) === null || _b === void 0 ? void 0 : _b.edit;\n if (!data) {\n return;\n }\n const position = Position.lift({ lineNumber: data.range.startLineNumber, column: data.range.startColumn });\n this.editor.setPosition(position);\n //if position is outside viewports, scroll to it\n this.editor.revealPositionInCenterIfOutsideViewport(position);\n }\n async clear(sendRejection = true) {\n var _a;\n const edit = (_a = this._currentEdit.get()) === null || _a === void 0 ? void 0 : _a.edit;\n if (edit && (edit === null || edit === void 0 ? void 0 : edit.rejected) && sendRejection) {\n await this._commandService\n .executeCommand(edit.rejected.id, ...(edit.rejected.arguments || []))\n .then(undefined, onUnexpectedExternalError);\n }\n if (edit) {\n this.freeEdit(edit);\n }\n this._currentEdit.set(undefined, undefined);\n }\n freeEdit(edit) {\n const model = this.editor.getModel();\n if (!model) {\n return;\n }\n const providers = this.languageFeaturesService.inlineEditProvider.all(model);\n if (providers.length === 0) {\n return;\n }\n providers[0].freeInlineEdit(edit);\n }\n shouldShowHoverAt(range) {\n const currentEdit = this._currentEdit.get();\n if (!currentEdit) {\n return false;\n }\n const edit = currentEdit.edit;\n const model = currentEdit.widget.model;\n const overReplaceRange = Range.containsPosition(edit.range, range.getStartPosition()) || Range.containsPosition(edit.range, range.getEndPosition());\n if (overReplaceRange) {\n return true;\n }\n const ghostText = model.ghostText.get();\n if (ghostText) {\n return ghostText.parts.some(p => range.containsPosition(new Position(ghostText.lineNumber, p.column)));\n }\n return false;\n }\n shouldShowHoverAtViewZone(viewZoneId) {\n var _a, _b;\n return (_b = (_a = this._currentEdit.get()) === null || _a === void 0 ? void 0 : _a.widget.ownsViewZone(viewZoneId)) !== null && _b !== void 0 ? _b : false;\n }\n};\nInlineEditController.ID = 'editor.contrib.inlineEditController';\nInlineEditController.inlineEditVisibleKey = 'inlineEditVisible';\nInlineEditController.inlineEditVisibleContext = new RawContextKey(InlineEditController_1.inlineEditVisibleKey, false);\nInlineEditController.cursorAtInlineEditKey = 'cursorAtInlineEdit';\nInlineEditController.cursorAtInlineEditContext = new RawContextKey(InlineEditController_1.cursorAtInlineEditKey, false);\nInlineEditController = InlineEditController_1 = __decorate([\n __param(1, IInstantiationService),\n __param(2, IContextKeyService),\n __param(3, ILanguageFeaturesService),\n __param(4, ICommandService),\n __param(5, IConfigurationService)\n], InlineEditController);\nexport { InlineEditController };\nfunction wait(ms, cancellationToken) {\n return new Promise(resolve => {\n let d = undefined;\n const handle = setTimeout(() => {\n if (d) {\n d.dispose();\n }\n resolve();\n }, ms);\n if (cancellationToken) {\n d = cancellationToken.onCancellationRequested(() => {\n clearTimeout(handle);\n if (d) {\n d.dispose();\n }\n resolve();\n });\n }\n });\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { EditorAction } from '../../../browser/editorExtensions.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { inlineEditAcceptId, inlineEditJumpBackId, inlineEditJumpToId, inlineEditRejectId } from './commandIds.js';\nimport { InlineEditController } from './inlineEditController.js';\nimport { MenuId } from '../../../../platform/actions/common/actions.js';\nimport { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js';\nexport class AcceptInlineEdit extends EditorAction {\n constructor() {\n super({\n id: inlineEditAcceptId,\n label: 'Accept Inline Edit',\n alias: 'Accept Inline Edit',\n precondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineEditController.inlineEditVisibleContext),\n kbOpts: [\n {\n weight: 100 /* KeybindingWeight.EditorContrib */ + 1,\n primary: 2 /* KeyCode.Tab */,\n kbExpr: ContextKeyExpr.and(EditorContextKeys.writable, InlineEditController.inlineEditVisibleContext, InlineEditController.cursorAtInlineEditContext)\n }\n ],\n menuOpts: [{\n menuId: MenuId.InlineEditToolbar,\n title: 'Accept',\n group: 'primary',\n order: 1,\n }],\n });\n }\n async run(accessor, editor) {\n const controller = InlineEditController.get(editor);\n await (controller === null || controller === void 0 ? void 0 : controller.accept());\n }\n}\nexport class TriggerInlineEdit extends EditorAction {\n constructor() {\n const activeExpr = ContextKeyExpr.and(EditorContextKeys.writable, ContextKeyExpr.not(InlineEditController.inlineEditVisibleKey));\n super({\n id: 'editor.action.inlineEdit.trigger',\n label: 'Trigger Inline Edit',\n alias: 'Trigger Inline Edit',\n precondition: activeExpr,\n kbOpts: {\n weight: 100 /* KeybindingWeight.EditorContrib */ + 1,\n primary: 2048 /* KeyMod.CtrlCmd */ | 512 /* KeyMod.Alt */ | 86 /* KeyCode.Equal */,\n kbExpr: activeExpr\n },\n });\n }\n async run(accessor, editor) {\n const controller = InlineEditController.get(editor);\n controller === null || controller === void 0 ? void 0 : controller.trigger();\n }\n}\nexport class JumpToInlineEdit extends EditorAction {\n constructor() {\n const activeExpr = ContextKeyExpr.and(EditorContextKeys.writable, InlineEditController.inlineEditVisibleContext, ContextKeyExpr.not(InlineEditController.cursorAtInlineEditKey));\n super({\n id: inlineEditJumpToId,\n label: 'Jump to Inline Edit',\n alias: 'Jump to Inline Edit',\n precondition: activeExpr,\n kbOpts: {\n weight: 100 /* KeybindingWeight.EditorContrib */ + 1,\n primary: 2048 /* KeyMod.CtrlCmd */ | 512 /* KeyMod.Alt */ | 86 /* KeyCode.Equal */,\n kbExpr: activeExpr\n },\n menuOpts: [{\n menuId: MenuId.InlineEditToolbar,\n title: 'Jump To Edit',\n group: 'primary',\n order: 3,\n when: activeExpr\n }],\n });\n }\n async run(accessor, editor) {\n const controller = InlineEditController.get(editor);\n controller === null || controller === void 0 ? void 0 : controller.jumpToCurrent();\n }\n}\nexport class JumpBackInlineEdit extends EditorAction {\n constructor() {\n const activeExpr = ContextKeyExpr.and(EditorContextKeys.writable, InlineEditController.cursorAtInlineEditContext);\n super({\n id: inlineEditJumpBackId,\n label: 'Jump Back from Inline Edit',\n alias: 'Jump Back from Inline Edit',\n precondition: activeExpr,\n kbOpts: {\n weight: 100 /* KeybindingWeight.EditorContrib */ + 10,\n primary: 2048 /* KeyMod.CtrlCmd */ | 512 /* KeyMod.Alt */ | 86 /* KeyCode.Equal */,\n kbExpr: activeExpr\n },\n menuOpts: [{\n menuId: MenuId.InlineEditToolbar,\n title: 'Jump Back',\n group: 'primary',\n order: 3,\n when: activeExpr\n }],\n });\n }\n async run(accessor, editor) {\n const controller = InlineEditController.get(editor);\n controller === null || controller === void 0 ? void 0 : controller.jumpBack();\n }\n}\nexport class RejectInlineEdit extends EditorAction {\n constructor() {\n const activeExpr = ContextKeyExpr.and(EditorContextKeys.writable, InlineEditController.inlineEditVisibleContext);\n super({\n id: inlineEditRejectId,\n label: 'Reject Inline Edit',\n alias: 'Reject Inline Edit',\n precondition: activeExpr,\n kbOpts: {\n weight: 100 /* KeybindingWeight.EditorContrib */,\n primary: 9 /* KeyCode.Escape */,\n kbExpr: activeExpr\n },\n menuOpts: [{\n menuId: MenuId.InlineEditToolbar,\n title: 'Reject',\n group: 'secondary',\n order: 2,\n }],\n });\n }\n async run(accessor, editor) {\n const controller = InlineEditController.get(editor);\n await (controller === null || controller === void 0 ? void 0 : controller.clear());\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport const inlineEditAcceptId = 'editor.action.inlineEdit.accept';\nexport const inlineEditRejectId = 'editor.action.inlineEdit.reject';\nexport const inlineEditJumpToId = 'editor.action.inlineEdit.jumpTo';\nexport const inlineEditJumpBackId = 'editor.action.inlineEdit.jumpBack';\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nimport { DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { constObservable } from '../../../../base/common/observable.js';\nimport { HoverForeignElementAnchor } from '../../hover/browser/hoverTypes.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';\nimport { InlineEditController } from './inlineEditController.js';\nimport { InlineEditHintsContentWidget } from './inlineEditHintsWidget.js';\nexport class InlineEditHover {\n constructor(owner, range, controller) {\n this.owner = owner;\n this.range = range;\n this.controller = controller;\n }\n isValidForHoverAnchor(anchor) {\n return (anchor.type === 1 /* HoverAnchorType.Range */\n && this.range.startColumn <= anchor.range.startColumn\n && this.range.endColumn >= anchor.range.endColumn);\n }\n}\nlet InlineEditHoverParticipant = class InlineEditHoverParticipant {\n constructor(_editor, _instantiationService, _telemetryService) {\n this._editor = _editor;\n this._instantiationService = _instantiationService;\n this._telemetryService = _telemetryService;\n this.hoverOrdinal = 5;\n }\n suggestHoverAnchor(mouseEvent) {\n const controller = InlineEditController.get(this._editor);\n if (!controller) {\n return null;\n }\n const target = mouseEvent.target;\n if (target.type === 8 /* MouseTargetType.CONTENT_VIEW_ZONE */) {\n // handle the case where the mouse is over the view zone\n const viewZoneData = target.detail;\n if (controller.shouldShowHoverAtViewZone(viewZoneData.viewZoneId)) {\n // const range = Range.fromPositions(this._editor.getModel()!.validatePosition(viewZoneData.positionBefore || viewZoneData.position));\n const range = target.range;\n return new HoverForeignElementAnchor(1000, this, range, mouseEvent.event.posx, mouseEvent.event.posy, false);\n }\n }\n if (target.type === 7 /* MouseTargetType.CONTENT_EMPTY */) {\n // handle the case where the mouse is over the empty portion of a line following ghost text\n if (controller.shouldShowHoverAt(target.range)) {\n return new HoverForeignElementAnchor(1000, this, target.range, mouseEvent.event.posx, mouseEvent.event.posy, false);\n }\n }\n if (target.type === 6 /* MouseTargetType.CONTENT_TEXT */) {\n // handle the case where the mouse is directly over ghost text\n const mightBeForeignElement = target.detail.mightBeForeignElement;\n if (mightBeForeignElement && controller.shouldShowHoverAt(target.range)) {\n return new HoverForeignElementAnchor(1000, this, target.range, mouseEvent.event.posx, mouseEvent.event.posy, false);\n }\n }\n return null;\n }\n computeSync(anchor, lineDecorations) {\n if (this._editor.getOption(63 /* EditorOption.inlineEdit */).showToolbar !== 'onHover') {\n return [];\n }\n const controller = InlineEditController.get(this._editor);\n if (controller && controller.shouldShowHoverAt(anchor.range)) {\n return [new InlineEditHover(this, anchor.range, controller)];\n }\n return [];\n }\n renderHoverParts(context, hoverParts) {\n const disposableStore = new DisposableStore();\n this._telemetryService.publicLog2('inlineEditHover.shown');\n const w = this._instantiationService.createInstance(InlineEditHintsContentWidget, this._editor, false, constObservable(null));\n context.fragment.appendChild(w.getDomNode());\n disposableStore.add(w);\n return disposableStore;\n }\n};\nInlineEditHoverParticipant = __decorate([\n __param(1, IInstantiationService),\n __param(2, ITelemetryService)\n], InlineEditHoverParticipant);\nexport { InlineEditHoverParticipant };\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { registerEditorAction, registerEditorContribution } from '../../../browser/editorExtensions.js';\nimport { HoverParticipantRegistry } from '../../hover/browser/hoverTypes.js';\nimport { AcceptInlineEdit, JumpBackInlineEdit, JumpToInlineEdit, RejectInlineEdit, TriggerInlineEdit } from './commands.js';\nimport { InlineEditHoverParticipant } from './hoverParticipant.js';\nimport { InlineEditController } from './inlineEditController.js';\nregisterEditorAction(AcceptInlineEdit);\nregisterEditorAction(RejectInlineEdit);\nregisterEditorAction(JumpToInlineEdit);\nregisterEditorAction(JumpBackInlineEdit);\nregisterEditorAction(TriggerInlineEdit);\nregisterEditorContribution(InlineEditController.ID, InlineEditController, 3 /* EditorContributionInstantiation.Eventually */);\nHoverParticipantRegistry.register(InlineEditHoverParticipant);\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nimport * as dom from '../../../../base/browser/dom.js';\nimport { disposableTimeout } from '../../../../base/common/async.js';\nimport { Codicon } from '../../../../base/common/codicons.js';\nimport { Disposable, MutableDisposable } from '../../../../base/common/lifecycle.js';\nimport { noBreakWhitespace } from '../../../../base/common/strings.js';\nimport { ThemeIcon } from '../../../../base/common/themables.js';\nimport './inlineProgressWidget.css';\nimport { Range } from '../../../common/core/range.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nconst inlineProgressDecoration = ModelDecorationOptions.register({\n description: 'inline-progress-widget',\n stickiness: 1 /* TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges */,\n showIfCollapsed: true,\n after: {\n content: noBreakWhitespace,\n inlineClassName: 'inline-editor-progress-decoration',\n inlineClassNameAffectsLetterSpacing: true,\n }\n});\nclass InlineProgressWidget extends Disposable {\n constructor(typeId, editor, range, title, delegate) {\n super();\n this.typeId = typeId;\n this.editor = editor;\n this.range = range;\n this.delegate = delegate;\n this.allowEditorOverflow = false;\n this.suppressMouseDown = true;\n this.create(title);\n this.editor.addContentWidget(this);\n this.editor.layoutContentWidget(this);\n }\n create(title) {\n this.domNode = dom.$('.inline-progress-widget');\n this.domNode.role = 'button';\n this.domNode.title = title;\n const iconElement = dom.$('span.icon');\n this.domNode.append(iconElement);\n iconElement.classList.add(...ThemeIcon.asClassNameArray(Codicon.loading), 'codicon-modifier-spin');\n const updateSize = () => {\n const lineHeight = this.editor.getOption(67 /* EditorOption.lineHeight */);\n this.domNode.style.height = `${lineHeight}px`;\n this.domNode.style.width = `${Math.ceil(0.8 * lineHeight)}px`;\n };\n updateSize();\n this._register(this.editor.onDidChangeConfiguration(c => {\n if (c.hasChanged(52 /* EditorOption.fontSize */) || c.hasChanged(67 /* EditorOption.lineHeight */)) {\n updateSize();\n }\n }));\n this._register(dom.addDisposableListener(this.domNode, dom.EventType.CLICK, e => {\n this.delegate.cancel();\n }));\n }\n getId() {\n return InlineProgressWidget.baseId + '.' + this.typeId;\n }\n getDomNode() {\n return this.domNode;\n }\n getPosition() {\n return {\n position: { lineNumber: this.range.startLineNumber, column: this.range.startColumn },\n preference: [0 /* ContentWidgetPositionPreference.EXACT */]\n };\n }\n dispose() {\n super.dispose();\n this.editor.removeContentWidget(this);\n }\n}\nInlineProgressWidget.baseId = 'editor.widget.inlineProgressWidget';\nlet InlineProgressManager = class InlineProgressManager extends Disposable {\n constructor(id, _editor, _instantiationService) {\n super();\n this.id = id;\n this._editor = _editor;\n this._instantiationService = _instantiationService;\n /** Delay before showing the progress widget */\n this._showDelay = 500; // ms\n this._showPromise = this._register(new MutableDisposable());\n this._currentWidget = new MutableDisposable();\n this._operationIdPool = 0;\n this._currentDecorations = _editor.createDecorationsCollection();\n }\n async showWhile(position, title, promise) {\n const operationId = this._operationIdPool++;\n this._currentOperation = operationId;\n this.clear();\n this._showPromise.value = disposableTimeout(() => {\n const range = Range.fromPositions(position);\n const decorationIds = this._currentDecorations.set([{\n range: range,\n options: inlineProgressDecoration,\n }]);\n if (decorationIds.length > 0) {\n this._currentWidget.value = this._instantiationService.createInstance(InlineProgressWidget, this.id, this._editor, range, title, promise);\n }\n }, this._showDelay);\n try {\n return await promise;\n }\n finally {\n if (this._currentOperation === operationId) {\n this.clear();\n this._currentOperation = undefined;\n }\n }\n }\n clear() {\n this._showPromise.clear();\n this._currentDecorations.clear();\n this._currentWidget.clear();\n }\n};\nInlineProgressManager = __decorate([\n __param(2, IInstantiationService)\n], InlineProgressManager);\nexport { InlineProgressManager };\n"],"names":["inlineSuggestCommitId","showPreviousInlineSuggestionActionId","showNextInlineSuggestionActionId","GhostText","constructor","lineNumber","parts","this","equals","other","length","every","part","index","renderForScreenReader","lineText","lastPart","cappedLineText","substr","column","map","p","lines","join","applyToString","substring","isEmpty","lineCount","reduce","r","GhostTextPart","text","preview","line","GhostTextReplacement","columnRange","additionalReservedLineCount","endColumnExclusive","newLines","_lineText","ghostTextsOrReplacementsEqual","a","b","ghostTextOrReplacementEquals","__decorate","decorators","target","key","desc","d","c","arguments","Object","getOwnPropertyDescriptor","Reflect","decorate","i","defineProperty","__param","paramIndex","decorator","GHOST_TEXT_DESCRIPTION","GhostTextWidget","editor","model","languageService","super","isDisposed","currentTextModel","onDidChangeModel","getModel","uiState","reader","read","textModel","targetTextModel","ghostText","replacedRange","undefined","inlineTexts","additionalLines","addToAdditionalLines","className","lastLine","decorations","push","content","slice","textBufferLine","getLineContent","hiddenTextStartColumn","lastIdx","hiddenRange","minReservedLineCount","range","toRange","options","inlineClassName","description","after","cursorStops","showIfCollapsed","additionalLinesWidget","_register","AdditionalLinesWidget","languageIdCodec","set","ownsViewZone","viewZoneId","_viewZoneId","editorOptionsChanged","onDidChangeConfiguration","e","hasChanged","updateLines","clear","dispose","changeViewZones","changeAccessor","removeZone","tabSize","getOptions","heightInLines","Math","max","domNode","document","createElement","opts","disableMonospaceOptimizations","get","stopRenderingLineAfter","renderWhitespace","renderControlCharacters","fontLigatures","fontInfo","lineHeight","sb","appendString","len","lineData","String","isBasicASCII","containsRTL","lineTokens","isMonospace","canUseHalfwidthRightwardsArrow","spaceWidth","middotWidth","wsmiddotWidth","html","build","trustedhtml","ttPolicy","createHTML","innerHTML","renderLines","addZone","afterLineNumber","afterColumnAffinity","value","InlineCompletionContextKeys","contextKeyService","inlineCompletionVisible","inlineSuggestionVisible","bindTo","inlineCompletionSuggestsIndentation","inlineSuggestionHasIndentation","inlineCompletionSuggestsIndentationLessThanTabSize","inlineSuggestionHasIndentationLessThanTabSize","suppressSuggestions","state","isInlineCompletionVisible","inlineCompletion","primaryGhostText","source","inlineCompletions","startsWithIndentation","startsWithIndentationLessThanTabSize","selectedSuggestItem","firstLine","getLineIndentColumn","firstNonWsIdx","async","provideInlineCompletions","registry","position","context","token","languageConfigurationService","defaultReplaceRange","word","getWordAtPosition","maxColumn","getLineMaxColumn","startColumn","with","getDefaultRange","providers","all","multiMap","provider","groupId","add","getPreferredProviders","yieldsToGroupIds","result","states","Map","seen","Set","findPreferredProviderCircle","stack","has","preferred","delete","processProvider","circle","Error","s","toString","deferredPromise","items","then","complete","error","providerResults","Promise","completions","itemsByHash","lists","list","InlineCompletionList","item","inlineCompletionItem","InlineCompletionItem","from","hash","InlineCompletionProviderResult","Array","values","keys","hashs","removeRef","refCount","addRef","freeInlineCompletions","insertText","snippetInfo","completeBracketPairs","closeBrackets","getStartPosition","diff","startLineNumber","endLineNumber","endColumn","preBracketCompletionLength","snippet","parse","children","assert","command","additionalTextEdits","filterText","sourceInlineCompletion","replace","withRange","updatedRange","JSON","stringify","newLine","newTokens","tokenization","tokenizeLineWithEdit","slicedTokens","sliceAndInflate","fixBrackets","singleTextRemoveCommonPrefix","edit","validModelRange","modelRange","intersectRanges","valueToReplace","getValueInRange","commonPrefixLen","start","addToPosition","getEndPosition","singleTextEditAugments","base","startsWith","extendingRange","rangeToExtend","isBeforeOrEqual","computeGhostText","mode","cursorPosition","previewSuffixLength","sourceLine","sourceIndentationLength","suggestionAddedIndentationLength","replacedIndentation","startPosition","endPosition","newStartPosition","delta","rangeThatDoesNotReplaceIndentation","suggestionWithoutIndentationChange","valueToBeReplaced","changes","originalValue","newValue","lastRequest","smartDiff","deletedChars","deletedCharacters","newChanges","cachingDiff","filteredChanges","filter","originalLength","originalStart","previewStartInCompletionText","insertColumn","modifiedLength","modifiedEnd","modifiedStart","nonPreviewTextEnd","min","nonPreviewText","italicText","sum","smartBracketMatching","getMaxCharCode","val","maxCharCode","charCode","charCodeAt","getUniqueCharCode","id","getElements","level","group","characters","Int32Array","elements1","elements2","ComputeDiff","InlineCompletionsSource","versionId","_debounceValue","languageFeaturesService","_updateOperation","suggestWidgetInlineCompletions","onDidChangeContent","fetch","activeInlineCompletion","_a","_b","request","UpdateRequest","getVersionId","selectedSuggestionInfo","satisfies","promise","resolve","updateOngoing","ms","cancellationToken","triggerKind","handle","setTimeout","onCancellationRequested","clearTimeout","isCancellationRequested","startTime","Date","updatedCompletions","inlineCompletionsProvider","endTime","update","getTime","UpToDateInlineCompletions","asInlineCompletion","toInlineCompletion","canBeReused","prepend","tx","updateOperation","UpdateOperation","clearSuggestWidgetInlineCompletions","cancelUpdate","cancellationTokenSource","cancel","_inlineCompletions","inlineCompletionProviderResult","_textModel","_versionId","_refCount","_prependedInlineCompletionItems","ids","deltaDecorations","InlineCompletionWithUpdatedRange","clone","decorationId","addRefToSource","unshift","forwardStable","enableForwardStability","_modelVersion","semanticId","_updatedRange","owner","equalsFn","getDecorationRange","emptyRange","toSingleTextEdit","isVisible","minimizedReplacement","_toFilterTextReplacement","cursorPosIndex","filterTextBefore","filterTextAfter","originalValueBefore","originalValueAfter","originalValueIndent","trimStart","containsPosition","isGreaterThanOrEqualTo","VersionIdChangeReason","InlineCompletionsModel","isAcceptingPartially","_isAcceptingPartially","textModelVersionId","_positions","_suggestPreviewEnabled","_suggestPreviewMode","_inlineSuggestMode","_enabled","_instantiationService","_commandService","_languageConfigurationService","lastItem","_source","createInstance","_isActive","observable","_forceUpdateExplicitlySignal","_selectedInlineCompletionId","_primaryPosition","_preserveCurrentCompletionReasons","Redo","Undo","AcceptWord","_fetchInlineCompletionsPromise","createEmptyChangeSummary","preserveCurrentCompletion","inlineCompletionTriggerKind","handleChange","ctx","changeSummary","didChange","change","suggestItem","toSelectedSuggestionInfo","itemToPreserveCandidate","selectedInlineCompletion","itemToPreserve","_filteredInlineCompletionItems","filteredCompletions","selectedInlineCompletionIndex","selectedInlineCompletionId","idx","findIndex","v","activeCommands","commands","lastTriggerKind","inlineCompletionsCount","ghostTexts","suggestCompletionEdit","augmentation","_computeAugmentation","fullEdit","fullEditPreviewLength","positions","edits","getSecondaryEdits","completion","replacement","src","handleItemDidShow","call","trigger","triggerExplicitly","stop","suggestCompletion","candidateInlineCompletions","_deltaSelectedInlineCompletionIndex","newIdx","next","previous","accept","pushUndoStop","executeEdits","setPosition","insert","undoStopBefore","selections","getEndPositionsAfterApplying","setSelections","executeCommand","acceptNextWord","_acceptNext","pos","langId","getLanguageIdAtPosition","config","getLanguageConfiguration","wordRegExp","RegExp","wordDefinition","flags","m1","match","acceptUntilIndexExclusive","m2","exec","acceptNextLine","m","getAcceptUntilIndex","kind","firstPart","ghostTextPos","ghostTextVal","partialGhostTextVal","replaceRange","newText","primaryEdit","revealPositionInCenterIfOutsideViewport","getPosition","handlePartialAccept","acceptedRange","handleSuggestAccepted","itemEdit","augmentedCompletion","primaryPosition","secondaryPositions","primaryEditStartPosition","primaryEditEndPosition","replacedTextAfterPrimaryCursor","positionWithinTextEdit","secondaryEditText","subtext","substringPos","posEnd","textAfterSecondaryCursor","l","sortPerm","edit1","edit2","sortedNewRanges","apply","getNewRanges","inverse","SuggestWidgetAdaptor","selectedItem","_selectedItem","suggestControllerPreselector","checkModelVersion","onWillAccept","isSuggestWidgetVisible","isShiftKeyPressed","_currentSuggestItemInfo","onKeyDown","shiftKey","onKeyUp","suggestController","registerSelector","priority","select","suggestItems","itemToPreselect","candidates","suggestItemTextEdit","SuggestItemInfo","fromSuggestion","valid","prefixLength","isBoundToSuggestWidget","bindToSuggestWidget","widget","onDidShow","onDidHide","onDidFocus","onDidTrigger","onWillInsertSuggestItem","suggestItemInfo","newActive","newInlineCompletion","getSuggestItemInfo","suggestItemInfoEquals","focusedItem","getFocusedItem","stopForceRenderingAbove","forceRenderingAbove","toggleMode","isSnippetText","insertTextRules","info","getOverwriteInfo","overwriteBefore","overwriteAfter","completionItemKind","equalsRange","InlineCompletionsController_1","InlineCompletionsController","getContribution","ID","_contextKeyService","_configurationService","_debounceService","_languageFeaturesService","_accessibilitySignalService","_keybindingService","_accessibilityService","_textModelVersionId","_suggestWidgetAdaptor","updateObservables","Other","_enabledInConfig","getOption","enabled","_isScreenReaderEnabled","onDidChangeScreenReaderOptimized","isScreenReaderOptimized","_editorDictationInProgress","onDidChangeContext","getContext","getDomNode","getValue","_fontFamily","fontFamily","_ghostTexts","_stablizedGhostTexts","store","innerObservables","itemsValue","forEach","o","convertItemsToStableObservables","_store","_ghostTextWidgets","recomputeInitiallyAndOnChange","for","_playAccessibilitySignal","_isReadonly","_textModelIfWritable","previewMode","styleElement","setStyle","getReason","isUndoing","isRedoing","onDidChangeModelContent","onDidChangeCursorPosition","reason","onDidType","onDidExecuteCommand","commandId","hasTextFocus","onDidBlurEditorWidget","getContextKeyValue","keepOnBlur","cancellationStore","lastInlineCompletionId","_","playSignal","provideScreenReaderUpdate","affectsConfiguration","updateOptions","inlineCompletionsAccessibilityVerbose","playAccessibilitySignal","accessibleViewShowing","accessibleViewKeybinding","lookupKeybinding","hint","getAriaLabel","changeReason","_c","newModel","getSelections","selection","shouldShowHoverAt","some","shouldShowHoverAtViewZone","ShowNextInlineSuggestionAction","label","nls","alias","precondition","kbOpts","weight","primary","run","accessor","controller","ShowPreviousInlineSuggestionAction","TriggerInlineSuggestionAction","AcceptNextWordOfInlineCompletion","kbExpr","menuOpts","menuId","title","order","AcceptNextLineOfInlineCompletion","AcceptInlineCompletion","focus","HideInlineCompletion","ToggleAlwaysShowInlineSuggestionToolbar","f1","menu","toggled","configService","updateValue","InlineCompletionsHover","isValidForHoverAnchor","anchor","type","InlineCompletionsHoverParticipant","_editor","_languageService","_openerService","accessibilityService","_telemetryService","hoverOrdinal","suggestHoverAnchor","mouseEvent","viewZoneData","detail","validatePosition","positionBefore","event","posx","posy","mightBeForeignElement","computeSync","lineDecorations","showToolbar","renderHoverParts","hoverParts","disposableStore","publicLog2","renderScreenReaderText","w","fragment","appendChild","$","dom","markdownHoverElement","hoverContentsElement","renderer","code","onDidRenderAsync","onContentsChanged","inlineSuggestionAvailable","renderedContents","render","appendText","appendCodeblock","replaceChildren","element","InlineCompletionsAccessibleView","InlineSuggestionHintsContentWidget_1","InlineCompletionsHintsWidget","instantiationService","alwaysShowToolbar","sessionPosition","firstColumn","Number","MAX_SAFE_INTEGER","contentWidgetValue","contentWidget","InlineSuggestionHintsContentWidget","addContentWidget","removeContentWidget","hadPosition","lastValue","inlineSuggestionHintsNextIcon","inlineSuggestionHintsPreviousIcon","dropDownVisible","_dropDownVisible","createCommandAction","iconClassName","action","kb","keybindingService","tooltip","comment","getLabel","withBorder","_position","_currentSuggestionIdx","_suggestionCount","_extraCommands","_menuService","allowEditorOverflow","suppressMouseDown","nodes","h","previousAction","availableSuggestionCountAction","nextAction","inlineCompletionsActionsMenus","createMenu","clearAvailableSuggestionCountLabelDebounced","disableButtonsDebounced","toolBar","CustomizedMenuWorkbenchToolBar","menuOptions","renderShortTitle","toolbarOptions","primaryGroup","g","actionViewItemProvider","StatusBarViewItem","ActionViewItemWithClassName","icon","setClass","telemetrySource","setPrependedPrimaryActions","onDidChangeDropdownVisibility","layoutContentWidget","suggestionCount","currentSuggestionIdx","schedule","extraActions","class","getActions","setAdditionalSecondaryActions","getId","root","preference","positionAffinity","_className","container","classList","updateTooltip","updateLabel","_action","div","OS","disableTitle","textContent","options2","menuService","contextMenuService","commandService","telemetryService","resetMenu","emitEventsForSubmenuChanges","additionalActions","prependedPrimaryActions","onDidChange","updateToolbar","_d","_e","_f","_g","secondary","shouldInlineSubmenu","useSeparatorsInPrimaryActions","setActions","actions","array","getReadonlyEmptyArray","ColumnRange","applyObservableDecorations","decorationsCollection","createDecorationsCollection","debugName","addPositions","pos1","pos2","subtractPositions","INLINE_EDIT_DESCRIPTION","isSingleLine","isPureRemove","backgroundColoring","ranges","firstNonWhitespace","getLineFirstNonWhitespaceColumn","lastNonWhitespace","getLineLastNonWhitespaceColumn","InlineEditHintsContentWidget_1","InlineEditHintsWidget","InlineEditHintsContentWidget","InlineEditController_1","InlineEditWidget","InlineEditController","_isVisibleContext","inlineEditVisibleContext","_isCursorAtInlineEditContext","cursorAtInlineEditContext","_currentEdit","_isAccepting","_backgroundColoring","modelChangedSignal","getInlineEdit","checkCursorPosition","currentEdit","editorBlurSingal","_currentRequestCts","editorFocusSignal","onDidFocusEditorText","gt","validateInlineEdit","includes","getLineLength","fetchInlineEdit","auto","modelVersion","inlineEditProvider","provideInlineEdit","textToDisplay","endsWith","instance","jumpBack","_jumpBackPosition","data","accepted","freeEdit","jumpToCurrent","getSelection","sendRejection","rejected","freeInlineEdit","inlineEditVisibleKey","cursorAtInlineEditKey","AcceptInlineEdit","TriggerInlineEdit","activeExpr","JumpToInlineEdit","when","JumpBackInlineEdit","RejectInlineEdit","InlineEditHover","InlineEditHoverParticipant","inlineProgressDecoration","stickiness","inlineClassNameAffectsLetterSpacing","InlineProgressWidget","typeId","delegate","create","role","iconElement","append","updateSize","style","height","width","ceil","baseId","InlineProgressManager","_showDelay","_showPromise","_currentWidget","_operationIdPool","_currentDecorations","showWhile","operationId","_currentOperation"],"sourceRoot":""}