@codingame/monaco-vscode-extensions-service-override 1.83.7 → 1.83.9

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 (183) hide show
  1. package/assets/webWorkerExtensionHostIframe.html +123 -0
  2. package/extensions.d.ts +12 -13
  3. package/extensions.js +456 -0
  4. package/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
  5. package/external/tslib/tslib.es6.js +11 -0
  6. package/index.d.ts +1 -1
  7. package/index.js +2 -2
  8. package/override/vs/platform/dialogs/common/dialogs.js +8 -0
  9. package/override/vs/workbench/browser/parts/editor/textEditor.weak.js +8 -0
  10. package/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +3 -0
  11. package/package.json +5 -3
  12. package/tools/url.js +10 -0
  13. package/tools.js +5 -0
  14. package/vscode/src/vs/base/common/console.js +59 -0
  15. package/vscode/src/vs/base/common/prefixTree.js +131 -0
  16. package/vscode/src/vs/platform/files/common/watcher.js +71 -0
  17. package/vscode/src/vs/platform/lifecycle/common/lifecycle.js +27 -0
  18. package/vscode/src/vs/platform/log/browser/log.js +26 -0
  19. package/vscode/src/vs/platform/remote/common/managedSocket.js +98 -0
  20. package/vscode/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.js +31 -0
  21. package/vscode/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.js +35 -0
  22. package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +330 -0
  23. package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +68 -0
  24. package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +174 -0
  25. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents.js +52 -0
  26. package/vscode/src/vs/workbench/api/browser/mainThreadChatProvider.js +61 -0
  27. package/vscode/src/vs/workbench/api/browser/mainThreadChatSlashCommands.js +49 -0
  28. package/vscode/src/vs/workbench/api/browser/mainThreadChatVariables.js +31 -0
  29. package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.js +24 -0
  30. package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +107 -0
  31. package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +94 -0
  32. package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +541 -0
  33. package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.js +80 -0
  34. package/vscode/src/vs/workbench/api/browser/mainThreadConsole.js +35 -0
  35. package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +578 -0
  36. package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +387 -0
  37. package/vscode/src/vs/workbench/api/browser/mainThreadDecorations.js +102 -0
  38. package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +69 -0
  39. package/vscode/src/vs/workbench/api/browser/mainThreadDialogs.js +68 -0
  40. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +75 -0
  41. package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +249 -0
  42. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +370 -0
  43. package/vscode/src/vs/workbench/api/browser/mainThreadDownloadService.js +22 -0
  44. package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +41 -0
  45. package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +411 -0
  46. package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +475 -0
  47. package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +227 -0
  48. package/vscode/src/vs/workbench/api/browser/mainThreadErrors.js +24 -0
  49. package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +317 -0
  50. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +280 -0
  51. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +283 -0
  52. package/vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js +68 -0
  53. package/vscode/src/vs/workbench/api/browser/mainThreadInteractive.js +28 -0
  54. package/vscode/src/vs/workbench/api/browser/mainThreadIssueReporter.js +33 -0
  55. package/vscode/src/vs/workbench/api/browser/mainThreadLabelService.js +27 -0
  56. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +947 -0
  57. package/vscode/src/vs/workbench/api/browser/mainThreadLanguages.js +78 -0
  58. package/vscode/src/vs/workbench/api/browser/mainThreadLocalization.js +35 -0
  59. package/vscode/src/vs/workbench/api/browser/mainThreadLogService.js +78 -0
  60. package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +93 -0
  61. package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +118 -0
  62. package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +158 -0
  63. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.js +123 -0
  64. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +188 -0
  65. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.js +129 -0
  66. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +131 -0
  67. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +341 -0
  68. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookRenderers.js +25 -0
  69. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +48 -0
  70. package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +76 -0
  71. package/vscode/src/vs/workbench/api/browser/mainThreadProfilContentHandlers.js +38 -0
  72. package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +68 -0
  73. package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.js +49 -0
  74. package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.js +185 -0
  75. package/vscode/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.js +30 -0
  76. package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +463 -0
  77. package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +49 -0
  78. package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +148 -0
  79. package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +70 -0
  80. package/vscode/src/vs/workbench/api/browser/mainThreadShare.js +50 -0
  81. package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.js +53 -0
  82. package/vscode/src/vs/workbench/api/browser/mainThreadStorage.js +72 -0
  83. package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +731 -0
  84. package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +53 -0
  85. package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +412 -0
  86. package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +182 -0
  87. package/vscode/src/vs/workbench/api/browser/mainThreadTheming.js +24 -0
  88. package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.js +55 -0
  89. package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +313 -0
  90. package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +223 -0
  91. package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +110 -0
  92. package/vscode/src/vs/workbench/api/browser/mainThreadUrls.js +61 -0
  93. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewManager.js +29 -0
  94. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +283 -0
  95. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewViews.js +100 -0
  96. package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +135 -0
  97. package/vscode/src/vs/workbench/api/browser/mainThreadWindow.js +57 -0
  98. package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +273 -0
  99. package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHost.api.impl.d.ts +2 -2
  100. package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostConfiguration.d.ts +3 -3
  101. package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostExtensionService.d.ts +3 -4
  102. package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostManagedSockets.d.ts +2 -2
  103. package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostTerminalService.d.ts +19 -20
  104. package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostTunnelService.d.ts +7 -8
  105. package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostWorkspace.d.ts +25 -26
  106. package/vscode/src/vs/workbench/api/common/shared/dataTransferCache.js +35 -0
  107. package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +217 -0
  108. package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +57 -0
  109. package/vscode/src/vs/workbench/contrib/comments/browser/commentFormActions.js +51 -0
  110. package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +92 -0
  111. package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +648 -0
  112. package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +297 -0
  113. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadAdditionalActions.js +62 -0
  114. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +249 -0
  115. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +109 -0
  116. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadRangeDecorator.js +109 -0
  117. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +331 -0
  118. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +380 -0
  119. package/vscode/src/vs/workbench/contrib/comments/browser/comments.js +5 -0
  120. package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +1196 -0
  121. package/vscode/src/vs/workbench/contrib/comments/browser/commentsFilterOptions.js +19 -0
  122. package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +334 -0
  123. package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +543 -0
  124. package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +178 -0
  125. package/vscode/src/vs/workbench/contrib/comments/browser/media/panel.css.js +6 -0
  126. package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +6 -0
  127. package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +101 -0
  128. package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +57 -0
  129. package/vscode/src/vs/workbench/contrib/comments/common/commentModel.js +145 -0
  130. package/vscode/src/vs/workbench/contrib/comments/common/commentsConfiguration.js +3 -0
  131. package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +73 -0
  132. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +83 -0
  133. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +179 -0
  134. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js +5 -0
  135. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +144 -0
  136. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +482 -0
  137. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +6 -0
  138. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +85 -0
  139. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/editing.js +56 -0
  140. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +110 -0
  141. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +260 -0
  142. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +616 -0
  143. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +309 -0
  144. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/rangeUtils.js +38 -0
  145. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +167 -0
  146. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/telemetry.js +80 -0
  147. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/utils.js +70 -0
  148. package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +3 -0
  149. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +108 -0
  150. package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +506 -0
  151. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +132 -0
  152. package/vscode/src/vs/workbench/contrib/testing/common/getComputedState.js +103 -0
  153. package/vscode/src/vs/workbench/contrib/testing/common/observableValue.js +28 -0
  154. package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +25 -0
  155. package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +336 -0
  156. package/vscode/src/vs/workbench/contrib/testing/common/testingStates.js +46 -0
  157. package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +283 -0
  158. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +273 -0
  159. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +52 -0
  160. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +1093 -0
  161. package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +41 -0
  162. package/vscode/src/vs/workbench/services/extensions/common/extensionDevOptions.js +25 -0
  163. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +643 -0
  164. package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +274 -0
  165. package/vscode/src/vs/workbench/services/extensions/common/extensionStorageMigration.js +58 -0
  166. package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +80 -0
  167. package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +64 -0
  168. package/vscode/src/vs/workbench/services/extensions/common/remoteConsoleUtil.js +49 -0
  169. package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +220 -0
  170. package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +5 -0
  171. package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +79 -0
  172. package/vscode-proposed.d.ts +0 -3872
  173. /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHost.protocol.d.ts +0 -0
  174. /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostExtensionActivator.d.ts +0 -0
  175. /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostFileSystemInfo.d.ts +0 -0
  176. /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostInitDataService.d.ts +0 -0
  177. /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostLocalizationService.d.ts +0 -0
  178. /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostRpcService.d.ts +0 -0
  179. /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostStoragePaths.d.ts +0 -0
  180. /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostTypes.d.ts +0 -0
  181. /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostUriTransformerService.d.ts +0 -0
  182. /package/{dist/main/vscode → vscode}/src/vs/workbench/api/worker/extHostExtensionService.d.ts +0 -0
  183. /package/{dist/main/vscode → vscode}/src/vs/workbench/services/search/common/queryBuilder.d.ts +0 -0
@@ -0,0 +1,83 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
3
+ import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
4
+ import { Memento } from 'vscode/vscode/vs/workbench/common/memento';
5
+ import { updateContributedOpeners } from 'vscode/vscode/vs/workbench/contrib/externalUriOpener/common/configuration';
6
+ import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
7
+
8
+ var ContributedExternalUriOpenersStore_1;
9
+ let ContributedExternalUriOpenersStore = class ContributedExternalUriOpenersStore extends Disposable {
10
+ static { ContributedExternalUriOpenersStore_1 = this; }
11
+ static { this.STORAGE_ID = 'externalUriOpeners'; }
12
+ constructor(storageService, _extensionService) {
13
+ super();
14
+ this._extensionService = _extensionService;
15
+ this._openers = ( new Map());
16
+ this._memento = ( new Memento(ContributedExternalUriOpenersStore_1.STORAGE_ID, storageService));
17
+ this._mementoObject = this._memento.getMemento(0 , 1 );
18
+ for (const [id, value] of Object.entries(this._mementoObject || {})) {
19
+ this.add(id, value.extensionId, { isCurrentlyRegistered: false });
20
+ }
21
+ this.invalidateOpenersOnExtensionsChanged();
22
+ this._register(this._extensionService.onDidChangeExtensions(() => this.invalidateOpenersOnExtensionsChanged()));
23
+ this._register(this._extensionService.onDidChangeExtensionsStatus(() => this.invalidateOpenersOnExtensionsChanged()));
24
+ }
25
+ didRegisterOpener(id, extensionId) {
26
+ this.add(id, extensionId, {
27
+ isCurrentlyRegistered: true
28
+ });
29
+ }
30
+ add(id, extensionId, options) {
31
+ const existing = this._openers.get(id);
32
+ if (existing) {
33
+ existing.isCurrentlyRegistered = existing.isCurrentlyRegistered || options.isCurrentlyRegistered;
34
+ return;
35
+ }
36
+ const entry = {
37
+ extensionId,
38
+ isCurrentlyRegistered: options.isCurrentlyRegistered
39
+ };
40
+ this._openers.set(id, entry);
41
+ this._mementoObject[id] = entry;
42
+ this._memento.saveMemento();
43
+ this.updateSchema();
44
+ }
45
+ delete(id) {
46
+ this._openers.delete(id);
47
+ delete this._mementoObject[id];
48
+ this._memento.saveMemento();
49
+ this.updateSchema();
50
+ }
51
+ async invalidateOpenersOnExtensionsChanged() {
52
+ await this._extensionService.whenInstalledExtensionsRegistered();
53
+ const registeredExtensions = this._extensionService.extensions;
54
+ for (const [id, entry] of this._openers) {
55
+ const extension = registeredExtensions.find(r => r.identifier.value === entry.extensionId);
56
+ if (extension) {
57
+ if (!this._extensionService.canRemoveExtension(extension)) {
58
+ if (!entry.isCurrentlyRegistered) {
59
+ this.delete(id);
60
+ }
61
+ }
62
+ }
63
+ else {
64
+ this.delete(id);
65
+ }
66
+ }
67
+ }
68
+ updateSchema() {
69
+ const ids = [];
70
+ const descriptions = [];
71
+ for (const [id, entry] of this._openers) {
72
+ ids.push(id);
73
+ descriptions.push(entry.extensionId);
74
+ }
75
+ updateContributedOpeners(ids, descriptions);
76
+ }
77
+ };
78
+ ContributedExternalUriOpenersStore = ContributedExternalUriOpenersStore_1 = ( __decorate([
79
+ ( __param(0, IStorageService)),
80
+ ( __param(1, IExtensionService))
81
+ ], ContributedExternalUriOpenersStore));
82
+
83
+ export { ContributedExternalUriOpenersStore };
@@ -0,0 +1,179 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
3
+ import * as path from 'monaco-editor/esm/vs/base/common/path.js';
4
+ import { joinPath, isEqual } from 'monaco-editor/esm/vs/base/common/resources.js';
5
+ import { PLAINTEXT_LANGUAGE_ID } from 'monaco-editor/esm/vs/editor/common/languages/modesRegistry.js';
6
+ import { ITextModelService } from 'monaco-editor/esm/vs/editor/common/services/resolverService.js';
7
+ import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
8
+ import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
9
+ import { EditorInput } from 'vscode/vscode/vs/workbench/common/editor/editorInput';
10
+ import { IInteractiveDocumentService } from 'vscode/vscode/vs/workbench/contrib/interactive/browser/interactiveDocumentService';
11
+ import { IInteractiveHistoryService } from './interactiveHistoryService.js';
12
+ import { NotebookEditorInput } from '../../../../../../../override/vs/workbench/contrib/notebook/common/notebookEditorInput.js';
13
+ import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
14
+ import { IFileDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
15
+
16
+ var InteractiveEditorInput_1;
17
+ let InteractiveEditorInput = class InteractiveEditorInput extends EditorInput {
18
+ static { InteractiveEditorInput_1 = this; }
19
+ static create(instantiationService, resource, inputResource, title, language) {
20
+ return instantiationService.createInstance(InteractiveEditorInput_1, resource, inputResource, title, language);
21
+ }
22
+ static { this.windowNames = {}; }
23
+ static setName(notebookUri, title) {
24
+ if (title) {
25
+ this.windowNames[notebookUri.path] = title;
26
+ }
27
+ }
28
+ static { this.ID = 'workbench.input.interactive'; }
29
+ get editorId() {
30
+ return 'interactive';
31
+ }
32
+ get typeId() {
33
+ return InteractiveEditorInput_1.ID;
34
+ }
35
+ get language() {
36
+ return this._inputModelRef?.object.textEditorModel.getLanguageId() ?? this._initLanguage;
37
+ }
38
+ get notebookEditorInput() {
39
+ return this._notebookEditorInput;
40
+ }
41
+ get editorInputs() {
42
+ return [this._notebookEditorInput];
43
+ }
44
+ get resource() {
45
+ return this._resource;
46
+ }
47
+ get inputResource() {
48
+ return this._inputResource;
49
+ }
50
+ get primary() {
51
+ return this._notebookEditorInput;
52
+ }
53
+ constructor(resource, inputResource, title, languageId, instantiationService, textModelService, interactiveDocumentService, historyService, _notebookService, _fileDialogService) {
54
+ const input = NotebookEditorInput.create(instantiationService, resource, 'interactive', {});
55
+ super();
56
+ this._notebookService = _notebookService;
57
+ this._fileDialogService = _fileDialogService;
58
+ this._notebookEditorInput = input;
59
+ this._register(this._notebookEditorInput);
60
+ this.name = title ?? InteractiveEditorInput_1.windowNames[resource.path] ?? path.basename(resource.path, path.extname(resource.path));
61
+ this._initLanguage = languageId;
62
+ this._resource = resource;
63
+ this._inputResource = inputResource;
64
+ this._inputResolver = null;
65
+ this._editorModelReference = null;
66
+ this._inputModelRef = null;
67
+ this._textModelService = textModelService;
68
+ this._interactiveDocumentService = interactiveDocumentService;
69
+ this._historyService = historyService;
70
+ this._registerListeners();
71
+ }
72
+ _registerListeners() {
73
+ const oncePrimaryDisposed = Event.once(this.primary.onWillDispose);
74
+ this._register(oncePrimaryDisposed(() => {
75
+ if (!this.isDisposed()) {
76
+ this.dispose();
77
+ }
78
+ }));
79
+ this._register(this.primary.onDidChangeDirty(() => this._onDidChangeDirty.fire()));
80
+ this._register(this.primary.onDidChangeLabel(() => this._onDidChangeLabel.fire()));
81
+ this._register(this.primary.onDidChangeCapabilities(() => this._onDidChangeCapabilities.fire()));
82
+ }
83
+ get capabilities() {
84
+ return 4
85
+ | 2
86
+ | 512 ;
87
+ }
88
+ async _resolveEditorModel() {
89
+ if (!this._editorModelReference) {
90
+ this._editorModelReference = await this._notebookEditorInput.resolve();
91
+ }
92
+ return this._editorModelReference;
93
+ }
94
+ async resolve() {
95
+ if (this._editorModelReference) {
96
+ return this._editorModelReference;
97
+ }
98
+ if (this._inputResolver) {
99
+ return this._inputResolver;
100
+ }
101
+ this._inputResolver = this._resolveEditorModel();
102
+ return this._inputResolver;
103
+ }
104
+ async resolveInput(language) {
105
+ if (this._inputModelRef) {
106
+ return this._inputModelRef.object.textEditorModel;
107
+ }
108
+ const resolvedLanguage = language ?? this._initLanguage ?? PLAINTEXT_LANGUAGE_ID;
109
+ this._interactiveDocumentService.willCreateInteractiveDocument(this.resource, this.inputResource, resolvedLanguage);
110
+ this._inputModelRef = await this._textModelService.createModelReference(this.inputResource);
111
+ return this._inputModelRef.object.textEditorModel;
112
+ }
113
+ async save(group, options) {
114
+ if (this._editorModelReference) {
115
+ if (this.hasCapability(4 )) {
116
+ return this.saveAs(group, options);
117
+ }
118
+ else {
119
+ await this._editorModelReference.save(options);
120
+ }
121
+ return this;
122
+ }
123
+ return undefined;
124
+ }
125
+ async saveAs(group, options) {
126
+ if (!this._editorModelReference) {
127
+ return undefined;
128
+ }
129
+ const provider = this._notebookService.getContributedNotebookType('interactive');
130
+ if (!provider) {
131
+ return undefined;
132
+ }
133
+ const filename = this.getName() + '.ipynb';
134
+ const pathCandidate = joinPath(await this._fileDialogService.defaultFilePath(), filename);
135
+ const target = await this._fileDialogService.pickFileToSave(pathCandidate, options?.availableFileSystems);
136
+ if (!target) {
137
+ return undefined;
138
+ }
139
+ return await this._editorModelReference.saveAs(target);
140
+ }
141
+ matches(otherInput) {
142
+ if (super.matches(otherInput)) {
143
+ return true;
144
+ }
145
+ if (otherInput instanceof InteractiveEditorInput_1) {
146
+ return isEqual(this.resource, otherInput.resource) && isEqual(this.inputResource, otherInput.inputResource);
147
+ }
148
+ return false;
149
+ }
150
+ getName() {
151
+ return this.name;
152
+ }
153
+ isModified() {
154
+ return this._editorModelReference?.isModified() ?? false;
155
+ }
156
+ dispose() {
157
+ this._editorModelReference?.revert({ soft: true });
158
+ this._notebookEditorInput?.dispose();
159
+ this._editorModelReference?.dispose();
160
+ this._editorModelReference = null;
161
+ this._interactiveDocumentService.willRemoveInteractiveDocument(this.resource, this.inputResource);
162
+ this._inputModelRef?.dispose();
163
+ this._inputModelRef = null;
164
+ super.dispose();
165
+ }
166
+ get historyService() {
167
+ return this._historyService;
168
+ }
169
+ };
170
+ InteractiveEditorInput = InteractiveEditorInput_1 = ( __decorate([
171
+ ( __param(4, IInstantiationService)),
172
+ ( __param(5, ITextModelService)),
173
+ ( __param(6, IInteractiveDocumentService)),
174
+ ( __param(7, IInteractiveHistoryService)),
175
+ ( __param(8, INotebookService)),
176
+ ( __param(9, IFileDialogService))
177
+ ], InteractiveEditorInput));
178
+
179
+ export { InteractiveEditorInput };
@@ -0,0 +1,5 @@
1
+ import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
2
+
3
+ const IInteractiveHistoryService = ( createDecorator('IInteractiveHistoryService'));
4
+
5
+ export { IInteractiveHistoryService };
@@ -0,0 +1,144 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import { assertFn } from 'monaco-editor/esm/vs/base/common/assert.js';
3
+ import { autorun } from 'monaco-editor/esm/vs/base/common/observable.js';
4
+ import { isEqual } from 'monaco-editor/esm/vs/base/common/resources.js';
5
+ import { isDefined } from 'monaco-editor/esm/vs/base/common/types.js';
6
+ import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
7
+ import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
8
+ import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
9
+ import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
10
+ import { ILabelService } from 'monaco-editor/esm/vs/platform/label/common/label.js';
11
+ import { DEFAULT_EDITOR_ASSOCIATION, isResourceMergeEditorInput } from 'vscode/vscode/vs/workbench/common/editor';
12
+ import { AbstractTextResourceEditorInput } from 'vscode/vscode/vs/workbench/common/editor/textResourceEditorInput';
13
+ import { TempFileMergeEditorModeFactory, WorkspaceMergeEditorModeFactory } from './mergeEditorInputModel.js';
14
+ import { MergeEditorTelemetry } from './telemetry.js';
15
+ import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
16
+ import { IFilesConfigurationService } from 'vscode/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService';
17
+ import { ITextFileService } from 'vscode/vscode/vs/workbench/services/textfile/common/textfiles';
18
+
19
+ var MergeEditorInput_1;
20
+ let MergeEditorInput = class MergeEditorInput extends AbstractTextResourceEditorInput {
21
+ static { MergeEditorInput_1 = this; }
22
+ static { this.ID = 'mergeEditor.Input'; }
23
+ get useWorkingCopy() {
24
+ return this.configurationService.getValue('mergeEditor.useWorkingCopy') ?? false;
25
+ }
26
+ constructor(base, input1, input2, result, _instaService, editorService, textFileService, labelService, fileService, configurationService, filesConfigurationService) {
27
+ super(result, undefined, editorService, textFileService, labelService, fileService, filesConfigurationService);
28
+ this.base = base;
29
+ this.input1 = input1;
30
+ this.input2 = input2;
31
+ this.result = result;
32
+ this._instaService = _instaService;
33
+ this.configurationService = configurationService;
34
+ this.closeHandler = {
35
+ showConfirm: () => this._inputModel?.shouldConfirmClose() ?? false,
36
+ confirm: async (editors) => {
37
+ assertFn(() => editors.every(e => e.editor instanceof MergeEditorInput_1));
38
+ const inputModels = ( editors.map(e => e.editor._inputModel)).filter(isDefined);
39
+ return await this._inputModel.confirmClose(inputModels);
40
+ },
41
+ };
42
+ this.mergeEditorModeFactory = this._instaService.createInstance(this.useWorkingCopy
43
+ ? TempFileMergeEditorModeFactory
44
+ : WorkspaceMergeEditorModeFactory, this._instaService.createInstance(MergeEditorTelemetry));
45
+ }
46
+ dispose() {
47
+ super.dispose();
48
+ }
49
+ get typeId() {
50
+ return MergeEditorInput_1.ID;
51
+ }
52
+ get editorId() {
53
+ return DEFAULT_EDITOR_ASSOCIATION.id;
54
+ }
55
+ get capabilities() {
56
+ let capabilities = super.capabilities | 256 ;
57
+ if (this.useWorkingCopy) {
58
+ capabilities |= 4 ;
59
+ }
60
+ return capabilities;
61
+ }
62
+ getName() {
63
+ return ( localizeWithPath(
64
+ 'vs/workbench/contrib/mergeEditor/browser/mergeEditorInput',
65
+ 'name',
66
+ "Merging: {0}",
67
+ super.getName()
68
+ ));
69
+ }
70
+ async resolve() {
71
+ if (!this._inputModel) {
72
+ const inputModel = this._register(await this.mergeEditorModeFactory.createInputModel({
73
+ base: this.base,
74
+ input1: this.input1,
75
+ input2: this.input2,
76
+ result: this.result,
77
+ }));
78
+ this._inputModel = inputModel;
79
+ this._register(autorun(reader => {
80
+ inputModel.isDirty.read(reader);
81
+ this._onDidChangeDirty.fire();
82
+ }));
83
+ await this._inputModel.model.onInitialized;
84
+ }
85
+ return this._inputModel;
86
+ }
87
+ async accept() {
88
+ await this._inputModel?.accept();
89
+ }
90
+ async save(group, options) {
91
+ await this._inputModel?.save(options);
92
+ return undefined;
93
+ }
94
+ toUntyped() {
95
+ return {
96
+ input1: { resource: this.input1.uri, label: this.input1.title, description: this.input1.description, detail: this.input1.detail },
97
+ input2: { resource: this.input2.uri, label: this.input2.title, description: this.input2.description, detail: this.input2.detail },
98
+ base: { resource: this.base },
99
+ result: { resource: this.result },
100
+ options: {
101
+ override: this.typeId
102
+ }
103
+ };
104
+ }
105
+ matches(otherInput) {
106
+ if (this === otherInput) {
107
+ return true;
108
+ }
109
+ if (otherInput instanceof MergeEditorInput_1) {
110
+ return isEqual(this.base, otherInput.base)
111
+ && isEqual(this.input1.uri, otherInput.input1.uri)
112
+ && isEqual(this.input2.uri, otherInput.input2.uri)
113
+ && isEqual(this.result, otherInput.result);
114
+ }
115
+ if (isResourceMergeEditorInput(otherInput)) {
116
+ return (this.editorId === otherInput.options?.override || otherInput.options?.override === undefined)
117
+ && isEqual(this.base, otherInput.base.resource)
118
+ && isEqual(this.input1.uri, otherInput.input1.resource)
119
+ && isEqual(this.input2.uri, otherInput.input2.resource)
120
+ && isEqual(this.result, otherInput.result.resource);
121
+ }
122
+ return false;
123
+ }
124
+ async revert(group, options) {
125
+ return this._inputModel?.revert(options);
126
+ }
127
+ isDirty() {
128
+ return this._inputModel?.isDirty.get() ?? false;
129
+ }
130
+ setLanguageId(languageId, source) {
131
+ this._inputModel?.model.setLanguageId(languageId, source);
132
+ }
133
+ };
134
+ MergeEditorInput = MergeEditorInput_1 = ( __decorate([
135
+ ( __param(4, IInstantiationService)),
136
+ ( __param(5, IEditorService)),
137
+ ( __param(6, ITextFileService)),
138
+ ( __param(7, ILabelService)),
139
+ ( __param(8, IFileService)),
140
+ ( __param(9, IConfigurationService)),
141
+ ( __param(10, IFilesConfigurationService))
142
+ ], MergeEditorInput));
143
+
144
+ export { MergeEditorInput };