@codingame/monaco-vscode-katex-common 26.1.2 → 26.2.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.
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveCommon.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveCommon.js +11 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +150 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +338 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.js +58 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.d.ts +75 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +364 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/interactiveEditor.css +21 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/media/interactive.css +36 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.d.ts +110 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +692 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.d.ts +40 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +158 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
2
|
+
import { ITextModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service";
|
|
3
|
+
import { ITextResourceConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/textResourceConfiguration.service";
|
|
4
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
5
|
+
import { IFileDialogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service";
|
|
6
|
+
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
7
|
+
import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service";
|
|
8
|
+
import { IInteractiveHistoryService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/interactive/browser/interactiveHistoryService.service";
|
|
9
|
+
import { NotebookTextModel } from "@codingame/monaco-vscode-notebook-service-override/vscode/vs/workbench/contrib/notebook/common/model/notebookTextModel";
|
|
10
|
+
import { ICompositeNotebookEditorInput, NotebookEditorInput } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookEditorInput";
|
|
11
|
+
import { INotebookEditorModelResolverService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookEditorModelResolverService.service";
|
|
12
|
+
import { INotebookService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service";
|
|
13
|
+
import { ICustomEditorLabelService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/customEditorLabelService.service";
|
|
14
|
+
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
15
|
+
import { IExtensionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service";
|
|
16
|
+
import { IFilesConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService.service";
|
|
17
|
+
import { ThemeIcon } from "@codingame/monaco-vscode-api/vscode/vs/base/common/themables";
|
|
18
|
+
import { IWorkbenchEnvironmentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service";
|
|
19
|
+
import { IPathService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service";
|
|
20
|
+
export declare class ReplEditorInput extends NotebookEditorInput implements ICompositeNotebookEditorInput {
|
|
21
|
+
readonly historyService: IInteractiveHistoryService;
|
|
22
|
+
private readonly _textModelService;
|
|
23
|
+
static ID: string;
|
|
24
|
+
private inputModelRef;
|
|
25
|
+
private isScratchpad;
|
|
26
|
+
private label;
|
|
27
|
+
private isDisposing;
|
|
28
|
+
constructor(resource: URI, label: string | undefined, _notebookService: INotebookService, _notebookModelResolverService: INotebookEditorModelResolverService, _fileDialogService: IFileDialogService, labelService: ILabelService, fileService: IFileService, filesConfigurationService: IFilesConfigurationService, extensionService: IExtensionService, editorService: IEditorService, textResourceConfigurationService: ITextResourceConfigurationService, customEditorLabelService: ICustomEditorLabelService, historyService: IInteractiveHistoryService, _textModelService: ITextModelService, configurationService: IConfigurationService, environmentService: IWorkbenchEnvironmentService, pathService: IPathService);
|
|
29
|
+
getIcon(): ThemeIcon | undefined;
|
|
30
|
+
private createEditorLabel;
|
|
31
|
+
get typeId(): string;
|
|
32
|
+
get editorId(): string | undefined;
|
|
33
|
+
getName(): string;
|
|
34
|
+
get editorInputs(): this[];
|
|
35
|
+
get capabilities(): number;
|
|
36
|
+
resolve(): Promise<import("@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon").IResolvedNotebookEditorModel | null>;
|
|
37
|
+
private ensureInputBoxCell;
|
|
38
|
+
resolveInput(notebook: NotebookTextModel): Promise<import("@codingame/monaco-vscode-api/vscode/vs/editor/common/model").ITextModel>;
|
|
39
|
+
dispose(): void;
|
|
40
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { ITextModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service';
|
|
4
|
+
import { ITextResourceConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/textResourceConfiguration.service';
|
|
5
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
6
|
+
import { IFileDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
7
|
+
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
8
|
+
import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
|
|
9
|
+
import { EditorInputCapabilities } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
|
|
10
|
+
import { IInteractiveHistoryService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/interactive/browser/interactiveHistoryService.service';
|
|
11
|
+
import { NotebookSetting, CellKind, CellEditType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
12
|
+
import { NotebookEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookEditorInput';
|
|
13
|
+
import { INotebookEditorModelResolverService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookEditorModelResolverService.service';
|
|
14
|
+
import { INotebookService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
|
|
15
|
+
import { ICustomEditorLabelService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/customEditorLabelService.service';
|
|
16
|
+
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
17
|
+
import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
18
|
+
import { IFilesConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService.service';
|
|
19
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
20
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
21
|
+
import { registerIcon } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/iconRegistry';
|
|
22
|
+
import { IWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
23
|
+
import { IPathService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service';
|
|
24
|
+
|
|
25
|
+
var ReplEditorInput_1;
|
|
26
|
+
const replTabIcon = registerIcon("repl-editor-label-icon", Codicon.debugLineByLine, ( localize(10941, "Icon of the REPL editor label.")));
|
|
27
|
+
let ReplEditorInput = class ReplEditorInput extends NotebookEditorInput {
|
|
28
|
+
static {
|
|
29
|
+
ReplEditorInput_1 = this;
|
|
30
|
+
}
|
|
31
|
+
static {
|
|
32
|
+
this.ID = "workbench.editorinputs.replEditorInput";
|
|
33
|
+
}
|
|
34
|
+
constructor(
|
|
35
|
+
resource,
|
|
36
|
+
label,
|
|
37
|
+
_notebookService,
|
|
38
|
+
_notebookModelResolverService,
|
|
39
|
+
_fileDialogService,
|
|
40
|
+
labelService,
|
|
41
|
+
fileService,
|
|
42
|
+
filesConfigurationService,
|
|
43
|
+
extensionService,
|
|
44
|
+
editorService,
|
|
45
|
+
textResourceConfigurationService,
|
|
46
|
+
customEditorLabelService,
|
|
47
|
+
historyService,
|
|
48
|
+
_textModelService,
|
|
49
|
+
configurationService,
|
|
50
|
+
environmentService,
|
|
51
|
+
pathService
|
|
52
|
+
) {
|
|
53
|
+
super(
|
|
54
|
+
resource,
|
|
55
|
+
undefined,
|
|
56
|
+
"jupyter-notebook",
|
|
57
|
+
{},
|
|
58
|
+
_notebookService,
|
|
59
|
+
_notebookModelResolverService,
|
|
60
|
+
_fileDialogService,
|
|
61
|
+
labelService,
|
|
62
|
+
fileService,
|
|
63
|
+
filesConfigurationService,
|
|
64
|
+
extensionService,
|
|
65
|
+
editorService,
|
|
66
|
+
textResourceConfigurationService,
|
|
67
|
+
customEditorLabelService,
|
|
68
|
+
environmentService,
|
|
69
|
+
pathService
|
|
70
|
+
);
|
|
71
|
+
this.historyService = historyService;
|
|
72
|
+
this._textModelService = _textModelService;
|
|
73
|
+
this.isDisposing = false;
|
|
74
|
+
this.isScratchpad = resource.scheme === "untitled" && configurationService.getValue(NotebookSetting.InteractiveWindowPromptToSave) !== true;
|
|
75
|
+
this.label = label ?? this.createEditorLabel(resource);
|
|
76
|
+
}
|
|
77
|
+
getIcon() {
|
|
78
|
+
return replTabIcon;
|
|
79
|
+
}
|
|
80
|
+
createEditorLabel(resource) {
|
|
81
|
+
if (!resource) {
|
|
82
|
+
return "REPL";
|
|
83
|
+
}
|
|
84
|
+
if (resource.scheme === "untitled") {
|
|
85
|
+
const match = ( new RegExp("Untitled-(\\d+).")).exec(resource.path);
|
|
86
|
+
if (match?.length === 2) {
|
|
87
|
+
return `REPL - ${match[1]}`;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const filename = resource.path.split("/").pop();
|
|
91
|
+
return filename ? `REPL - ${filename}` : "REPL";
|
|
92
|
+
}
|
|
93
|
+
get typeId() {
|
|
94
|
+
return ReplEditorInput_1.ID;
|
|
95
|
+
}
|
|
96
|
+
get editorId() {
|
|
97
|
+
return "repl";
|
|
98
|
+
}
|
|
99
|
+
getName() {
|
|
100
|
+
return this.label;
|
|
101
|
+
}
|
|
102
|
+
get editorInputs() {
|
|
103
|
+
return [this];
|
|
104
|
+
}
|
|
105
|
+
get capabilities() {
|
|
106
|
+
const capabilities = super.capabilities;
|
|
107
|
+
const scratchPad = this.isScratchpad ? EditorInputCapabilities.Scratchpad : 0;
|
|
108
|
+
return capabilities | EditorInputCapabilities.Readonly | scratchPad;
|
|
109
|
+
}
|
|
110
|
+
async resolve() {
|
|
111
|
+
const model = await super.resolve();
|
|
112
|
+
if (model) {
|
|
113
|
+
this.ensureInputBoxCell(model.notebook);
|
|
114
|
+
}
|
|
115
|
+
return model;
|
|
116
|
+
}
|
|
117
|
+
ensureInputBoxCell(notebook) {
|
|
118
|
+
const lastCell = notebook.cells[notebook.cells.length - 1];
|
|
119
|
+
if (!lastCell || lastCell.cellKind === CellKind.Markup || lastCell.outputs.length > 0 || lastCell.internalMetadata.executionOrder !== undefined) {
|
|
120
|
+
notebook.applyEdits([{
|
|
121
|
+
editType: CellEditType.Replace,
|
|
122
|
+
index: notebook.cells.length,
|
|
123
|
+
count: 0,
|
|
124
|
+
cells: [{
|
|
125
|
+
cellKind: CellKind.Code,
|
|
126
|
+
language: "python",
|
|
127
|
+
mime: undefined,
|
|
128
|
+
outputs: [],
|
|
129
|
+
source: ""
|
|
130
|
+
}]
|
|
131
|
+
}], true, undefined, () => undefined, undefined, false);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
async resolveInput(notebook) {
|
|
135
|
+
if (this.inputModelRef) {
|
|
136
|
+
return this.inputModelRef.object.textEditorModel;
|
|
137
|
+
}
|
|
138
|
+
const lastCell = notebook.cells[notebook.cells.length - 1];
|
|
139
|
+
if (!lastCell) {
|
|
140
|
+
throw ( new Error("The REPL editor requires at least one cell for the input box."));
|
|
141
|
+
}
|
|
142
|
+
this.inputModelRef = await this._textModelService.createModelReference(lastCell.uri);
|
|
143
|
+
return this.inputModelRef.object.textEditorModel;
|
|
144
|
+
}
|
|
145
|
+
dispose() {
|
|
146
|
+
if (!this.isDisposing) {
|
|
147
|
+
this.isDisposing = true;
|
|
148
|
+
this.editorModelReference?.object.revert({
|
|
149
|
+
soft: true
|
|
150
|
+
});
|
|
151
|
+
this.inputModelRef?.dispose();
|
|
152
|
+
super.dispose();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
ReplEditorInput = ReplEditorInput_1 = ( __decorate([( __param(2, INotebookService)), ( __param(3, INotebookEditorModelResolverService)), ( __param(4, IFileDialogService)), ( __param(5, ILabelService)), ( __param(6, IFileService)), ( __param(7, IFilesConfigurationService)), ( __param(8, IExtensionService)), ( __param(9, IEditorService)), ( __param(10, ITextResourceConfigurationService)), ( __param(11, ICustomEditorLabelService)), ( __param(12, IInteractiveHistoryService)), ( __param(13, ITextModelService)), ( __param(14, IConfigurationService)), ( __param(15, IWorkbenchEnvironmentService)), ( __param(16, IPathService))], ReplEditorInput));
|
|
157
|
+
|
|
158
|
+
export { ReplEditorInput };
|