@codingame/monaco-vscode-extensions-service-override 4.0.0 → 4.1.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 (109) hide show
  1. package/extensions.js +6 -6
  2. package/package.json +9 -9
  3. package/_virtual/semver.js +0 -3
  4. package/external/vscode-semver/semver.js +0 -985
  5. package/override/vs/workbench/browser/parts/editor/textEditor.weak.js +0 -8
  6. package/vscode/src/vs/base/common/console.js +0 -62
  7. package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +0 -497
  8. package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.js +0 -44
  9. package/vscode/src/vs/platform/lifecycle/common/lifecycle.js +0 -27
  10. package/vscode/src/vs/platform/remote/common/managedSocket.js +0 -98
  11. package/vscode/src/vs/workbench/api/browser/extensionHost.contribution.js +0 -104
  12. package/vscode/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.js +0 -31
  13. package/vscode/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.js +0 -35
  14. package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +0 -254
  15. package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +0 -68
  16. package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +0 -103
  17. package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +0 -70
  18. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +0 -207
  19. package/vscode/src/vs/workbench/api/browser/mainThreadChatVariables.js +0 -41
  20. package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.js +0 -24
  21. package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +0 -108
  22. package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +0 -98
  23. package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +0 -560
  24. package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.js +0 -80
  25. package/vscode/src/vs/workbench/api/browser/mainThreadConsole.js +0 -35
  26. package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +0 -579
  27. package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +0 -435
  28. package/vscode/src/vs/workbench/api/browser/mainThreadDecorations.js +0 -102
  29. package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +0 -69
  30. package/vscode/src/vs/workbench/api/browser/mainThreadDialogs.js +0 -68
  31. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +0 -79
  32. package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +0 -253
  33. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +0 -370
  34. package/vscode/src/vs/workbench/api/browser/mainThreadDownloadService.js +0 -22
  35. package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +0 -41
  36. package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +0 -414
  37. package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +0 -501
  38. package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +0 -227
  39. package/vscode/src/vs/workbench/api/browser/mainThreadErrors.js +0 -24
  40. package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +0 -317
  41. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +0 -208
  42. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +0 -369
  43. package/vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js +0 -72
  44. package/vscode/src/vs/workbench/api/browser/mainThreadInteractive.js +0 -28
  45. package/vscode/src/vs/workbench/api/browser/mainThreadIssueReporter.js +0 -50
  46. package/vscode/src/vs/workbench/api/browser/mainThreadLabelService.js +0 -27
  47. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +0 -1016
  48. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +0 -185
  49. package/vscode/src/vs/workbench/api/browser/mainThreadLanguages.js +0 -78
  50. package/vscode/src/vs/workbench/api/browser/mainThreadLocalization.js +0 -35
  51. package/vscode/src/vs/workbench/api/browser/mainThreadLogService.js +0 -78
  52. package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +0 -93
  53. package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +0 -137
  54. package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +0 -194
  55. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.js +0 -123
  56. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +0 -188
  57. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.js +0 -129
  58. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +0 -131
  59. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +0 -374
  60. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookRenderers.js +0 -25
  61. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +0 -48
  62. package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +0 -76
  63. package/vscode/src/vs/workbench/api/browser/mainThreadProfileContentHandlers.js +0 -38
  64. package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +0 -68
  65. package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.js +0 -42
  66. package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.js +0 -185
  67. package/vscode/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.js +0 -30
  68. package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +0 -493
  69. package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +0 -49
  70. package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +0 -168
  71. package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +0 -70
  72. package/vscode/src/vs/workbench/api/browser/mainThreadShare.js +0 -50
  73. package/vscode/src/vs/workbench/api/browser/mainThreadSpeech.js +0 -99
  74. package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.js +0 -53
  75. package/vscode/src/vs/workbench/api/browser/mainThreadStorage.js +0 -72
  76. package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +0 -731
  77. package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +0 -53
  78. package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +0 -409
  79. package/vscode/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.js +0 -51
  80. package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +0 -219
  81. package/vscode/src/vs/workbench/api/browser/mainThreadTheming.js +0 -24
  82. package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.js +0 -55
  83. package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +0 -312
  84. package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +0 -223
  85. package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +0 -110
  86. package/vscode/src/vs/workbench/api/browser/mainThreadUrls.js +0 -61
  87. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewManager.js +0 -29
  88. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +0 -283
  89. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewViews.js +0 -100
  90. package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +0 -135
  91. package/vscode/src/vs/workbench/api/browser/mainThreadWindow.js +0 -57
  92. package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +0 -268
  93. package/vscode/src/vs/workbench/api/common/shared/dataTransferCache.js +0 -35
  94. package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +0 -76
  95. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +0 -83
  96. package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +0 -285
  97. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +0 -276
  98. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +0 -52
  99. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +0 -1149
  100. package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +0 -41
  101. package/vscode/src/vs/workbench/services/extensions/common/extensionDevOptions.js +0 -25
  102. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +0 -512
  103. package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +0 -274
  104. package/vscode/src/vs/workbench/services/extensions/common/extensionStorageMigration.js +0 -58
  105. package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +0 -80
  106. package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +0 -64
  107. package/vscode/src/vs/workbench/services/extensions/common/lazyCreateExtensionHostManager.js +0 -161
  108. package/vscode/src/vs/workbench/services/extensions/common/remoteConsoleUtil.js +0 -49
  109. package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +0 -222
@@ -1,131 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
- import { DisposableStore, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
3
- import { equals } from 'vscode/vscode/vs/base/common/objects';
4
- import { URI } from 'vscode/vscode/vs/base/common/uri';
5
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
6
- import { EditorActivation } from 'vscode/vscode/vs/platform/editor/common/editor';
7
- import { getNotebookEditorFromEditorPane } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
8
- import { INotebookEditorService } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService';
9
- import { editorGroupToColumn, columnToEditorGroup } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupColumn';
10
- import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
11
- import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
12
- import { ExtHostContext, NotebookEditorRevealType } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
13
-
14
- class MainThreadNotebook {
15
- constructor(editor, disposables) {
16
- this.editor = editor;
17
- this.disposables = disposables;
18
- }
19
- dispose() {
20
- this.disposables.dispose();
21
- }
22
- }
23
- let MainThreadNotebookEditors = class MainThreadNotebookEditors {
24
- constructor(extHostContext, _editorService, _notebookEditorService, _editorGroupService, _configurationService) {
25
- this._editorService = _editorService;
26
- this._notebookEditorService = _notebookEditorService;
27
- this._editorGroupService = _editorGroupService;
28
- this._configurationService = _configurationService;
29
- this._disposables = ( new DisposableStore());
30
- this._mainThreadEditors = ( new Map());
31
- this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostNotebookEditors));
32
- this._editorService.onDidActiveEditorChange(() => this._updateEditorViewColumns(), this, this._disposables);
33
- this._editorGroupService.onDidRemoveGroup(() => this._updateEditorViewColumns(), this, this._disposables);
34
- this._editorGroupService.onDidMoveGroup(() => this._updateEditorViewColumns(), this, this._disposables);
35
- }
36
- dispose() {
37
- this._disposables.dispose();
38
- dispose(( this._mainThreadEditors.values()));
39
- }
40
- handleEditorsAdded(editors) {
41
- for (const editor of editors) {
42
- const editorDisposables = ( new DisposableStore());
43
- editorDisposables.add(editor.onDidChangeVisibleRanges(() => {
44
- this._proxy.$acceptEditorPropertiesChanged(editor.getId(), { visibleRanges: { ranges: editor.visibleRanges } });
45
- }));
46
- editorDisposables.add(editor.onDidChangeSelection(() => {
47
- this._proxy.$acceptEditorPropertiesChanged(editor.getId(), { selections: { selections: editor.getSelections() } });
48
- }));
49
- const wrapper = ( new MainThreadNotebook(editor, editorDisposables));
50
- this._mainThreadEditors.set(editor.getId(), wrapper);
51
- }
52
- }
53
- handleEditorsRemoved(editorIds) {
54
- for (const id of editorIds) {
55
- this._mainThreadEditors.get(id)?.dispose();
56
- this._mainThreadEditors.delete(id);
57
- }
58
- }
59
- _updateEditorViewColumns() {
60
- const result = Object.create(null);
61
- for (const editorPane of this._editorService.visibleEditorPanes) {
62
- const candidate = getNotebookEditorFromEditorPane(editorPane);
63
- if (candidate && ( this._mainThreadEditors.has(candidate.getId()))) {
64
- result[candidate.getId()] = editorGroupToColumn(this._editorGroupService, editorPane.group);
65
- }
66
- }
67
- if (!equals(result, this._currentViewColumnInfo)) {
68
- this._currentViewColumnInfo = result;
69
- this._proxy.$acceptEditorViewColumns(result);
70
- }
71
- }
72
- async $tryShowNotebookDocument(resource, viewType, options) {
73
- const editorOptions = {
74
- cellSelections: options.selections,
75
- preserveFocus: options.preserveFocus,
76
- pinned: options.pinned,
77
- activation: options.preserveFocus ? EditorActivation.RESTORE : undefined,
78
- override: viewType
79
- };
80
- const editorPane = await this._editorService.openEditor({ resource: URI.revive(resource), options: editorOptions }, columnToEditorGroup(this._editorGroupService, this._configurationService, options.position));
81
- const notebookEditor = getNotebookEditorFromEditorPane(editorPane);
82
- if (notebookEditor) {
83
- return notebookEditor.getId();
84
- }
85
- else {
86
- throw new Error(`Notebook Editor creation failure for document ${JSON.stringify(resource)}`);
87
- }
88
- }
89
- async $tryRevealRange(id, range, revealType) {
90
- const editor = this._notebookEditorService.getNotebookEditor(id);
91
- if (!editor) {
92
- return;
93
- }
94
- const notebookEditor = editor;
95
- if (!notebookEditor.hasModel()) {
96
- return;
97
- }
98
- if (range.start >= notebookEditor.getLength()) {
99
- return;
100
- }
101
- const cell = notebookEditor.cellAt(range.start);
102
- switch (revealType) {
103
- case NotebookEditorRevealType.Default:
104
- return notebookEditor.revealCellRangeInView(range);
105
- case NotebookEditorRevealType.InCenter:
106
- return notebookEditor.revealInCenter(cell);
107
- case NotebookEditorRevealType.InCenterIfOutsideViewport:
108
- return notebookEditor.revealInCenterIfOutsideViewport(cell);
109
- case NotebookEditorRevealType.AtTop:
110
- return notebookEditor.revealInViewAtTop(cell);
111
- }
112
- }
113
- $trySetSelections(id, ranges) {
114
- const editor = this._notebookEditorService.getNotebookEditor(id);
115
- if (!editor) {
116
- return;
117
- }
118
- editor.setSelections(ranges);
119
- if (ranges.length) {
120
- editor.setFocus({ start: ranges[0].start, end: ranges[0].start + 1 });
121
- }
122
- }
123
- };
124
- MainThreadNotebookEditors = ( __decorate([
125
- ( __param(1, IEditorService)),
126
- ( __param(2, INotebookEditorService)),
127
- ( __param(3, IEditorGroupsService)),
128
- ( __param(4, IConfigurationService))
129
- ], MainThreadNotebookEditors));
130
-
131
- export { MainThreadNotebookEditors };
@@ -1,374 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
- import { isNonEmptyArray } from 'vscode/vscode/vs/base/common/arrays';
3
- import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
4
- import { onUnexpectedError } from 'vscode/vscode/vs/base/common/errors';
5
- import { Emitter } from 'vscode/vscode/vs/base/common/event';
6
- import { DisposableMap, DisposableStore, toDisposable, combinedDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
7
- import { URI } from 'vscode/vscode/vs/base/common/uri';
8
- import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
9
- import { NotebookDto } from './mainThreadNotebookDto.js';
10
- import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
11
- import { INotebookEditorService } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService';
12
- import { INotebookExecutionStateService, NotebookExecutionType } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService';
13
- import { INotebookKernelService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService';
14
- import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
15
- import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
16
- import { AsyncIterableSource } from 'vscode/vscode/vs/base/common/async';
17
-
18
- class MainThreadKernel {
19
- get preloadUris() {
20
- return ( this.preloads.map(p => p.uri));
21
- }
22
- get preloadProvides() {
23
- return this.preloads.flatMap(p => p.provides);
24
- }
25
- constructor(data, _languageService) {
26
- this._languageService = _languageService;
27
- this._onDidChange = ( new Emitter());
28
- this.onDidChange = this._onDidChange.event;
29
- this.id = data.id;
30
- this.viewType = data.notebookType;
31
- this.extension = data.extensionId;
32
- this.implementsInterrupt = data.supportsInterrupt ?? false;
33
- this.label = data.label;
34
- this.description = data.description;
35
- this.detail = data.detail;
36
- this.supportedLanguages = isNonEmptyArray(data.supportedLanguages) ? data.supportedLanguages : _languageService.getRegisteredLanguageIds();
37
- this.implementsExecutionOrder = data.supportsExecutionOrder ?? false;
38
- this.hasVariableProvider = data.hasVariableProvider ?? false;
39
- this.localResourceRoot = URI.revive(data.extensionLocation);
40
- this.preloads = data.preloads?.map(u => ({ uri: URI.revive(u.uri), provides: u.provides })) ?? [];
41
- }
42
- update(data) {
43
- const event = Object.create(null);
44
- if (data.label !== undefined) {
45
- this.label = data.label;
46
- event.label = true;
47
- }
48
- if (data.description !== undefined) {
49
- this.description = data.description;
50
- event.description = true;
51
- }
52
- if (data.detail !== undefined) {
53
- this.detail = data.detail;
54
- event.detail = true;
55
- }
56
- if (data.supportedLanguages !== undefined) {
57
- this.supportedLanguages = isNonEmptyArray(data.supportedLanguages) ? data.supportedLanguages : this._languageService.getRegisteredLanguageIds();
58
- event.supportedLanguages = true;
59
- }
60
- if (data.supportsExecutionOrder !== undefined) {
61
- this.implementsExecutionOrder = data.supportsExecutionOrder;
62
- event.hasExecutionOrder = true;
63
- }
64
- if (data.supportsInterrupt !== undefined) {
65
- this.implementsInterrupt = data.supportsInterrupt;
66
- event.hasInterruptHandler = true;
67
- }
68
- if (data.hasVariableProvider !== undefined) {
69
- this.hasVariableProvider = data.hasVariableProvider;
70
- event.hasVariableProvider = true;
71
- }
72
- this._onDidChange.fire(event);
73
- }
74
- }
75
- class MainThreadKernelDetectionTask {
76
- constructor(notebookType) {
77
- this.notebookType = notebookType;
78
- }
79
- }
80
- let MainThreadNotebookKernels = class MainThreadNotebookKernels {
81
- constructor(extHostContext, _languageService, _notebookKernelService, _notebookExecutionStateService, _notebookService, notebookEditorService) {
82
- this._languageService = _languageService;
83
- this._notebookKernelService = _notebookKernelService;
84
- this._notebookExecutionStateService = _notebookExecutionStateService;
85
- this._notebookService = _notebookService;
86
- this._editors = ( new DisposableMap());
87
- this._disposables = ( new DisposableStore());
88
- this._kernels = ( new Map());
89
- this._kernelDetectionTasks = ( new Map());
90
- this._kernelSourceActionProviders = ( new Map());
91
- this._kernelSourceActionProvidersEventRegistrations = ( new Map());
92
- this._executions = ( new Map());
93
- this._notebookExecutions = ( new Map());
94
- this.variableRequestIndex = 0;
95
- this.variableRequestMap = ( new Map());
96
- this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostNotebookKernels));
97
- notebookEditorService.listNotebookEditors().forEach(this._onEditorAdd, this);
98
- notebookEditorService.onDidAddNotebookEditor(this._onEditorAdd, this, this._disposables);
99
- notebookEditorService.onDidRemoveNotebookEditor(this._onEditorRemove, this, this._disposables);
100
- this._disposables.add(toDisposable(() => {
101
- this._executions.forEach(e => {
102
- e.complete({});
103
- });
104
- this._notebookExecutions.forEach(e => e.complete());
105
- }));
106
- this._disposables.add(this._notebookExecutionStateService.onDidChangeExecution(e => {
107
- if (e.type === NotebookExecutionType.cell) {
108
- this._proxy.$cellExecutionChanged(e.notebook, e.cellHandle, e.changed?.state);
109
- }
110
- }));
111
- }
112
- dispose() {
113
- this._disposables.dispose();
114
- for (const [, registration] of ( this._kernels.values())) {
115
- registration.dispose();
116
- }
117
- for (const [, registration] of ( this._kernelDetectionTasks.values())) {
118
- registration.dispose();
119
- }
120
- for (const [, registration] of ( this._kernelSourceActionProviders.values())) {
121
- registration.dispose();
122
- }
123
- this._editors.dispose();
124
- }
125
- _onEditorAdd(editor) {
126
- const ipcListener = editor.onDidReceiveMessage(e => {
127
- if (!editor.hasModel()) {
128
- return;
129
- }
130
- const { selected } = this._notebookKernelService.getMatchingKernel(editor.textModel);
131
- if (!selected) {
132
- return;
133
- }
134
- for (const [handle, candidate] of this._kernels) {
135
- if (candidate[0] === selected) {
136
- this._proxy.$acceptKernelMessageFromRenderer(handle, editor.getId(), e.message);
137
- break;
138
- }
139
- }
140
- });
141
- this._editors.set(editor, ipcListener);
142
- }
143
- _onEditorRemove(editor) {
144
- this._editors.deleteAndDispose(editor);
145
- }
146
- async $postMessage(handle, editorId, message) {
147
- const tuple = this._kernels.get(handle);
148
- if (!tuple) {
149
- throw new Error('kernel already disposed');
150
- }
151
- const [kernel] = tuple;
152
- let didSend = false;
153
- for (const [editor] of this._editors) {
154
- if (!editor.hasModel()) {
155
- continue;
156
- }
157
- if (this._notebookKernelService.getMatchingKernel(editor.textModel).selected !== kernel) {
158
- continue;
159
- }
160
- if (editorId === undefined) {
161
- editor.postMessage(message);
162
- didSend = true;
163
- }
164
- else if (editor.getId() === editorId) {
165
- editor.postMessage(message);
166
- didSend = true;
167
- break;
168
- }
169
- }
170
- return didSend;
171
- }
172
- $receiveVariable(requestId, variable) {
173
- const source = this.variableRequestMap.get(requestId);
174
- if (source) {
175
- source.emitOne(variable);
176
- }
177
- }
178
- async $addKernel(handle, data) {
179
- const that = this;
180
- const kernel = new (class extends MainThreadKernel {
181
- async executeNotebookCellsRequest(uri, handles) {
182
- await that._proxy.$executeCells(handle, uri, handles);
183
- }
184
- async cancelNotebookCellExecution(uri, handles) {
185
- await that._proxy.$cancelCells(handle, uri, handles);
186
- }
187
- provideVariables(notebookUri, parentId, kind, start, token) {
188
- const requestId = `${handle}variables${that.variableRequestIndex++}`;
189
- if (( that.variableRequestMap.has(requestId))) {
190
- return that.variableRequestMap.get(requestId).asyncIterable;
191
- }
192
- const source = ( new AsyncIterableSource());
193
- that.variableRequestMap.set(requestId, source);
194
- that._proxy.$provideVariables(handle, requestId, notebookUri, parentId, kind, start, token).then(() => {
195
- source.resolve();
196
- that.variableRequestMap.delete(requestId);
197
- }).catch((err) => {
198
- source.reject(err);
199
- that.variableRequestMap.delete(requestId);
200
- });
201
- return source.asyncIterable;
202
- }
203
- })(data, this._languageService);
204
- const listener = this._notebookKernelService.onDidChangeSelectedNotebooks(e => {
205
- if (e.oldKernel === kernel.id) {
206
- this._proxy.$acceptNotebookAssociation(handle, e.notebook, false);
207
- }
208
- else if (e.newKernel === kernel.id) {
209
- this._proxy.$acceptNotebookAssociation(handle, e.notebook, true);
210
- }
211
- });
212
- const registration = this._notebookKernelService.registerKernel(kernel);
213
- this._kernels.set(handle, [kernel, combinedDisposable(listener, registration)]);
214
- }
215
- $updateKernel(handle, data) {
216
- const tuple = this._kernels.get(handle);
217
- if (tuple) {
218
- tuple[0].update(data);
219
- }
220
- }
221
- $removeKernel(handle) {
222
- const tuple = this._kernels.get(handle);
223
- if (tuple) {
224
- tuple[1].dispose();
225
- this._kernels.delete(handle);
226
- }
227
- }
228
- $updateNotebookPriority(handle, notebook, value) {
229
- const tuple = this._kernels.get(handle);
230
- if (tuple) {
231
- this._notebookKernelService.updateKernelNotebookAffinity(tuple[0], URI.revive(notebook), value);
232
- }
233
- }
234
- $createExecution(handle, controllerId, rawUri, cellHandle) {
235
- const uri = URI.revive(rawUri);
236
- const notebook = this._notebookService.getNotebookTextModel(uri);
237
- if (!notebook) {
238
- throw new Error(`Notebook not found: ${uri.toString()}`);
239
- }
240
- const kernel = this._notebookKernelService.getMatchingKernel(notebook);
241
- if (!kernel.selected || kernel.selected.id !== controllerId) {
242
- throw new Error(`Kernel is not selected: ${kernel.selected?.id} !== ${controllerId}`);
243
- }
244
- const execution = this._notebookExecutionStateService.createCellExecution(uri, cellHandle);
245
- execution.confirm();
246
- this._executions.set(handle, execution);
247
- }
248
- $updateExecution(handle, data) {
249
- const updates = data.value;
250
- try {
251
- const execution = this._executions.get(handle);
252
- execution?.update(( updates.map(NotebookDto.fromCellExecuteUpdateDto)));
253
- }
254
- catch (e) {
255
- onUnexpectedError(e);
256
- }
257
- }
258
- $completeExecution(handle, data) {
259
- try {
260
- const execution = this._executions.get(handle);
261
- execution?.complete(NotebookDto.fromCellExecuteCompleteDto(data.value));
262
- }
263
- catch (e) {
264
- onUnexpectedError(e);
265
- }
266
- finally {
267
- this._executions.delete(handle);
268
- }
269
- }
270
- $createNotebookExecution(handle, controllerId, rawUri) {
271
- const uri = URI.revive(rawUri);
272
- const notebook = this._notebookService.getNotebookTextModel(uri);
273
- if (!notebook) {
274
- throw new Error(`Notebook not found: ${uri.toString()}`);
275
- }
276
- const kernel = this._notebookKernelService.getMatchingKernel(notebook);
277
- if (!kernel.selected || kernel.selected.id !== controllerId) {
278
- throw new Error(`Kernel is not selected: ${kernel.selected?.id} !== ${controllerId}`);
279
- }
280
- const execution = this._notebookExecutionStateService.createExecution(uri);
281
- execution.confirm();
282
- this._notebookExecutions.set(handle, execution);
283
- }
284
- $beginNotebookExecution(handle) {
285
- try {
286
- const execution = this._notebookExecutions.get(handle);
287
- execution?.begin();
288
- }
289
- catch (e) {
290
- onUnexpectedError(e);
291
- }
292
- }
293
- $completeNotebookExecution(handle) {
294
- try {
295
- const execution = this._notebookExecutions.get(handle);
296
- execution?.complete();
297
- }
298
- catch (e) {
299
- onUnexpectedError(e);
300
- }
301
- finally {
302
- this._notebookExecutions.delete(handle);
303
- }
304
- }
305
- async $addKernelDetectionTask(handle, notebookType) {
306
- const kernelDetectionTask = ( new MainThreadKernelDetectionTask(notebookType));
307
- const registration = this._notebookKernelService.registerNotebookKernelDetectionTask(kernelDetectionTask);
308
- this._kernelDetectionTasks.set(handle, [kernelDetectionTask, registration]);
309
- }
310
- $removeKernelDetectionTask(handle) {
311
- const tuple = this._kernelDetectionTasks.get(handle);
312
- if (tuple) {
313
- tuple[1].dispose();
314
- this._kernelDetectionTasks.delete(handle);
315
- }
316
- }
317
- async $addKernelSourceActionProvider(handle, eventHandle, notebookType) {
318
- const kernelSourceActionProvider = {
319
- viewType: notebookType,
320
- provideKernelSourceActions: async () => {
321
- const actions = await this._proxy.$provideKernelSourceActions(handle, CancellationToken.None);
322
- return ( actions.map(action => {
323
- let documentation = action.documentation;
324
- if (action.documentation && typeof action.documentation !== 'string') {
325
- documentation = URI.revive(action.documentation);
326
- }
327
- return {
328
- label: action.label,
329
- command: action.command,
330
- description: action.description,
331
- detail: action.detail,
332
- documentation,
333
- };
334
- }));
335
- }
336
- };
337
- if (typeof eventHandle === 'number') {
338
- const emitter = ( new Emitter());
339
- this._kernelSourceActionProvidersEventRegistrations.set(eventHandle, emitter);
340
- kernelSourceActionProvider.onDidChangeSourceActions = emitter.event;
341
- }
342
- const registration = this._notebookKernelService.registerKernelSourceActionProvider(notebookType, kernelSourceActionProvider);
343
- this._kernelSourceActionProviders.set(handle, [kernelSourceActionProvider, registration]);
344
- }
345
- $removeKernelSourceActionProvider(handle, eventHandle) {
346
- const tuple = this._kernelSourceActionProviders.get(handle);
347
- if (tuple) {
348
- tuple[1].dispose();
349
- this._kernelSourceActionProviders.delete(handle);
350
- }
351
- if (typeof eventHandle === 'number') {
352
- this._kernelSourceActionProvidersEventRegistrations.delete(eventHandle);
353
- }
354
- }
355
- $emitNotebookKernelSourceActionsChangeEvent(eventHandle) {
356
- const emitter = this._kernelSourceActionProvidersEventRegistrations.get(eventHandle);
357
- if (emitter instanceof Emitter) {
358
- emitter.fire(undefined);
359
- }
360
- }
361
- $variablesUpdated(notebookUri) {
362
- this._notebookKernelService.notifyVariablesChange(URI.revive(notebookUri));
363
- }
364
- };
365
- MainThreadNotebookKernels = __decorate([
366
- extHostNamedCustomer(MainContext.MainThreadNotebookKernels),
367
- ( __param(1, ILanguageService)),
368
- ( __param(2, INotebookKernelService)),
369
- ( __param(3, INotebookExecutionStateService)),
370
- ( __param(4, INotebookService)),
371
- ( __param(5, INotebookEditorService))
372
- ], MainThreadNotebookKernels);
373
-
374
- export { MainThreadNotebookKernels };
@@ -1,25 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
- import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
3
- import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
4
- import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
5
- import { INotebookRendererMessagingService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookRendererMessagingService';
6
-
7
- let MainThreadNotebookRenderers = class MainThreadNotebookRenderers extends Disposable {
8
- constructor(extHostContext, messaging) {
9
- super();
10
- this.messaging = messaging;
11
- this.proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostNotebookRenderers));
12
- this._register(messaging.onShouldPostMessage(e => {
13
- this.proxy.$postRendererMessage(e.editorId, e.rendererId, e.message);
14
- }));
15
- }
16
- $postMessage(editorId, rendererId, message) {
17
- return this.messaging.receiveMessage(editorId, rendererId, message);
18
- }
19
- };
20
- MainThreadNotebookRenderers = __decorate([
21
- extHostNamedCustomer(MainContext.MainThreadNotebookRenderers),
22
- ( __param(1, INotebookRendererMessagingService))
23
- ], MainThreadNotebookRenderers);
24
-
25
- export { MainThreadNotebookRenderers };
@@ -1,48 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
3
- import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
4
- import { extHostCustomer } from '../../services/extensions/common/extHostCustomers.js';
5
- import { ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
6
- import { raceCancellationError } from 'vscode/vscode/vs/base/common/async';
7
- import { IWorkingCopyFileService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService';
8
- import { NotebookFileWorkingCopyModel } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookEditorModel';
9
-
10
- class ExtHostNotebookDocumentSaveParticipant {
11
- constructor(extHostContext) {
12
- this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostNotebookDocumentSaveParticipant));
13
- }
14
- async participate(workingCopy, context, _progress, token) {
15
- if (!workingCopy.model || !(workingCopy.model instanceof NotebookFileWorkingCopyModel)) {
16
- return undefined;
17
- }
18
- let _warningTimeout;
19
- const p = ( new Promise((resolve, reject) => {
20
- _warningTimeout = setTimeout(() => reject(( new Error(( localizeWithPath(
21
- 'vs/workbench/api/browser/mainThreadNotebookSaveParticipant',
22
- 'timeout.onWillSave',
23
- "Aborted onWillSaveNotebookDocument-event after 1750ms"
24
- ))))), 1750);
25
- this._proxy.$participateInSave(workingCopy.resource, context.reason, token).then(_ => {
26
- clearTimeout(_warningTimeout);
27
- return undefined;
28
- }).then(resolve, reject);
29
- }));
30
- return raceCancellationError(p, token);
31
- }
32
- }
33
- let SaveParticipant = class SaveParticipant {
34
- constructor(extHostContext, instantiationService, workingCopyFileService) {
35
- this.workingCopyFileService = workingCopyFileService;
36
- this._saveParticipantDisposable = this.workingCopyFileService.addSaveParticipant(instantiationService.createInstance(ExtHostNotebookDocumentSaveParticipant, extHostContext));
37
- }
38
- dispose() {
39
- this._saveParticipantDisposable.dispose();
40
- }
41
- };
42
- SaveParticipant = __decorate([
43
- extHostCustomer,
44
- ( __param(1, IInstantiationService)),
45
- ( __param(2, IWorkingCopyFileService))
46
- ], SaveParticipant);
47
-
48
- export { SaveParticipant };
@@ -1,76 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
- import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
3
- import { OUTPUT_VIEW_ID, Extensions, OutputChannelUpdateMode, IOutputService } from 'vscode/vscode/vs/workbench/services/output/common/output';
4
- import { ExtHostContext, MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
5
- import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
6
- import { URI } from 'vscode/vscode/vs/base/common/uri';
7
- import { Disposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
8
- import { Event } from 'vscode/vscode/vs/base/common/event';
9
- import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
10
- import { isNumber } from 'vscode/vscode/vs/base/common/types';
11
-
12
- var MainThreadOutputService_1;
13
- let MainThreadOutputService = class MainThreadOutputService extends Disposable {
14
- static { MainThreadOutputService_1 = this; }
15
- static { this._extensionIdPool = ( new Map()); }
16
- constructor(extHostContext, outputService, viewsService) {
17
- super();
18
- this._outputService = outputService;
19
- this._viewsService = viewsService;
20
- this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostOutputService));
21
- const setVisibleChannel = () => {
22
- const visibleChannel = this._viewsService.isViewVisible(OUTPUT_VIEW_ID) ? this._outputService.getActiveChannel() : undefined;
23
- this._proxy.$setVisibleChannel(visibleChannel ? visibleChannel.id : null);
24
- };
25
- this._register(Event.any(this._outputService.onActiveOutputChannel, Event.filter(this._viewsService.onDidChangeViewVisibility, ({ id }) => id === OUTPUT_VIEW_ID))(() => setVisibleChannel()));
26
- setVisibleChannel();
27
- }
28
- async $register(label, file, languageId, extensionId) {
29
- const idCounter = (MainThreadOutputService_1._extensionIdPool.get(extensionId) || 0) + 1;
30
- MainThreadOutputService_1._extensionIdPool.set(extensionId, idCounter);
31
- const id = `extension-output-${extensionId}-#${idCounter}-${label}`;
32
- const resource = URI.revive(file);
33
- ( Registry.as(Extensions.OutputChannels)).registerChannel({ id, label, file: resource, log: false, languageId, extensionId });
34
- this._register(toDisposable(() => this.$dispose(id)));
35
- return id;
36
- }
37
- async $update(channelId, mode, till) {
38
- const channel = this._getChannel(channelId);
39
- if (channel) {
40
- if (mode === OutputChannelUpdateMode.Append) {
41
- channel.update(mode);
42
- }
43
- else if (isNumber(till)) {
44
- channel.update(mode, till);
45
- }
46
- }
47
- }
48
- async $reveal(channelId, preserveFocus) {
49
- const channel = this._getChannel(channelId);
50
- if (channel) {
51
- this._outputService.showChannel(channel.id, preserveFocus);
52
- }
53
- }
54
- async $close(channelId) {
55
- if (this._viewsService.isViewVisible(OUTPUT_VIEW_ID)) {
56
- const activeChannel = this._outputService.getActiveChannel();
57
- if (activeChannel && channelId === activeChannel.id) {
58
- this._viewsService.closeView(OUTPUT_VIEW_ID);
59
- }
60
- }
61
- }
62
- async $dispose(channelId) {
63
- const channel = this._getChannel(channelId);
64
- channel?.dispose();
65
- }
66
- _getChannel(channelId) {
67
- return this._outputService.getChannel(channelId);
68
- }
69
- };
70
- MainThreadOutputService = MainThreadOutputService_1 = __decorate([
71
- extHostNamedCustomer(MainContext.MainThreadOutputService),
72
- ( __param(1, IOutputService)),
73
- ( __param(2, IViewsService))
74
- ], MainThreadOutputService);
75
-
76
- export { MainThreadOutputService };