@codingame/monaco-vscode-notebook-service-override 4.1.0 → 4.1.2
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.
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
- package/external/tslib/tslib.es6.js +11 -0
- package/notebook.js +12 -12
- package/override/vs/platform/dialogs/common/dialogs.js +10 -0
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +391 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +109 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +173 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +544 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +106 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +67 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +165 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +67 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +320 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +72 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/media/notebookFind.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +168 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +209 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +84 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +82 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +67 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +101 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +393 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +5 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +97 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +120 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +60 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +150 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +656 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +77 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +517 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +159 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +56 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +94 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +51 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +652 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +721 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +351 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +315 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +199 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +47 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +1297 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +284 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +563 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +115 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +39 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +313 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +911 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +13 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +395 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +185 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +1187 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibility.js +159 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +451 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +192 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +106 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +510 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +130 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +341 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +111 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +28 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +65 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +641 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +200 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +90 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +1002 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +103 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +203 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +80 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.js +98 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +89 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +386 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +408 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +144 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.js +129 -0
package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
+
import { ResourceMap } from 'vscode/vscode/vs/base/common/map';
|
|
4
|
+
import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
|
|
5
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
6
|
+
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
7
|
+
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
8
|
+
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding';
|
|
9
|
+
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
10
|
+
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
11
|
+
import { CHANGE_CELL_LANGUAGE, DETECT_CELL_LANGUAGE } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
12
|
+
import { INotebookCellStatusBarService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCellStatusBarService';
|
|
13
|
+
import { CellKind } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
14
|
+
import { INotebookKernelService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService';
|
|
15
|
+
import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
|
|
16
|
+
import { ILanguageDetectionService } from 'vscode/vscode/vs/workbench/services/languageDetection/common/languageDetectionWorkerService';
|
|
17
|
+
|
|
18
|
+
let CellStatusBarLanguagePickerProvider = class CellStatusBarLanguagePickerProvider {
|
|
19
|
+
constructor(_notebookService, _languageService) {
|
|
20
|
+
this._notebookService = _notebookService;
|
|
21
|
+
this._languageService = _languageService;
|
|
22
|
+
this.viewType = '*';
|
|
23
|
+
}
|
|
24
|
+
async provideCellStatusBarItems(uri, index, _token) {
|
|
25
|
+
const doc = this._notebookService.getNotebookTextModel(uri);
|
|
26
|
+
const cell = doc?.cells[index];
|
|
27
|
+
if (!cell) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const statusBarItems = [];
|
|
31
|
+
let displayLanguage = cell.language;
|
|
32
|
+
if (cell.cellKind === CellKind.Markup) {
|
|
33
|
+
displayLanguage = 'markdown';
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
const registeredId = this._languageService.getLanguageIdByLanguageName(cell.language);
|
|
37
|
+
if (registeredId) {
|
|
38
|
+
displayLanguage = this._languageService.getLanguageName(displayLanguage) ?? displayLanguage;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
const searchTooltip = ( localizeWithPath(
|
|
42
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders',
|
|
43
|
+
'notebook.cell.status.searchLanguageExtensions',
|
|
44
|
+
"Unknown cell language. Click to search for '{0}' extensions",
|
|
45
|
+
cell.language
|
|
46
|
+
));
|
|
47
|
+
statusBarItems.push({
|
|
48
|
+
text: `$(dialog-warning)`,
|
|
49
|
+
command: { id: 'workbench.extensions.search', arguments: [`@tag:${cell.language}`], title: 'Search Extensions' },
|
|
50
|
+
tooltip: searchTooltip,
|
|
51
|
+
alignment: 2 ,
|
|
52
|
+
priority: -Number.MAX_SAFE_INTEGER + 1
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
statusBarItems.push({
|
|
57
|
+
text: displayLanguage,
|
|
58
|
+
command: CHANGE_CELL_LANGUAGE,
|
|
59
|
+
tooltip: ( localizeWithPath(
|
|
60
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders',
|
|
61
|
+
'notebook.cell.status.language',
|
|
62
|
+
"Select Cell Language Mode"
|
|
63
|
+
)),
|
|
64
|
+
alignment: 2 ,
|
|
65
|
+
priority: -Number.MAX_SAFE_INTEGER
|
|
66
|
+
});
|
|
67
|
+
return {
|
|
68
|
+
items: statusBarItems
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
CellStatusBarLanguagePickerProvider = ( __decorate([
|
|
73
|
+
( __param(0, INotebookService)),
|
|
74
|
+
( __param(1, ILanguageService))
|
|
75
|
+
], CellStatusBarLanguagePickerProvider));
|
|
76
|
+
let CellStatusBarLanguageDetectionProvider = class CellStatusBarLanguageDetectionProvider {
|
|
77
|
+
constructor(_notebookService, _notebookKernelService, _languageService, _configurationService, _languageDetectionService, _keybindingService) {
|
|
78
|
+
this._notebookService = _notebookService;
|
|
79
|
+
this._notebookKernelService = _notebookKernelService;
|
|
80
|
+
this._languageService = _languageService;
|
|
81
|
+
this._configurationService = _configurationService;
|
|
82
|
+
this._languageDetectionService = _languageDetectionService;
|
|
83
|
+
this._keybindingService = _keybindingService;
|
|
84
|
+
this.viewType = '*';
|
|
85
|
+
this.cache = ( new ResourceMap());
|
|
86
|
+
}
|
|
87
|
+
async provideCellStatusBarItems(uri, index, token) {
|
|
88
|
+
const doc = this._notebookService.getNotebookTextModel(uri);
|
|
89
|
+
const cell = doc?.cells[index];
|
|
90
|
+
if (!cell) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const enablementConfig = this._configurationService.getValue('workbench.editor.languageDetectionHints');
|
|
94
|
+
const enabled = typeof enablementConfig === 'object' && enablementConfig?.notebookEditors;
|
|
95
|
+
if (!enabled) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const cellUri = cell.uri;
|
|
99
|
+
const contentVersion = cell.textModel?.getVersionId();
|
|
100
|
+
if (!contentVersion) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const currentLanguageId = cell.cellKind === CellKind.Markup ?
|
|
104
|
+
'markdown' :
|
|
105
|
+
(this._languageService.getLanguageIdByLanguageName(cell.language) || cell.language);
|
|
106
|
+
if (!( this.cache.has(cellUri))) {
|
|
107
|
+
this.cache.set(cellUri, {
|
|
108
|
+
cellLanguage: currentLanguageId,
|
|
109
|
+
updateTimestamp: 0,
|
|
110
|
+
contentVersion: 1,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
const cached = this.cache.get(cellUri);
|
|
114
|
+
if (cached.cellLanguage !== currentLanguageId || (cached.updateTimestamp < Date.now() - 1000 && cached.contentVersion !== contentVersion)) {
|
|
115
|
+
cached.updateTimestamp = Date.now();
|
|
116
|
+
cached.cellLanguage = currentLanguageId;
|
|
117
|
+
cached.contentVersion = contentVersion;
|
|
118
|
+
const kernel = this._notebookKernelService.getSelectedOrSuggestedKernel(doc);
|
|
119
|
+
if (kernel) {
|
|
120
|
+
const supportedLangs = [...kernel.supportedLanguages, 'markdown'];
|
|
121
|
+
cached.guess = await this._languageDetectionService.detectLanguage(cell.uri, supportedLangs);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
const items = [];
|
|
125
|
+
if (cached.guess && currentLanguageId !== cached.guess) {
|
|
126
|
+
const detectedName = this._languageService.getLanguageName(cached.guess) || cached.guess;
|
|
127
|
+
let tooltip = ( localizeWithPath(
|
|
128
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders',
|
|
129
|
+
'notebook.cell.status.autoDetectLanguage',
|
|
130
|
+
"Accept Detected Language: {0}",
|
|
131
|
+
detectedName
|
|
132
|
+
));
|
|
133
|
+
const keybinding = this._keybindingService.lookupKeybinding(DETECT_CELL_LANGUAGE);
|
|
134
|
+
const label = keybinding?.getLabel();
|
|
135
|
+
if (label) {
|
|
136
|
+
tooltip += ` (${label})`;
|
|
137
|
+
}
|
|
138
|
+
items.push({
|
|
139
|
+
text: '$(lightbulb-autofix)',
|
|
140
|
+
command: DETECT_CELL_LANGUAGE,
|
|
141
|
+
tooltip,
|
|
142
|
+
alignment: 2 ,
|
|
143
|
+
priority: -Number.MAX_SAFE_INTEGER + 1
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
return { items };
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
CellStatusBarLanguageDetectionProvider = ( __decorate([
|
|
150
|
+
( __param(0, INotebookService)),
|
|
151
|
+
( __param(1, INotebookKernelService)),
|
|
152
|
+
( __param(2, ILanguageService)),
|
|
153
|
+
( __param(3, IConfigurationService)),
|
|
154
|
+
( __param(4, ILanguageDetectionService)),
|
|
155
|
+
( __param(5, IKeybindingService))
|
|
156
|
+
], CellStatusBarLanguageDetectionProvider));
|
|
157
|
+
let BuiltinCellStatusBarProviders = class BuiltinCellStatusBarProviders extends Disposable {
|
|
158
|
+
constructor(instantiationService, notebookCellStatusBarService) {
|
|
159
|
+
super();
|
|
160
|
+
const builtinProviders = [
|
|
161
|
+
CellStatusBarLanguagePickerProvider,
|
|
162
|
+
CellStatusBarLanguageDetectionProvider,
|
|
163
|
+
];
|
|
164
|
+
builtinProviders.forEach(p => {
|
|
165
|
+
this._register(notebookCellStatusBarService.registerCellStatusBarItemProvider(instantiationService.createInstance(p)));
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
BuiltinCellStatusBarProviders = ( __decorate([
|
|
170
|
+
( __param(0, IInstantiationService)),
|
|
171
|
+
( __param(1, INotebookCellStatusBarService))
|
|
172
|
+
], BuiltinCellStatusBarProviders));
|
|
173
|
+
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(BuiltinCellStatusBarProviders, 3 );
|