@codingame/monaco-vscode-notebook-service-override 5.2.0 → 6.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 (53) hide show
  1. package/package.json +2 -2
  2. package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +26 -22
  3. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +549 -0
  4. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.js +133 -0
  5. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.js +58 -0
  6. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.js +65 -0
  7. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +6 -5
  8. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +29 -27
  9. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +2 -1
  10. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +2 -1
  11. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +6 -6
  12. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +10 -8
  13. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +27 -18
  14. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +32 -24
  15. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +5 -3
  16. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +2 -1
  17. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +2 -2
  18. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +42 -40
  19. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +77 -57
  20. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +184 -99
  21. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +2 -1
  22. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +2 -2
  23. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +2 -2
  24. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +56 -112
  25. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +31 -0
  26. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +10 -14
  27. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +6 -4
  28. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +3 -2
  29. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +10 -8
  30. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +7 -6
  31. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +6 -4
  32. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +21 -15
  33. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +8 -6
  34. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +6 -5
  35. package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +88 -86
  36. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.js +94 -0
  37. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibleView.js +73 -0
  38. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +3 -2
  39. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +6 -6
  40. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +7 -6
  41. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +5 -3
  42. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +6 -3
  43. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +44 -17
  44. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +34 -0
  45. package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +5 -3
  46. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +67 -53
  47. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +11 -3
  48. package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +11 -10
  49. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.js +3 -2
  50. package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +5 -3
  51. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +15 -12
  52. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +4 -2
  53. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibility.js +0 -156
@@ -1,156 +0,0 @@
1
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
2
- import { format } from 'vscode/vscode/vs/base/common/strings';
3
- import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
4
- import { IAccessibleViewService } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibleView.service';
5
- import { getNotebookEditorFromEditorPane } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
6
-
7
- const _moduleId = "vs/workbench/contrib/notebook/browser/notebookAccessibility";
8
- function getAccessibilityHelpText(accessor) {
9
- const keybindingService = accessor.get(IKeybindingService);
10
- const content = [];
11
- content.push(( localizeWithPath(
12
- _moduleId,
13
- 0,
14
- 'The notebook view is a collection of code and markdown cells. Code cells can be executed and will produce output directly below the cell.'
15
- )));
16
- content.push(descriptionForCommand('notebook.cell.edit', ( localizeWithPath(_moduleId, 1, 'The Edit Cell command ({0}) will focus on the cell input.')), ( localizeWithPath(
17
- _moduleId,
18
- 2,
19
- 'The Edit Cell command will focus on the cell input and is currently not triggerable by a keybinding.'
20
- )), keybindingService));
21
- content.push(descriptionForCommand('notebook.cell.quitEdit', ( localizeWithPath(
22
- _moduleId,
23
- 3,
24
- 'The Quit Edit command ({0}) will set focus on the cell container. The default (Escape) key may need to be pressed twice first exit the virtual cursor if active.'
25
- )), ( localizeWithPath(
26
- _moduleId,
27
- 4,
28
- 'The Quit Edit command will set focus on the cell container and is currently not triggerable by a keybinding.'
29
- )), keybindingService));
30
- content.push(descriptionForCommand('notebook.cell.focusInOutput', ( localizeWithPath(
31
- _moduleId,
32
- 5,
33
- 'The Focus Output command ({0}) will set focus in the cell\'s output.'
34
- )), ( localizeWithPath(
35
- _moduleId,
36
- 6,
37
- 'The Quit Edit command will set focus in the cell\'s output and is currently not triggerable by a keybinding.'
38
- )), keybindingService));
39
- content.push(descriptionForCommand('notebook.focusNextEditor', ( localizeWithPath(
40
- _moduleId,
41
- 7,
42
- 'The Focus Next Cell Editor command ({0}) will set focus in the next cell\'s editor.'
43
- )), ( localizeWithPath(
44
- _moduleId,
45
- 8,
46
- 'The Focus Next Cell Editor command will set focus in the next cell\'s editor and is currently not triggerable by a keybinding.'
47
- )), keybindingService));
48
- content.push(descriptionForCommand('notebook.focusPreviousEditor', ( localizeWithPath(
49
- _moduleId,
50
- 9,
51
- 'The Focus Previous Cell Editor command ({0}) will set focus in the previous cell\'s editor.'
52
- )), ( localizeWithPath(
53
- _moduleId,
54
- 10,
55
- 'The Focus Previous Cell Editor command will set focus in the previous cell\'s editor and is currently not triggerable by a keybinding.'
56
- )), keybindingService));
57
- content.push(( localizeWithPath(
58
- _moduleId,
59
- 11,
60
- 'The up and down arrows will also move focus between cells while focused on the outer cell container.'
61
- )));
62
- content.push(descriptionForCommand('notebook.cell.executeAndFocusContainer', ( localizeWithPath(
63
- _moduleId,
64
- 12,
65
- 'The Execute Cell command ({0}) executes the cell that currently has focus.'
66
- )), ( localizeWithPath(
67
- _moduleId,
68
- 13,
69
- 'The Execute Cell command executes the cell that currently has focus and is currently not triggerable by a keybinding.'
70
- )), keybindingService));
71
- content.push(( localizeWithPath(
72
- _moduleId,
73
- 14,
74
- 'The Insert Cell Above/Below commands will create new empty code cells'
75
- )));
76
- content.push(( localizeWithPath(
77
- _moduleId,
78
- 15,
79
- 'The Change Cell to Code/Markdown commands are used to switch between cell types.'
80
- )));
81
- return content.join('\n\n');
82
- }
83
- function descriptionForCommand(commandId, msg, noKbMsg, keybindingService) {
84
- const kb = keybindingService.lookupKeybinding(commandId);
85
- if (kb) {
86
- return format(msg, kb.getAriaLabel());
87
- }
88
- return format(noKbMsg, commandId);
89
- }
90
- async function runAccessibilityHelpAction(accessor, editor) {
91
- const accessibleViewService = accessor.get(IAccessibleViewService);
92
- const helpText = getAccessibilityHelpText(accessor);
93
- accessibleViewService.show({
94
- id: "notebook" ,
95
- verbositySettingKey: "accessibility.verbosity.notebook" ,
96
- provideContent: () => helpText,
97
- onClose: () => {
98
- editor.focus();
99
- },
100
- options: { type: "help" }
101
- });
102
- }
103
- function showAccessibleOutput(accessibleViewService, editorService) {
104
- const activePane = editorService.activeEditorPane;
105
- const notebookEditor = getNotebookEditorFromEditorPane(activePane);
106
- const notebookViewModel = notebookEditor?.getViewModel();
107
- const selections = notebookViewModel?.getSelections();
108
- const notebookDocument = notebookViewModel?.notebookDocument;
109
- if (!selections || !notebookDocument || !notebookEditor?.textModel) {
110
- return false;
111
- }
112
- const viewCell = notebookViewModel.viewCells[selections[0].start];
113
- let outputContent = '';
114
- const decoder = ( (new TextDecoder()));
115
- for (let i = 0; i < viewCell.outputsViewModels.length; i++) {
116
- const outputViewModel = viewCell.outputsViewModels[i];
117
- const outputTextModel = viewCell.model.outputs[i];
118
- const [mimeTypes, pick] = outputViewModel.resolveMimeTypes(notebookEditor.textModel, undefined);
119
- const mimeType = mimeTypes[pick].mimeType;
120
- let buffer = outputTextModel.outputs.find(output => output.mime === mimeType);
121
- if (!buffer || mimeType.startsWith('image')) {
122
- buffer = outputTextModel.outputs.find(output => !output.mime.startsWith('image'));
123
- }
124
- let text = `${mimeType}`;
125
- if (buffer) {
126
- const charLimit = 100_000;
127
- text = decoder.decode(buffer.data.slice(0, charLimit).buffer);
128
- if (buffer.data.byteLength > charLimit) {
129
- text = text + '...(truncated)';
130
- }
131
- if (mimeType.endsWith('error')) {
132
- text = text.replace(/\\u001b\[[0-9;]*m/gi, '').replaceAll('\\n', '\n');
133
- }
134
- }
135
- const index = viewCell.outputsViewModels.length > 1
136
- ? `Cell output ${i + 1} of ${viewCell.outputsViewModels.length}\n`
137
- : '';
138
- outputContent = outputContent.concat(`${index}${text}\n`);
139
- }
140
- if (!outputContent) {
141
- return false;
142
- }
143
- accessibleViewService.show({
144
- id: "notebook" ,
145
- verbositySettingKey: "accessibility.verbosity.notebook" ,
146
- provideContent() { return outputContent; },
147
- onClose() {
148
- notebookEditor?.setFocus(selections[0]);
149
- activePane?.focus();
150
- },
151
- options: { type: "view" }
152
- });
153
- return true;
154
- }
155
-
156
- export { getAccessibilityHelpText, runAccessibilityHelpAction, showAccessibleOutput };