@codingame/monaco-vscode-notebook-service-override 15.0.2 → 16.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 (84) hide show
  1. package/index.js +5 -11
  2. package/package.json +27 -26
  3. package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.css +6 -0
  4. package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +10 -10
  5. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +22 -22
  6. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.d.ts +1 -0
  7. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.js +7 -3
  8. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.js +5 -5
  9. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.js +7 -3
  10. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +3 -3
  11. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +7 -7
  12. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +12 -3
  13. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +10 -10
  14. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/media/notebookFind.css +17 -0
  15. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +4 -4
  16. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +5 -5
  17. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +2 -2
  18. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +1 -1
  19. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.js +6 -6
  20. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +14 -14
  21. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookInlineVariables.js +1 -1
  22. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +1 -1
  23. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +1 -1
  24. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +2 -2
  25. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +2 -2
  26. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +10 -10
  27. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +1 -1
  28. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +13 -13
  29. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +3 -3
  30. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +28 -28
  31. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +54 -31
  32. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +25 -25
  33. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +26 -26
  34. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +25 -25
  35. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +18 -18
  36. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.js +7 -7
  37. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +12 -12
  38. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/variablesActions.js +2 -2
  39. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +22 -22
  40. package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +72 -74
  41. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.js +11 -11
  42. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibleView.js +1 -1
  43. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +33 -33
  44. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +2 -2
  45. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +1 -1
  46. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +1 -1
  47. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +3 -3
  48. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +1 -1
  49. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +54 -12
  50. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +4 -3
  51. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.d.ts +2 -0
  52. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +42 -1
  53. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +10 -2
  54. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookCellMatching.d.ts +15 -0
  55. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookCellMatching.js +173 -0
  56. package/vscode/src/vs/workbench/contrib/notebook/common/services/{notebookSimpleWorker.d.ts → notebookWebWorker.d.ts} +24 -6
  57. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookWebWorker.js +366 -0
  58. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookWebWorkerMain.js +5 -0
  59. package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +12 -12
  60. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +1 -1
  61. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.d.ts +2 -2
  62. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +1 -1
  63. package/worker.js +1 -1
  64. package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.css.js +0 -6
  65. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/contribution.js +0 -10
  66. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookCellDecorators.d.ts +0 -24
  67. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookCellDecorators.js +0 -332
  68. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookChatActionsOverlay.d.ts +0 -23
  69. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookChatActionsOverlay.js +0 -299
  70. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookChatEditController.d.ts +0 -9
  71. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookChatEditController.js +0 -179
  72. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookOriginalCellModelFactory.d.ts +0 -21
  73. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookOriginalCellModelFactory.js +0 -42
  74. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookOriginalModelRefFactory.d.ts +0 -25
  75. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookOriginalModelRefFactory.js +0 -77
  76. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookSynchronizer.d.ts +0 -64
  77. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookSynchronizer.js +0 -443
  78. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookSynchronizerService.d.ts +0 -20
  79. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookSynchronizerService.js +0 -86
  80. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/media/notebookFind.css.js +0 -6
  81. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.js +0 -279
  82. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorkerMain.d.ts +0 -1
  83. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorkerMain.js +0 -5
  84. /package/vscode/src/vs/workbench/contrib/notebook/{browser/contrib/chatEdit/contribution.d.ts → common/services/notebookWebWorkerMain.d.ts} +0 -0
@@ -26,7 +26,7 @@ import { Extensions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/com
26
26
  import { SaveReason } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
27
27
  import { getNotebookEditorFromEditorPane } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
28
28
  import { NotebookSetting, CellKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
29
- import { NotebookFileWorkingCopyModel } from '@codingame/monaco-vscode-bba55be6-41a2-50cd-a3cc-8bafa35bfa89-common/vscode/vs/workbench/contrib/notebook/common/notebookEditorModel';
29
+ import { NotebookFileWorkingCopyModel } from '@codingame/monaco-vscode-897bebad-39df-57cb-8a57-36a271d038be-common/vscode/vs/workbench/contrib/notebook/common/notebookEditorModel';
30
30
  import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
31
31
  import { LifecyclePhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle';
32
32
  import { IWorkingCopyFileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService.service';
@@ -65,7 +65,7 @@ let FormatOnSaveParticipant = class FormatOnSaveParticipant {
65
65
  if (!enabled) {
66
66
  return undefined;
67
67
  }
68
- progress.report({ message: ( localize(7656, "Formatting")) });
68
+ progress.report({ message: ( localize(7932, "Formatting")) });
69
69
  const notebook = workingCopy.model.notebookModel;
70
70
  const formatApplied = await this.instantiationService.invokeFunction(CodeActionParticipantUtils.checkAndRunFormatCodeAction, notebook, progress, token);
71
71
  const disposable = ( new DisposableStore());
@@ -83,7 +83,7 @@ let FormatOnSaveParticipant = class FormatOnSaveParticipant {
83
83
  }
84
84
  return [];
85
85
  })));
86
- await this.bulkEditService.apply( allCellEdits.flat(), { label: ( localize(7657, "Format Notebook")), code: 'undoredo.formatNotebook', });
86
+ await this.bulkEditService.apply( allCellEdits.flat(), { label: ( localize(7933, "Format Notebook")), code: 'undoredo.formatNotebook', });
87
87
  }
88
88
  }
89
89
  finally {
@@ -152,7 +152,7 @@ let TrimWhitespaceParticipant = class TrimWhitespaceParticipant extends Notebook
152
152
  return ( ops.map(op => ( new ResourceTextEdit(model.uri, { ...op, text: op.text || '' }, model.getVersionId()))));
153
153
  })));
154
154
  const filteredEdits = allCellEdits.flat().filter(edit => edit !== undefined);
155
- await this.bulkEditService.apply(filteredEdits, { label: ( localize(7658, "Notebook Trim Trailing Whitespace")), code: 'undoredo.notebookTrimTrailingWhitespace' });
155
+ await this.bulkEditService.apply(filteredEdits, { label: ( localize(7934, "Notebook Trim Trailing Whitespace")), code: 'undoredo.notebookTrimTrailingWhitespace' });
156
156
  }
157
157
  finally {
158
158
  progress.report({ increment: 100 });
@@ -229,7 +229,7 @@ let TrimFinalNewLinesParticipant = class TrimFinalNewLinesParticipant extends No
229
229
  ));
230
230
  })));
231
231
  const filteredEdits = allCellEdits.flat().filter(edit => edit !== undefined);
232
- await this.bulkEditService.apply(filteredEdits, { label: ( localize(7659, "Trim Final New Lines")), code: 'undoredo.trimFinalNewLines' });
232
+ await this.bulkEditService.apply(filteredEdits, { label: ( localize(7935, "Trim Final New Lines")), code: 'undoredo.trimFinalNewLines' });
233
233
  }
234
234
  finally {
235
235
  progress.report({ increment: 100 });
@@ -283,7 +283,7 @@ let InsertFinalNewLineParticipant = class InsertFinalNewLineParticipant extends
283
283
  )), text: cell.textBuffer.getEOL() }, cell.textModel?.getVersionId()));
284
284
  })));
285
285
  const filteredEdits = allCellEdits.filter(edit => edit !== undefined);
286
- await this.bulkEditService.apply(filteredEdits, { label: ( localize(7660, "Insert Final New Line")), code: 'undoredo.insertFinalNewLine' });
286
+ await this.bulkEditService.apply(filteredEdits, { label: ( localize(7936, "Insert Final New Line")), code: 'undoredo.insertFinalNewLine' });
287
287
  if (activeCellEditor && selections) {
288
288
  activeCellEditor.setSelections(selections);
289
289
  }
@@ -339,7 +339,7 @@ let CodeActionOnSaveParticipant = class CodeActionOnSaveParticipant {
339
339
  const notebookCodeActionsOnSave = includedActions.filter(x => CodeActionKind.Notebook.contains(x));
340
340
  if (notebookCodeActionsOnSave.length) {
341
341
  const nbDisposable = ( new DisposableStore());
342
- progress.report({ message: ( localize(7661, "Running 'Notebook' code actions")) });
342
+ progress.report({ message: ( localize(7937, "Running 'Notebook' code actions")) });
343
343
  try {
344
344
  const cell = notebookModel.cells[0];
345
345
  const ref = await this.textModelService.createModelReference(cell.uri);
@@ -371,7 +371,7 @@ let CodeActionOnSaveParticipant = class CodeActionOnSaveParticipant {
371
371
  });
372
372
  }
373
373
  const cellDisposable = ( new DisposableStore());
374
- progress.report({ message: ( localize(7662, "Running 'Cell' code actions")) });
374
+ progress.report({ message: ( localize(7938, "Running 'Cell' code actions")) });
375
375
  try {
376
376
  await Promise.all(( notebookModel.cells.map(async (cell) => {
377
377
  const ref = await this.textModelService.createModelReference(cell.uri);
@@ -411,7 +411,7 @@ class CodeActionParticipantUtils {
411
411
  const configurationService = accessor.get(IConfigurationService);
412
412
  const formatDisposable = ( new DisposableStore());
413
413
  let formatResult = false;
414
- progress.report({ message: ( localize(7663, "Running 'Format' code actions")) });
414
+ progress.report({ message: ( localize(7939, "Running 'Format' code actions")) });
415
415
  try {
416
416
  const cell = notebookModel.cells[0];
417
417
  const ref = await textModelService.createModelReference(cell.uri);
@@ -440,7 +440,7 @@ class CodeActionParticipantUtils {
440
440
  _report() {
441
441
  progress.report({
442
442
  message: ( localize(
443
- 7664,
443
+ 7940,
444
444
  "Getting code actions from '{0}' ([configure]({1})).",
445
445
  ( [...this._names].map(name => `'${name}'`)).join(', '),
446
446
  'command:workbench.action.openSettings?%5B%22notebook.codeActionsOnSave%22%5D'
@@ -480,7 +480,7 @@ class CodeActionParticipantUtils {
480
480
  logService.warn('Failed to apply code action on save, applied to multiple resources.');
481
481
  continue;
482
482
  }
483
- progress.report({ message: ( localize(7665, "Applying code action '{0}'.", action.action.title)) });
483
+ progress.report({ message: ( localize(7941, "Applying code action '{0}'.", action.action.title)) });
484
484
  await instantiationService.invokeFunction(applyCodeAction, action, ApplyCodeActionReason.OnSave, {}, token);
485
485
  if (token.isCancellationRequested) {
486
486
  return;
@@ -505,7 +505,7 @@ class CodeActionParticipantUtils {
505
505
  _report() {
506
506
  progress.report({
507
507
  message: ( localize(
508
- 7664,
508
+ 7940,
509
509
  "Getting code actions from '{0}' ([configure]({1})).",
510
510
  ( [...this._names].map(name => `'${name}'`)).join(', '),
511
511
  'command:workbench.action.openSettings?%5B%22notebook.defaultFormatter%22%5D'
@@ -532,7 +532,7 @@ class CodeActionParticipantUtils {
532
532
  if (!action) {
533
533
  return false;
534
534
  }
535
- progress.report({ message: ( localize(7665, "Applying code action '{0}'.", action.action.title)) });
535
+ progress.report({ message: ( localize(7941, "Applying code action '{0}'.", action.action.title)) });
536
536
  await instantiationService.invokeFunction(applyCodeAction, action, ApplyCodeActionReason.OnSave, {}, token);
537
537
  if (token.isCancellationRequested) {
538
538
  return false;
@@ -95,7 +95,7 @@ registerAction2(class extends Action2 {
95
95
  constructor() {
96
96
  super({
97
97
  id: 'notebook.toggleLayoutTroubleshoot',
98
- title: ( localize2(7666, "Toggle Layout Troubleshoot")),
98
+ title: ( localize2(7942, "Toggle Layout Troubleshoot")),
99
99
  category: Categories.Developer,
100
100
  f1: true
101
101
  });
@@ -114,7 +114,7 @@ registerAction2(class extends Action2 {
114
114
  constructor() {
115
115
  super({
116
116
  id: 'notebook.inspectLayout',
117
- title: ( localize2(7667, "Inspect Notebook Layout")),
117
+ title: ( localize2(7943, "Inspect Notebook Layout")),
118
118
  category: Categories.Developer,
119
119
  f1: true
120
120
  });
@@ -135,7 +135,7 @@ registerAction2(class extends Action2 {
135
135
  constructor() {
136
136
  super({
137
137
  id: 'notebook.clearNotebookEdtitorTypeCache',
138
- title: ( localize2(7668, "Clear Notebook Editor Type Cache")),
138
+ title: ( localize2(7944, "Clear Notebook Editor Type Cache")),
139
139
  category: Categories.Developer,
140
140
  f1: true
141
141
  });
@@ -17,7 +17,7 @@ import { NotebookAction, NotebookCellAction, getEditorFromArgsOrActivePane, CELL
17
17
  import { insertNewCell } from '../insertCellActions.js';
18
18
  import { CellEditState } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
19
19
  import { CellKind, NOTEBOOK_EDITOR_CURSOR_BOUNDARY, NotebookSetting } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
20
- import { NOTEBOOK_CELL_EDITOR_FOCUSED, NOTEBOOK_EDITOR_FOCUSED, IS_COMPOSITE_NOTEBOOK, NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_CELL_GENERATED_BY_CHAT } from '@codingame/monaco-vscode-52bb4d5b-ba1a-57fd-9bee-b28824214eac-common/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
20
+ import { NOTEBOOK_CELL_EDITOR_FOCUSED, NOTEBOOK_EDITOR_FOCUSED, IS_COMPOSITE_NOTEBOOK, NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_CELL_GENERATED_BY_CHAT } from '@codingame/monaco-vscode-a1eb43d5-da63-5f76-8ad4-acf0d6c3b749-common/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
21
21
  import { Iterable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/iterator';
22
22
  import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
23
23
  import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
@@ -28,7 +28,7 @@ registerAction2(class extends NotebookAction {
28
28
  constructor() {
29
29
  super({
30
30
  id: 'notebook.cell.chat.accept',
31
- title: ( localize2(7674, "Make Request")),
31
+ title: ( localize2(7950, "Make Request")),
32
32
  icon: Codicon.send,
33
33
  keybinding: {
34
34
  when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED, ( NOTEBOOK_CELL_EDITOR_FOCUSED.negate()))),
@@ -52,7 +52,7 @@ registerAction2(class extends NotebookCellAction {
52
52
  constructor() {
53
53
  super({
54
54
  id: 'notebook.cell.chat.arrowOutUp',
55
- title: ( localize(7675, 'Cursor Up')),
55
+ title: ( localize(7951, 'Cursor Up')),
56
56
  keybinding: {
57
57
  when: ( ContextKeyExpr.and(
58
58
  CTX_NOTEBOOK_CELL_CHAT_FOCUSED,
@@ -87,7 +87,7 @@ registerAction2(class extends NotebookAction {
87
87
  constructor() {
88
88
  super({
89
89
  id: 'notebook.cell.chat.arrowOutDown',
90
- title: ( localize(7676, 'Cursor Down')),
90
+ title: ( localize(7952, 'Cursor Down')),
91
91
  keybinding: {
92
92
  when: ( ContextKeyExpr.and(
93
93
  CTX_NOTEBOOK_CELL_CHAT_FOCUSED,
@@ -110,7 +110,7 @@ registerAction2(class extends NotebookCellAction {
110
110
  constructor() {
111
111
  super({
112
112
  id: 'notebook.cell.focusChatWidget',
113
- title: ( localize(7677, 'Focus Chat Widget')),
113
+ title: ( localize(7953, 'Focus Chat Widget')),
114
114
  keybinding: {
115
115
  when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ( CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()), ( ContextKeyExpr.and(( ContextKeyExpr.has(InputFocusedContextKey)), EditorContextKeys.editorTextFocus, ( NOTEBOOK_EDITOR_CURSOR_BOUNDARY.notEqualsTo('bottom')), ( NOTEBOOK_EDITOR_CURSOR_BOUNDARY.notEqualsTo('none')))), ( EditorContextKeys.isEmbeddedDiffEditor.negate()))),
116
116
  weight: KeybindingWeight.EditorCore + 7,
@@ -128,7 +128,7 @@ registerAction2(class extends NotebookCellAction {
128
128
  constructor() {
129
129
  super({
130
130
  id: 'notebook.cell.focusNextChatWidget',
131
- title: ( localize(7678, 'Focus Next Cell Chat Widget')),
131
+ title: ( localize(7954, 'Focus Next Cell Chat Widget')),
132
132
  keybinding: {
133
133
  when: ( ContextKeyExpr.and(( CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()), ( ContextKeyExpr.and(( ContextKeyExpr.has(InputFocusedContextKey)), EditorContextKeys.editorTextFocus, ( NOTEBOOK_EDITOR_CURSOR_BOUNDARY.notEqualsTo('top')), ( NOTEBOOK_EDITOR_CURSOR_BOUNDARY.notEqualsTo('none')))), ( EditorContextKeys.isEmbeddedDiffEditor.negate()))),
134
134
  weight: KeybindingWeight.EditorCore + 7,
@@ -147,7 +147,7 @@ registerAction2(class extends NotebookAction {
147
147
  constructor() {
148
148
  super({
149
149
  id: 'notebook.cell.chat.stop',
150
- title: ( localize2(7679, "Stop Request")),
150
+ title: ( localize2(7955, "Stop Request")),
151
151
  icon: Codicon.debugStop,
152
152
  menu: {
153
153
  id: MENU_CELL_CHAT_INPUT,
@@ -166,7 +166,7 @@ registerAction2(class extends NotebookAction {
166
166
  constructor() {
167
167
  super({
168
168
  id: 'notebook.cell.chat.close',
169
- title: ( localize2(7680, "Close Chat")),
169
+ title: ( localize2(7956, "Close Chat")),
170
170
  icon: Codicon.close,
171
171
  menu: {
172
172
  id: MENU_CELL_CHAT_WIDGET,
@@ -184,10 +184,10 @@ registerAction2(class extends NotebookAction {
184
184
  constructor() {
185
185
  super({
186
186
  id: 'notebook.cell.chat.acceptChanges',
187
- title: ( localize2(7681, "Accept Changes")),
188
- shortTitle: ( localize(7682, 'Accept')),
187
+ title: ( localize2(7957, "Accept Changes")),
188
+ shortTitle: ( localize(7958, 'Accept')),
189
189
  icon: Codicon.check,
190
- tooltip: ( localize(7683, 'Accept Changes')),
190
+ tooltip: ( localize(7959, 'Accept Changes')),
191
191
  keybinding: [
192
192
  {
193
193
  when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED, ( NOTEBOOK_CELL_EDITOR_FOCUSED.negate()))),
@@ -234,7 +234,7 @@ registerAction2(class extends NotebookAction {
234
234
  constructor() {
235
235
  super({
236
236
  id: 'notebook.cell.chat.discard',
237
- title: ( localize(7684, 'Discard')),
237
+ title: ( localize(7960, 'Discard')),
238
238
  icon: Codicon.discard,
239
239
  keybinding: {
240
240
  when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED, ( CTX_NOTEBOOK_CHAT_USER_DID_EDIT.negate()), ( NOTEBOOK_CELL_EDITOR_FOCUSED.negate()))),
@@ -275,12 +275,12 @@ registerAction2(class extends NotebookAction {
275
275
  super({
276
276
  id: 'notebook.cell.chat.start',
277
277
  title: {
278
- value: '$(sparkle) ' + ( localize(7685, "Generate")),
278
+ value: '$(sparkle) ' + ( localize(7961, "Generate")),
279
279
  original: '$(sparkle) Generate',
280
280
  },
281
- tooltip: ( localize(7686, "Start Chat to Generate Code")),
281
+ tooltip: ( localize(7962, "Start Chat to Generate Code")),
282
282
  metadata: {
283
- description: ( localize(7686, "Start Chat to Generate Code")),
283
+ description: ( localize(7962, "Start Chat to Generate Code")),
284
284
  args: [
285
285
  {
286
286
  name: 'args',
@@ -362,10 +362,10 @@ registerAction2(class extends NotebookAction {
362
362
  super({
363
363
  id: 'notebook.cell.chat.startAtTop',
364
364
  title: {
365
- value: '$(sparkle) ' + ( localize(7685, "Generate")),
365
+ value: '$(sparkle) ' + ( localize(7961, "Generate")),
366
366
  original: '$(sparkle) Generate',
367
367
  },
368
- tooltip: ( localize(7686, "Start Chat to Generate Code")),
368
+ tooltip: ( localize(7962, "Start Chat to Generate Code")),
369
369
  f1: false,
370
370
  menu: [
371
371
  {
@@ -385,8 +385,8 @@ MenuRegistry.appendMenuItem(MenuId.NotebookToolbar, {
385
385
  command: {
386
386
  id: 'notebook.cell.chat.start',
387
387
  icon: Codicon.sparkle,
388
- title: ( localize(7687, "Generate")),
389
- tooltip: ( localize(7688, "Start Chat to Generate Code"))
388
+ title: ( localize(7963, "Generate")),
389
+ tooltip: ( localize(7964, "Start Chat to Generate Code"))
390
390
  },
391
391
  order: -10,
392
392
  group: 'navigation/add',
@@ -396,7 +396,7 @@ registerAction2(class extends NotebookAction {
396
396
  constructor() {
397
397
  super({
398
398
  id: 'notebook.cell.chat.focus',
399
- title: ( localize(7689, 'Focus Chat')),
399
+ title: ( localize(7965, 'Focus Chat')),
400
400
  keybinding: [
401
401
  {
402
402
  when: ( ContextKeyExpr.and(
@@ -428,7 +428,7 @@ registerAction2(class extends NotebookAction {
428
428
  constructor() {
429
429
  super({
430
430
  id: 'notebook.cell.chat.focusNextCell',
431
- title: ( localize(7690, 'Focus Next Cell')),
431
+ title: ( localize(7966, 'Focus Next Cell')),
432
432
  keybinding: [
433
433
  {
434
434
  when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
@@ -447,7 +447,7 @@ registerAction2(class extends NotebookAction {
447
447
  constructor() {
448
448
  super({
449
449
  id: 'notebook.cell.chat.focusPreviousCell',
450
- title: ( localize(7691, 'Focus Previous Cell')),
450
+ title: ( localize(7967, 'Focus Previous Cell')),
451
451
  keybinding: [
452
452
  {
453
453
  when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
@@ -466,7 +466,7 @@ registerAction2(class extends NotebookAction {
466
466
  constructor() {
467
467
  super({
468
468
  id: 'notebook.cell.chat.previousFromHistory',
469
- title: ( localize2(7692, "Previous From History")),
469
+ title: ( localize2(7968, "Previous From History")),
470
470
  precondition: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
471
471
  keybinding: {
472
472
  when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
@@ -484,7 +484,7 @@ registerAction2(class extends NotebookAction {
484
484
  constructor() {
485
485
  super({
486
486
  id: 'notebook.cell.chat.nextFromHistory',
487
- title: ( localize2(7693, "Next From History")),
487
+ title: ( localize2(7969, "Next From History")),
488
488
  precondition: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
489
489
  keybinding: {
490
490
  when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
@@ -502,7 +502,7 @@ registerAction2(class extends NotebookCellAction {
502
502
  constructor() {
503
503
  super({
504
504
  id: 'notebook.cell.chat.restore',
505
- title: ( localize2(7694, "Generate")),
505
+ title: ( localize2(7970, "Generate")),
506
506
  icon: Codicon.sparkle,
507
507
  menu: {
508
508
  id: MenuId.NotebookCellTitle,
@@ -533,9 +533,9 @@ class AcceptChangesAndRun extends EditorAction2 {
533
533
  constructor() {
534
534
  super({
535
535
  id: 'notebook.inlineChat.acceptChangesAndRun',
536
- title: ( localize2(7695, "Accept and Run")),
537
- shortTitle: ( localize(7696, 'Accept & Run')),
538
- tooltip: ( localize(7697, 'Accept the changes and run the cell')),
536
+ title: ( localize2(7971, "Accept and Run")),
537
+ shortTitle: ( localize(7972, 'Accept & Run')),
538
+ tooltip: ( localize(7973, 'Accept the changes and run the cell')),
539
539
  icon: Codicon.check,
540
540
  f1: true,
541
541
  precondition: ( ContextKeyExpr.and(( NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true)), CTX_INLINE_CHAT_VISIBLE)),
@@ -15,21 +15,34 @@ import { registerWorkbenchContribution2, WorkbenchPhase } from '@codingame/monac
15
15
  import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
16
16
  import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
17
17
  import { ChatInputPart } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/chat/browser/chatInputPart';
18
- import { ChatDynamicVariableModel } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables';
19
- import { computeCompletionRanges } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions';
20
- import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents';
18
+ import { ChatDynamicVariableModel } from '@codingame/monaco-vscode-bba55be6-41a2-50cd-a3cc-8bafa35bfa89-common/vscode/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables';
19
+ import { computeCompletionRanges } from '@codingame/monaco-vscode-bba55be6-41a2-50cd-a3cc-8bafa35bfa89-common/vscode/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions';
21
20
  import { IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
21
+ import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
22
+ import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
22
23
  import { chatVariableLeader } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/chat/common/chatParserTypes';
23
- import { NOTEBOOK_CELL_OUTPUT_MIME_TYPE_LIST_FOR_CHAT, NOTEBOOK_CELL_HAS_OUTPUTS, NOTEBOOK_CELL_OUTPUT_MIMETYPE } from '@codingame/monaco-vscode-52bb4d5b-ba1a-57fd-9bee-b28824214eac-common/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
24
+ import { NOTEBOOK_CELL_OUTPUT_MIME_TYPE_LIST_FOR_CHAT, NOTEBOOK_CELL_HAS_OUTPUTS, NOTEBOOK_CELL_OUTPUT_MIMETYPE } from '@codingame/monaco-vscode-a1eb43d5-da63-5f76-8ad4-acf0d6c3b749-common/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
24
25
  import { INotebookKernelService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookKernelService.service';
25
26
  import { getNotebookEditorFromEditorPane } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
26
27
  import { copyIcon } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/browser/notebookIcons';
27
28
  import { getOutputViewModelFromId } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/browser/controller/cellOutputActions';
28
29
  import { NOTEBOOK_ACTIONS_CATEGORY } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
30
+ import { CellUri } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
29
31
  import './cellChatActions.js';
30
32
  import { CTX_NOTEBOOK_CHAT_HAS_AGENT } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext';
31
33
 
32
34
  const NotebookKernelVariableKey = 'kernelVariable';
35
+ const NOTEBOOK_CELL_OUTPUT_MIME_TYPE_LIST_FOR_CHAT_CONST = ['text/plain', 'text/html',
36
+ 'application/vnd.code.notebook.error',
37
+ 'application/vnd.code.notebook.stdout',
38
+ 'application/x.notebook.stdout',
39
+ 'application/x.notebook.stream',
40
+ 'application/vnd.code.notebook.stderr',
41
+ 'application/x.notebook.stderr',
42
+ 'image/png',
43
+ 'image/jpeg',
44
+ 'image/svg',
45
+ ];
33
46
  let NotebookChatContribution = class NotebookChatContribution extends Disposable {
34
47
  static { this.ID = 'workbench.contrib.notebookChatContribution'; }
35
48
  constructor(contextKeyService, chatAgentService, editorService, chatWidgetService, notebookKernelService, languageFeaturesService) {
@@ -71,7 +84,7 @@ let NotebookChatContribution = class NotebookChatContribution extends Disposable
71
84
  result.suggestions.push({
72
85
  label: `${chatVariableLeader}${NotebookKernelVariableKey}`,
73
86
  insertText: `${chatVariableLeader}${NotebookKernelVariableKey}:`,
74
- detail: ( localize(7698, "Pick a variable from the kernel")),
87
+ detail: ( localize(7974, "Pick a variable from the kernel")),
75
88
  range,
76
89
  kind: CompletionItemKind.Text,
77
90
  command: { id: SelectAndInsertKernelVariableAction.ID, title: SelectAndInsertKernelVariableAction.ID, arguments: [{ widget, range: afterRange }] },
@@ -81,7 +94,7 @@ let NotebookChatContribution = class NotebookChatContribution extends Disposable
81
94
  return result;
82
95
  }
83
96
  }));
84
- NOTEBOOK_CELL_OUTPUT_MIME_TYPE_LIST_FOR_CHAT.bindTo(contextKeyService).set(['image/png']);
97
+ NOTEBOOK_CELL_OUTPUT_MIME_TYPE_LIST_FOR_CHAT.bindTo(contextKeyService).set(NOTEBOOK_CELL_OUTPUT_MIME_TYPE_LIST_FOR_CHAT_CONST);
85
98
  }
86
99
  async addKernelVariableCompletion(widget, result, info, token) {
87
100
  let pattern;
@@ -203,7 +216,7 @@ registerAction2(class CopyCellOutputAction extends Action2 {
203
216
  constructor() {
204
217
  super({
205
218
  id: 'notebook.cellOutput.addToChat',
206
- title: ( localize(7699, "Add Cell Output to Chat")),
219
+ title: ( localize(7975, "Add Cell Output to Chat")),
207
220
  menu: {
208
221
  id: MenuId.NotebookOutputToolbar,
209
222
  when: ( ContextKeyExpr.and(
@@ -214,6 +227,7 @@ registerAction2(class CopyCellOutputAction extends Action2 {
214
227
  },
215
228
  category: NOTEBOOK_ACTIONS_CATEGORY,
216
229
  icon: copyIcon,
230
+ precondition: ChatContextKeys.enabled
217
231
  });
218
232
  }
219
233
  getNoteboookEditor(editorService, outputContext) {
@@ -252,36 +266,45 @@ registerAction2(class CopyCellOutputAction extends Action2 {
252
266
  return;
253
267
  }
254
268
  const mimeType = outputViewModel.pickedMimeType?.mimeType;
255
- if (mimeType === 'image/png') {
256
- const chatWidgetService = accessor.get(IChatWidgetService);
257
- const widget = chatWidgetService.lastFocusedWidget;
258
- if (!widget) {
269
+ const chatWidgetService = accessor.get(IChatWidgetService);
270
+ let widget = chatWidgetService.lastFocusedWidget;
271
+ if (!widget) {
272
+ const widgets = chatWidgetService.getWidgetsByLocations(ChatAgentLocation.Panel);
273
+ if (widgets.length === 0) {
259
274
  return;
260
275
  }
261
- const imageOutput = outputViewModel.model.outputs.find(output => output.mime === mimeType);
262
- if (!imageOutput) {
276
+ widget = widgets[0];
277
+ }
278
+ if (mimeType && NOTEBOOK_CELL_OUTPUT_MIME_TYPE_LIST_FOR_CHAT_CONST.includes(mimeType)) {
279
+ const cellFromViewModelHandle = outputViewModel.cellViewModel.handle;
280
+ const cell = notebookEditor.getCellByHandle(cellFromViewModelHandle);
281
+ if (!cell) {
263
282
  return;
264
283
  }
265
- const attachedVariables = widget.attachmentModel.attachments;
266
- const displayName = ( localize(7700, 'Notebook Cell Output Image'));
267
- let tempDisplayName = displayName;
268
- for (let appendValue = 2; ( attachedVariables.some(attachment => attachment.name === tempDisplayName)); appendValue++) {
269
- tempDisplayName = `${displayName} ${appendValue}`;
284
+ const cellUri = cell.uri;
285
+ const outputId = outputViewModel?.model.outputId;
286
+ let outputIndex = 0;
287
+ if (outputId !== undefined) {
288
+ outputIndex = cell.outputsViewModels.findIndex(output => {
289
+ return output.model.outputId === outputId;
290
+ });
291
+ }
292
+ let notebookUri = notebookEditor.textModel?.uri;
293
+ if (!notebookUri) {
294
+ const parsedCellUri = CellUri.parse(cellUri);
295
+ notebookUri = parsedCellUri?.notebook;
296
+ if (!notebookUri) {
297
+ return;
298
+ }
270
299
  }
271
- const imageData = imageOutput.data;
272
- const variableEntry = {
273
- kind: 'paste',
274
- code: '',
275
- language: '',
276
- pastedLines: '',
277
- fileName: 'notebook-cell-output-image-' + outputViewModel.model.outputId,
278
- copiedFrom: undefined,
279
- id: 'notebook-cell-output-image-' + outputViewModel.model.outputId,
280
- name: tempDisplayName,
281
- isImage: true,
282
- value: imageData.buffer,
300
+ const outputCellUri = CellUri.generateCellOutputUriWithIndex(notebookUri, cellUri, outputIndex);
301
+ const l = {
302
+ value: outputCellUri,
303
+ id: ( outputCellUri.toString()),
304
+ name: ( outputCellUri.toString()),
305
+ isFile: true,
283
306
  };
284
- widget.attachmentModel.addContext(variableEntry);
307
+ widget.attachmentModel.addContext(l);
285
308
  }
286
309
  }
287
310
  });