@codingame/monaco-vscode-xterm-addons-common 26.2.2 → 27.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (17) hide show
  1. package/package.json +10 -10
  2. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.js +8 -8
  3. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.d.ts +8 -0
  4. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.js +7 -7
  5. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.d.ts +13 -0
  6. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.js +77 -34
  7. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.js +9 -9
  8. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder.js +25 -25
  9. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.js +87 -32
  10. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatPasteProviders.js +7 -7
  11. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +6 -0
  12. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +316 -193
  13. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.js +16 -16
  14. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +1 -0
  15. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +28 -13
  16. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables.d.ts +0 -42
  17. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables.js +0 -209
@@ -410,7 +410,7 @@ let DecorationAddon = class DecorationAddon extends Disposable {
410
410
  })];
411
411
  }
412
412
  _getContextMenuActions() {
413
- const label = ( localize(12193, "Toggle Visibility"));
413
+ const label = ( localize(13005, "Toggle Visibility"));
414
414
  return [{
415
415
  class: undefined,
416
416
  tooltip: label,
@@ -433,7 +433,7 @@ let DecorationAddon = class DecorationAddon extends Disposable {
433
433
  actions.push(attachToChatAction, ( new Separator()));
434
434
  }
435
435
  if (command.command !== "") {
436
- const labelRun = ( localize(12194, "Rerun Command"));
436
+ const labelRun = ( localize(13006, "Rerun Command"));
437
437
  actions.push({
438
438
  class: undefined,
439
439
  tooltip: labelRun,
@@ -446,11 +446,11 @@ let DecorationAddon = class DecorationAddon extends Disposable {
446
446
  }
447
447
  if (!command.isTrusted) {
448
448
  const shouldRun = await ( new Promise(r => {
449
- this._notificationService.prompt(Severity.Info, ( localize(12195, "Do you want to run the command: {0}", command.command)), [{
450
- label: ( localize(12196, "Yes")),
449
+ this._notificationService.prompt(Severity.Info, ( localize(13007, "Do you want to run the command: {0}", command.command)), [{
450
+ label: ( localize(13008, "Yes")),
451
451
  run: () => r(true)
452
452
  }, {
453
- label: ( localize(12197, "No")),
453
+ label: ( localize(13009, "No")),
454
454
  run: () => r(false)
455
455
  }]);
456
456
  }));
@@ -464,7 +464,7 @@ let DecorationAddon = class DecorationAddon extends Disposable {
464
464
  }
465
465
  });
466
466
  actions.push(( new Separator()));
467
- const labelCopy = ( localize(12198, "Copy Command"));
467
+ const labelCopy = ( localize(13010, "Copy Command"));
468
468
  actions.push({
469
469
  class: undefined,
470
470
  tooltip: labelCopy,
@@ -475,7 +475,7 @@ let DecorationAddon = class DecorationAddon extends Disposable {
475
475
  });
476
476
  }
477
477
  if (command.hasOutput()) {
478
- const labelCopyCommandAndOutput = ( localize(12199, "Copy Command and Output"));
478
+ const labelCopyCommandAndOutput = ( localize(13011, "Copy Command and Output"));
479
479
  actions.push({
480
480
  class: undefined,
481
481
  tooltip: labelCopyCommandAndOutput,
@@ -489,7 +489,7 @@ let DecorationAddon = class DecorationAddon extends Disposable {
489
489
  }
490
490
  }
491
491
  });
492
- const labelText = ( localize(12200, "Copy Output"));
492
+ const labelText = ( localize(13012, "Copy Output"));
493
493
  actions.push({
494
494
  class: undefined,
495
495
  tooltip: labelText,
@@ -503,7 +503,7 @@ let DecorationAddon = class DecorationAddon extends Disposable {
503
503
  }
504
504
  }
505
505
  });
506
- const labelHtml = ( localize(12201, "Copy Output as HTML"));
506
+ const labelHtml = ( localize(13013, "Copy Output as HTML"));
507
507
  actions.push({
508
508
  class: undefined,
509
509
  tooltip: labelHtml,
@@ -518,7 +518,7 @@ let DecorationAddon = class DecorationAddon extends Disposable {
518
518
  if (actions.length > 0) {
519
519
  actions.push(( new Separator()));
520
520
  }
521
- const labelRunRecent = ( localize(12202, "Run Recent Command"));
521
+ const labelRunRecent = ( localize(13014, "Run Recent Command"));
522
522
  actions.push({
523
523
  class: undefined,
524
524
  tooltip: labelRunRecent,
@@ -527,7 +527,7 @@ let DecorationAddon = class DecorationAddon extends Disposable {
527
527
  enabled: true,
528
528
  run: () => this._commandService.executeCommand("workbench.action.terminal.runRecentCommand")
529
529
  });
530
- const labelGoToRecent = ( localize(12203, "Go To Recent Directory"));
530
+ const labelGoToRecent = ( localize(13015, "Go To Recent Directory"));
531
531
  actions.push({
532
532
  class: undefined,
533
533
  tooltip: labelRunRecent,
@@ -537,7 +537,7 @@ let DecorationAddon = class DecorationAddon extends Disposable {
537
537
  run: () => this._commandService.executeCommand("workbench.action.terminal.goToRecentDirectory")
538
538
  });
539
539
  actions.push(( new Separator()));
540
- const labelAbout = ( localize(12204, "Learn About Shell Integration"));
540
+ const labelAbout = ( localize(13016, "Learn About Shell Integration"));
541
541
  actions.push({
542
542
  class: undefined,
543
543
  tooltip: labelAbout,
@@ -553,7 +553,7 @@ let DecorationAddon = class DecorationAddon extends Disposable {
553
553
  if (!chatIsEnabled) {
554
554
  return undefined;
555
555
  }
556
- const labelAttachToChat = ( localize(12205, "Attach To Chat"));
556
+ const labelAttachToChat = ( localize(13017, "Attach To Chat"));
557
557
  return {
558
558
  class: undefined,
559
559
  tooltip: labelAttachToChat,
@@ -595,14 +595,14 @@ let DecorationAddon = class DecorationAddon extends Disposable {
595
595
  quickPick.hideInput = true;
596
596
  quickPick.hideCheckAll = true;
597
597
  quickPick.canSelectMany = true;
598
- quickPick.title = ( localize(12206, "Toggle visibility"));
598
+ quickPick.title = ( localize(13018, "Toggle visibility"));
599
599
  const configValue = this._configurationService.getValue(TerminalSettingId.ShellIntegrationDecorationsEnabled);
600
600
  const gutterIcon = {
601
- label: ( localize(12207, "Gutter command decorations")),
601
+ label: ( localize(13019, "Gutter command decorations")),
602
602
  picked: configValue !== "never" && configValue !== "overviewRuler"
603
603
  };
604
604
  const overviewRulerIcon = {
605
- label: ( localize(12208, "Overview ruler command decorations")),
605
+ label: ( localize(13020, "Overview ruler command decorations")),
606
606
  picked: configValue !== "never" && configValue !== "gutter"
607
607
  };
608
608
  quickPick.items = [gutterIcon, overviewRulerIcon];
@@ -174,6 +174,7 @@ export declare class XtermTerminal extends Disposable implements IXtermTerminal,
174
174
  focus(): void;
175
175
  copySelection(asHtml?: boolean, command?: ITerminalCommand): Promise<void>;
176
176
  private _setCursorBlink;
177
+ private _setTextBlinking;
177
178
  private _setCursorStyle;
178
179
  private _setCursorStyleInactive;
179
180
  private _setCursorWidth;
@@ -49,6 +49,10 @@ var RenderConstants;
49
49
  (function(RenderConstants) {
50
50
  RenderConstants[RenderConstants["SmoothScrollDuration"] = 125] = "SmoothScrollDuration";
51
51
  })(RenderConstants || (RenderConstants = {}));
52
+ var TextBlinkConstants;
53
+ (function(TextBlinkConstants) {
54
+ TextBlinkConstants[TextBlinkConstants["IntervalDuration"] = 600] = "IntervalDuration";
55
+ })(TextBlinkConstants || (TextBlinkConstants = {}));
52
56
  function getFullBufferLineAsString(lineIndex, buffer) {
53
57
  let line = buffer.getLine(lineIndex);
54
58
  if (!line) {
@@ -202,6 +206,7 @@ let XtermTerminal = class XtermTerminal extends Disposable {
202
206
  minimumContrastRatio: config.minimumContrastRatio,
203
207
  tabStopWidth: config.tabStopWidth,
204
208
  cursorBlink: config.cursorBlinking,
209
+ blinkIntervalDuration: config.textBlinking ? TextBlinkConstants.IntervalDuration : 0,
205
210
  cursorStyle: vscodeToXtermCursorStyle(config.cursorStyle),
206
211
  cursorInactiveStyle: vscodeToXtermCursorStyle(config.cursorStyleInactive),
207
212
  cursorWidth: config.cursorWidth,
@@ -212,11 +217,11 @@ let XtermTerminal = class XtermTerminal extends Disposable {
212
217
  scrollSensitivity: config.mouseWheelScrollSensitivity,
213
218
  scrollOnEraseInDisplay: true,
214
219
  wordSeparator: config.wordSeparators,
215
- overviewRuler: options.disableOverviewRuler ? {
216
- width: 0
217
- } : {
220
+ scrollbar: options.disableOverviewRuler ? undefined : {
218
221
  width: 14,
219
- showTopBorder: true
222
+ overviewRuler: {
223
+ showTopBorder: true
224
+ }
220
225
  },
221
226
  ignoreBracketedPasteMode: config.ignoreBracketedPasteMode,
222
227
  rescaleOverlappingGlyphs: config.rescaleOverlappingGlyphs,
@@ -224,6 +229,7 @@ let XtermTerminal = class XtermTerminal extends Disposable {
224
229
  kittyKeyboard: config.enableKittyKeyboardProtocol,
225
230
  win32InputMode: config.enableWin32InputMode
226
231
  },
232
+ allowTransparency: config.enableImages,
227
233
  windowOptions: {
228
234
  getWinSizePixels: true,
229
235
  getCellSizePixels: true,
@@ -515,6 +521,7 @@ let XtermTerminal = class XtermTerminal extends Disposable {
515
521
  const config = this._terminalConfigurationService.config;
516
522
  this.raw.options.altClickMovesCursor = config.altClickMovesCursor;
517
523
  this._setCursorBlink(config.cursorBlinking);
524
+ this._setTextBlinking(config.textBlinking);
518
525
  this._setCursorStyle(config.cursorStyle);
519
526
  this._setCursorStyleInactive(config.cursorStyleInactive);
520
527
  this._setCursorWidth(config.cursorWidth);
@@ -532,6 +539,7 @@ let XtermTerminal = class XtermTerminal extends Disposable {
532
539
  this.raw.options.wordSeparator = config.wordSeparators;
533
540
  this.raw.options.ignoreBracketedPasteMode = config.ignoreBracketedPasteMode;
534
541
  this.raw.options.rescaleOverlappingGlyphs = config.rescaleOverlappingGlyphs;
542
+ this.raw.options.allowTransparency = config.enableImages;
535
543
  this.raw.options.vtExtensions = {
536
544
  kittyKeyboard: config.enableKittyKeyboardProtocol,
537
545
  win32InputMode: config.enableWin32InputMode
@@ -599,16 +607,16 @@ let XtermTerminal = class XtermTerminal extends Disposable {
599
607
  highlightLimit: XtermTerminalConstants.SearchHighlightLimit
600
608
  }));
601
609
  this.raw.loadAddon(this._searchAddon);
602
- this._searchAddon.onDidChangeResults(results => {
610
+ this._store.add(this._searchAddon.onDidChangeResults(results => {
603
611
  this._lastFindResult = results;
604
612
  this._onDidChangeFindResults.fire(results);
605
- });
606
- this._searchAddon.onBeforeSearch(() => {
613
+ }));
614
+ this._store.add(this._searchAddon.onBeforeSearch(() => {
607
615
  this._onBeforeSearch.fire();
608
- });
609
- this._searchAddon.onAfterSearch(() => {
616
+ }));
617
+ this._store.add(this._searchAddon.onAfterSearch(() => {
610
618
  this._onAfterSearch.fire();
611
- });
619
+ }));
612
620
  return this._searchAddon;
613
621
  });
614
622
  }
@@ -738,7 +746,7 @@ let XtermTerminal = class XtermTerminal extends Disposable {
738
746
  await this._clipboardService.writeText(this.raw.getSelection());
739
747
  }
740
748
  } else {
741
- this._notificationService.warn(( localize(12219, "The terminal has no selection to copy")));
749
+ this._notificationService.warn(( localize(13031, "The terminal has no selection to copy")));
742
750
  }
743
751
  }
744
752
  _setCursorBlink(blink) {
@@ -747,6 +755,13 @@ let XtermTerminal = class XtermTerminal extends Disposable {
747
755
  this.raw.refresh(0, this.raw.rows - 1);
748
756
  }
749
757
  }
758
+ _setTextBlinking(enabled) {
759
+ const blinkIntervalDuration = enabled ? TextBlinkConstants.IntervalDuration : 0;
760
+ const options = this.raw.options;
761
+ if (options.blinkIntervalDuration !== blinkIntervalDuration) {
762
+ options.blinkIntervalDuration = blinkIntervalDuration;
763
+ }
764
+ }
750
765
  _setCursorStyle(style) {
751
766
  const mapped = vscodeToXtermCursorStyle(style);
752
767
  if (this.raw.options.cursorStyle !== mapped) {
@@ -778,10 +793,10 @@ let XtermTerminal = class XtermTerminal extends Disposable {
778
793
  try {
779
794
  this.raw.loadAddon(this._webglAddon);
780
795
  this._logService.trace("Webgl was loaded");
781
- this._webglAddon.onContextLoss(() => {
796
+ this._store.add(this._webglAddon.onContextLoss(() => {
782
797
  this._logService.info(`Webgl lost context, disposing of webgl renderer`);
783
798
  this._disposeOfWebglRenderer();
784
- });
799
+ }));
785
800
  this._refreshImageAddon();
786
801
  this._onDidRequestRefreshDimensions.fire();
787
802
  } catch (e) {
@@ -1,42 +0,0 @@
1
- import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
- import { IRange } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range";
3
- import { Command } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages";
4
- import { Action2 } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions";
5
- import { ServicesAccessor } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
6
- import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service";
7
- import { IChatRequestVariableValue, IDynamicVariable } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/attachments/chatVariables";
8
- import { IChatWidget } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat";
9
- import { IChatWidgetContrib } from "@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/chat/browser/widget/chatWidget";
10
- export declare const dynamicVariableDecorationType = "chat-dynamic-variable";
11
- export declare class ChatDynamicVariableModel extends Disposable implements IChatWidgetContrib {
12
- private readonly widget;
13
- private readonly labelService;
14
- static readonly ID = "chatDynamicVariableModel";
15
- private _variables;
16
- get variables(): ReadonlyArray<IDynamicVariable>;
17
- get id(): string;
18
- private decorationData;
19
- constructor(widget: IChatWidget, labelService: ILabelService);
20
- getInputState(contrib: Record<string, unknown>): void;
21
- setInputState(contrib: Readonly<Record<string, unknown>>): void;
22
- addReference(ref: IDynamicVariable): void;
23
- private updateDecorations;
24
- private getHoverForReference;
25
- /**
26
- * Dispose all existing variables.
27
- */
28
- private disposeVariables;
29
- dispose(): void;
30
- }
31
- export interface IAddDynamicVariableContext {
32
- id: string;
33
- widget: IChatWidget;
34
- range: IRange;
35
- variableData: IChatRequestVariableValue;
36
- command?: Command;
37
- }
38
- export declare class AddDynamicVariableAction extends Action2 {
39
- static readonly ID = "workbench.action.chat.addDynamicVariable";
40
- constructor();
41
- run(accessor: ServicesAccessor, ...args: unknown[]): Promise<void>;
42
- }
@@ -1,209 +0,0 @@
1
-
2
- import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
- import { coalesce } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
4
- import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
5
- import { Disposable, dispose, isDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
6
- import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
7
- import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range';
8
- import { isLocation } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages';
9
- import { Action2, registerAction2 } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
10
- import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
11
- import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
12
- import { addDynamicVariableActionId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/input/editor/chatDynamicVariablesConstant';
13
-
14
- var ChatDynamicVariableModel_1;
15
- const dynamicVariableDecorationType = "chat-dynamic-variable";
16
- let ChatDynamicVariableModel = class ChatDynamicVariableModel extends Disposable {
17
- static {
18
- ChatDynamicVariableModel_1 = this;
19
- }
20
- static {
21
- this.ID = "chatDynamicVariableModel";
22
- }
23
- get variables() {
24
- return [...this._variables];
25
- }
26
- get id() {
27
- return ChatDynamicVariableModel_1.ID;
28
- }
29
- constructor(widget, labelService) {
30
- super();
31
- this.widget = widget;
32
- this.labelService = labelService;
33
- this._variables = [];
34
- this.decorationData = [];
35
- this._register(widget.inputEditor.onDidChangeModelContent(e => {
36
- const removed = [];
37
- let didChange = false;
38
- this._variables = coalesce(( this._variables.map((ref, idx) => {
39
- const model = widget.inputEditor.getModel();
40
- if (!model) {
41
- removed.push(ref);
42
- return null;
43
- }
44
- const data = this.decorationData[idx];
45
- const newRange = model.getDecorationRange(data.id);
46
- if (!newRange) {
47
- removed.push(ref);
48
- return null;
49
- }
50
- const newText = model.getValueInRange(newRange);
51
- if (newText !== data.text) {
52
- this.widget.inputEditor.executeEdits(this.id, [{
53
- range: newRange,
54
- text: ""
55
- }]);
56
- this.widget.refreshParsedInput();
57
- removed.push(ref);
58
- return null;
59
- }
60
- if (newRange.equalsRange(ref.range)) {
61
- return ref;
62
- }
63
- didChange = true;
64
- return {
65
- ...ref,
66
- range: newRange
67
- };
68
- })));
69
- dispose(removed.filter(isDisposable));
70
- if (didChange || removed.length > 0) {
71
- this.widget.refreshParsedInput();
72
- }
73
- this.updateDecorations();
74
- }));
75
- }
76
- getInputState(contrib) {
77
- contrib[ChatDynamicVariableModel_1.ID] = this.variables;
78
- }
79
- setInputState(contrib) {
80
- let s = contrib[ChatDynamicVariableModel_1.ID];
81
- if (!Array.isArray(s)) {
82
- s = [];
83
- }
84
- this.disposeVariables();
85
- this._variables = [];
86
- for (const variable of s) {
87
- if (!isDynamicVariable(variable)) {
88
- continue;
89
- }
90
- this.addReference(variable);
91
- }
92
- }
93
- addReference(ref) {
94
- this._variables.push(ref);
95
- this.updateDecorations();
96
- this.widget.refreshParsedInput();
97
- }
98
- updateDecorations() {
99
- const decorationIds = this.widget.inputEditor.setDecorationsByType("chat", dynamicVariableDecorationType, ( this._variables.map(r => ({
100
- range: r.range,
101
- hoverMessage: this.getHoverForReference(r)
102
- }))));
103
- this.decorationData = [];
104
- for (let i = 0; i < decorationIds.length; i++) {
105
- this.decorationData.push({
106
- id: decorationIds[i],
107
- text: this.widget.inputEditor.getModel().getValueInRange(this._variables[i].range)
108
- });
109
- }
110
- }
111
- getHoverForReference(ref) {
112
- const value = ref.data;
113
- if (URI.isUri(value)) {
114
- return ( new MarkdownString(this.labelService.getUriLabel(value, {
115
- relative: true
116
- })));
117
- } else if (isLocation(value)) {
118
- const prefix = ref.fullName ? ` ${ref.fullName}` : "";
119
- const rangeString = `#${value.range.startLineNumber}-${value.range.endLineNumber}`;
120
- return ( new MarkdownString(prefix + this.labelService.getUriLabel(value.uri, {
121
- relative: true
122
- }) + rangeString));
123
- } else {
124
- return undefined;
125
- }
126
- }
127
- disposeVariables() {
128
- for (const variable of this._variables) {
129
- if (isDisposable(variable)) {
130
- variable.dispose();
131
- }
132
- }
133
- }
134
- dispose() {
135
- this.disposeVariables();
136
- super.dispose();
137
- }
138
- };
139
- ChatDynamicVariableModel = ChatDynamicVariableModel_1 = ( __decorate([( __param(1, ILabelService))], ChatDynamicVariableModel));
140
- function isDynamicVariable(obj) {
141
- return obj && typeof obj.id === "string" && Range.isIRange(obj.range) && "data" in obj;
142
- }
143
- function isAddDynamicVariableContext(context) {
144
- return "widget" in context && "range" in context && "variableData" in context;
145
- }
146
- class AddDynamicVariableAction extends Action2 {
147
- static {
148
- this.ID = addDynamicVariableActionId;
149
- }
150
- constructor() {
151
- super({
152
- id: AddDynamicVariableAction.ID,
153
- title: ""
154
- });
155
- }
156
- async run(accessor, ...args) {
157
- const context = args[0];
158
- if (!isAddDynamicVariableContext(context)) {
159
- return;
160
- }
161
- let range = context.range;
162
- const variableData = context.variableData;
163
- const doCleanup = () => {
164
- context.widget.inputEditor.executeEdits("chatInsertDynamicVariableWithArguments", [{
165
- range: context.range,
166
- text: ``
167
- }]);
168
- };
169
- if (context.command) {
170
- const commandService = accessor.get(ICommandService);
171
- const selection = await commandService.executeCommand(context.command.id, ...(context.command.arguments ?? []));
172
- if (!selection) {
173
- doCleanup();
174
- return;
175
- }
176
- const insertText = ":" + selection;
177
- const insertRange = ( new Range(
178
- range.startLineNumber,
179
- range.endColumn,
180
- range.endLineNumber,
181
- range.endColumn + insertText.length
182
- ));
183
- range = ( new Range(
184
- range.startLineNumber,
185
- range.startColumn,
186
- range.endLineNumber,
187
- range.endColumn + insertText.length
188
- ));
189
- const editor = context.widget.inputEditor;
190
- const success = editor.executeEdits("chatInsertDynamicVariableWithArguments", [{
191
- range: insertRange,
192
- text: insertText + " "
193
- }]);
194
- if (!success) {
195
- doCleanup();
196
- return;
197
- }
198
- }
199
- context.widget.getContrib(ChatDynamicVariableModel.ID)?.addReference({
200
- id: context.id,
201
- range: range,
202
- isFile: true,
203
- data: variableData
204
- });
205
- }
206
- }
207
- registerAction2(AddDynamicVariableAction);
208
-
209
- export { AddDynamicVariableAction, ChatDynamicVariableModel, dynamicVariableDecorationType };