@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,280 @@
1
+ import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
+ import { Emitter, Event } from 'monaco-editor/esm/vs/base/common/event.js';
3
+ import { DisposableMap, DisposableStore, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
4
+ import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
5
+ import { FilePermission, FileSystemProviderErrorCode, FileType, FileOperationError, toFileSystemProviderErrorCode } from 'monaco-editor/esm/vs/platform/files/common/files.js';
6
+ import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
7
+ import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
8
+ import { VSBuffer } from 'monaco-editor/esm/vs/base/common/buffer.js';
9
+ import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
10
+ import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
11
+ import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
12
+ import { IWorkbenchFileService } from 'vscode/vscode/vs/workbench/services/files/common/files';
13
+ import { normalizeWatcherPattern } from '../../../platform/files/common/watcher.js';
14
+ import { GLOBSTAR } from 'monaco-editor/esm/vs/base/common/glob.js';
15
+ import { rtrim } from 'monaco-editor/esm/vs/base/common/strings.js';
16
+
17
+ var MainThreadFileSystem_1;
18
+ let MainThreadFileSystem = MainThreadFileSystem_1 = class MainThreadFileSystem {
19
+ constructor(extHostContext, _fileService, _contextService, _logService, _configurationService) {
20
+ this._fileService = _fileService;
21
+ this._contextService = _contextService;
22
+ this._logService = _logService;
23
+ this._configurationService = _configurationService;
24
+ this._fileProvider = ( new DisposableMap());
25
+ this._disposables = ( new DisposableStore());
26
+ this._watches = ( new DisposableMap());
27
+ this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostFileSystem));
28
+ const infoProxy = ( extHostContext.getProxy(ExtHostContext.ExtHostFileSystemInfo));
29
+ for (const entry of _fileService.listCapabilities()) {
30
+ infoProxy.$acceptProviderInfos(( URI.from({ scheme: entry.scheme, path: '/dummy' })), entry.capabilities);
31
+ }
32
+ this._disposables.add(_fileService.onDidChangeFileSystemProviderRegistrations(e => infoProxy.$acceptProviderInfos(( URI.from({ scheme: e.scheme, path: '/dummy' })), e.provider?.capabilities ?? null)));
33
+ this._disposables.add(_fileService.onDidChangeFileSystemProviderCapabilities(e => infoProxy.$acceptProviderInfos(( URI.from({ scheme: e.scheme, path: '/dummy' })), e.provider.capabilities)));
34
+ }
35
+ dispose() {
36
+ this._disposables.dispose();
37
+ this._fileProvider.dispose();
38
+ this._watches.dispose();
39
+ }
40
+ async $registerFileSystemProvider(handle, scheme, capabilities, readonlyMessage) {
41
+ this._fileProvider.set(handle, ( new RemoteFileSystemProvider(
42
+ this._fileService,
43
+ scheme,
44
+ capabilities,
45
+ readonlyMessage,
46
+ handle,
47
+ this._proxy
48
+ )));
49
+ }
50
+ $unregisterProvider(handle) {
51
+ this._fileProvider.deleteAndDispose(handle);
52
+ }
53
+ $onFileSystemChange(handle, changes) {
54
+ const fileProvider = this._fileProvider.get(handle);
55
+ if (!fileProvider) {
56
+ throw new Error('Unknown file provider');
57
+ }
58
+ fileProvider.$onFileSystemChange(changes);
59
+ }
60
+ $stat(uri) {
61
+ return this._fileService.stat(URI.revive(uri)).then(stat => {
62
+ return {
63
+ ctime: stat.ctime,
64
+ mtime: stat.mtime,
65
+ size: stat.size,
66
+ permissions: stat.readonly ? FilePermission.Readonly : undefined,
67
+ type: MainThreadFileSystem_1._asFileType(stat)
68
+ };
69
+ }).catch(MainThreadFileSystem_1._handleError);
70
+ }
71
+ $readdir(uri) {
72
+ return this._fileService.resolve(URI.revive(uri), { resolveMetadata: false }).then(stat => {
73
+ if (!stat.isDirectory) {
74
+ const err = ( new Error(stat.name));
75
+ err.name = FileSystemProviderErrorCode.FileNotADirectory;
76
+ throw err;
77
+ }
78
+ return !stat.children ? [] : ( stat.children.map(child => [child.name, MainThreadFileSystem_1._asFileType(child)]));
79
+ }).catch(MainThreadFileSystem_1._handleError);
80
+ }
81
+ static _asFileType(stat) {
82
+ let res = 0;
83
+ if (stat.isFile) {
84
+ res += FileType.File;
85
+ }
86
+ else if (stat.isDirectory) {
87
+ res += FileType.Directory;
88
+ }
89
+ if (stat.isSymbolicLink) {
90
+ res += FileType.SymbolicLink;
91
+ }
92
+ return res;
93
+ }
94
+ $readFile(uri) {
95
+ return this._fileService.readFile(URI.revive(uri)).then(file => file.value).catch(MainThreadFileSystem_1._handleError);
96
+ }
97
+ $writeFile(uri, content) {
98
+ return this._fileService.writeFile(URI.revive(uri), content)
99
+ .then(() => undefined).catch(MainThreadFileSystem_1._handleError);
100
+ }
101
+ $rename(source, target, opts) {
102
+ return this._fileService.move(URI.revive(source), URI.revive(target), opts.overwrite)
103
+ .then(() => undefined).catch(MainThreadFileSystem_1._handleError);
104
+ }
105
+ $copy(source, target, opts) {
106
+ return this._fileService.copy(URI.revive(source), URI.revive(target), opts.overwrite)
107
+ .then(() => undefined).catch(MainThreadFileSystem_1._handleError);
108
+ }
109
+ $mkdir(uri) {
110
+ return this._fileService.createFolder(URI.revive(uri))
111
+ .then(() => undefined).catch(MainThreadFileSystem_1._handleError);
112
+ }
113
+ $delete(uri, opts) {
114
+ return this._fileService.del(URI.revive(uri), opts).catch(MainThreadFileSystem_1._handleError);
115
+ }
116
+ static _handleError(err) {
117
+ if (err instanceof FileOperationError) {
118
+ switch (err.fileOperationResult) {
119
+ case 1 :
120
+ err.name = FileSystemProviderErrorCode.FileNotFound;
121
+ break;
122
+ case 0 :
123
+ err.name = FileSystemProviderErrorCode.FileIsADirectory;
124
+ break;
125
+ case 6 :
126
+ err.name = FileSystemProviderErrorCode.NoPermissions;
127
+ break;
128
+ case 4 :
129
+ err.name = FileSystemProviderErrorCode.FileExists;
130
+ break;
131
+ }
132
+ }
133
+ else if (err instanceof Error) {
134
+ const code = toFileSystemProviderErrorCode(err);
135
+ if (code !== FileSystemProviderErrorCode.Unknown) {
136
+ err.name = code;
137
+ }
138
+ }
139
+ throw err;
140
+ }
141
+ $ensureActivation(scheme) {
142
+ return this._fileService.activateProvider(scheme);
143
+ }
144
+ async $watch(extensionId, session, resource, unvalidatedOpts) {
145
+ const uri = URI.revive(resource);
146
+ const workspaceFolder = this._contextService.getWorkspaceFolder(uri);
147
+ const opts = { ...unvalidatedOpts };
148
+ if (opts.recursive) {
149
+ try {
150
+ const stat = await this._fileService.stat(uri);
151
+ if (!stat.isDirectory) {
152
+ opts.recursive = false;
153
+ }
154
+ }
155
+ catch (error) {
156
+ this._logService.error(`MainThreadFileSystem#$watch(): failed to stat a resource for file watching (extension: ${extensionId}, path: ${( uri.toString(true))}, recursive: ${opts.recursive}, session: ${session}): ${error}`);
157
+ }
158
+ }
159
+ if (workspaceFolder && opts.recursive) {
160
+ this._logService.trace(`MainThreadFileSystem#$watch(): ignoring request to start watching because path is inside workspace (extension: ${extensionId}, path: ${( uri.toString(true))}, recursive: ${opts.recursive}, session: ${session})`);
161
+ return;
162
+ }
163
+ this._logService.trace(`MainThreadFileSystem#$watch(): request to start watching (extension: ${extensionId}, path: ${( uri.toString(true))}, recursive: ${opts.recursive}, session: ${session})`);
164
+ if (opts.recursive) {
165
+ const config = this._configurationService.getValue();
166
+ if (config.files?.watcherExclude) {
167
+ for (const key in config.files.watcherExclude) {
168
+ if (config.files.watcherExclude[key] === true) {
169
+ opts.excludes.push(key);
170
+ }
171
+ }
172
+ }
173
+ }
174
+ else if (workspaceFolder) {
175
+ const config = this._configurationService.getValue();
176
+ if (config.files?.watcherExclude) {
177
+ for (const key in config.files.watcherExclude) {
178
+ if (config.files.watcherExclude[key] === true) {
179
+ if (!opts.includes) {
180
+ opts.includes = [];
181
+ }
182
+ const includePattern = `${rtrim(key, '/')}/${GLOBSTAR}`;
183
+ opts.includes.push(normalizeWatcherPattern(workspaceFolder.uri.fsPath, includePattern));
184
+ }
185
+ }
186
+ }
187
+ if (!opts.includes || opts.includes.length === 0) {
188
+ this._logService.trace(`MainThreadFileSystem#$watch(): ignoring request to start watching because path is inside workspace and no excludes are configured (extension: ${extensionId}, path: ${( uri.toString(true))}, recursive: ${opts.recursive}, session: ${session})`);
189
+ return;
190
+ }
191
+ }
192
+ const subscription = this._fileService.watch(uri, opts);
193
+ this._watches.set(session, subscription);
194
+ }
195
+ $unwatch(session) {
196
+ if (( this._watches.has(session))) {
197
+ this._logService.trace(`MainThreadFileSystem#$unwatch(): request to stop watching (session: ${session})`);
198
+ this._watches.deleteAndDispose(session);
199
+ }
200
+ }
201
+ };
202
+ MainThreadFileSystem = MainThreadFileSystem_1 = __decorate([
203
+ extHostNamedCustomer(MainContext.MainThreadFileSystem),
204
+ ( __param(1, IWorkbenchFileService)),
205
+ ( __param(2, IWorkspaceContextService)),
206
+ ( __param(3, ILogService)),
207
+ ( __param(4, IConfigurationService))
208
+ ], MainThreadFileSystem);
209
+ class RemoteFileSystemProvider {
210
+ constructor(fileService, scheme, capabilities, readOnlyMessage, _handle, _proxy) {
211
+ this.readOnlyMessage = readOnlyMessage;
212
+ this._handle = _handle;
213
+ this._proxy = _proxy;
214
+ this._onDidChange = ( new Emitter());
215
+ this.onDidChangeFile = this._onDidChange.event;
216
+ this.onDidChangeCapabilities = Event.None;
217
+ this.capabilities = capabilities;
218
+ this._registration = fileService.registerProvider(scheme, this);
219
+ }
220
+ dispose() {
221
+ this._registration.dispose();
222
+ this._onDidChange.dispose();
223
+ }
224
+ watch(resource, opts) {
225
+ const session = Math.random();
226
+ this._proxy.$watch(this._handle, session, resource, opts);
227
+ return toDisposable(() => {
228
+ this._proxy.$unwatch(this._handle, session);
229
+ });
230
+ }
231
+ $onFileSystemChange(changes) {
232
+ this._onDidChange.fire(( changes.map(RemoteFileSystemProvider._createFileChange)));
233
+ }
234
+ static _createFileChange(dto) {
235
+ return { resource: URI.revive(dto.resource), type: dto.type };
236
+ }
237
+ stat(resource) {
238
+ return this._proxy.$stat(this._handle, resource).then(undefined, err => {
239
+ throw err;
240
+ });
241
+ }
242
+ readFile(resource) {
243
+ return this._proxy.$readFile(this._handle, resource).then(buffer => buffer.buffer);
244
+ }
245
+ writeFile(resource, content, opts) {
246
+ return this._proxy.$writeFile(this._handle, resource, VSBuffer.wrap(content), opts);
247
+ }
248
+ delete(resource, opts) {
249
+ return this._proxy.$delete(this._handle, resource, opts);
250
+ }
251
+ mkdir(resource) {
252
+ return this._proxy.$mkdir(this._handle, resource);
253
+ }
254
+ readdir(resource) {
255
+ return this._proxy.$readdir(this._handle, resource);
256
+ }
257
+ rename(resource, target, opts) {
258
+ return this._proxy.$rename(this._handle, resource, target, opts);
259
+ }
260
+ copy(resource, target, opts) {
261
+ return this._proxy.$copy(this._handle, resource, target, opts);
262
+ }
263
+ open(resource, opts) {
264
+ return this._proxy.$open(this._handle, resource, opts);
265
+ }
266
+ close(fd) {
267
+ return this._proxy.$close(this._handle, fd);
268
+ }
269
+ read(fd, pos, data, offset, length) {
270
+ return this._proxy.$read(this._handle, fd, pos, length).then(readData => {
271
+ data.set(readData.buffer, offset);
272
+ return readData.byteLength;
273
+ });
274
+ }
275
+ write(fd, pos, data, offset, length) {
276
+ return this._proxy.$write(this._handle, fd, pos, VSBuffer.wrap(data).slice(offset, offset + length));
277
+ }
278
+ }
279
+
280
+ export { MainThreadFileSystem };
@@ -0,0 +1,283 @@
1
+ import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
+ import { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
3
+ import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
4
+ import { extHostCustomer } from '../../services/extensions/common/extHostCustomers.js';
5
+ import { ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
6
+ import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
7
+ import { IWorkingCopyFileService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService';
8
+ import { IBulkEditService } from 'monaco-editor/esm/vs/editor/browser/services/bulkEditService.js';
9
+ import { IProgressService } from 'monaco-editor/esm/vs/platform/progress/common/progress.js';
10
+ import { raceCancellation } from 'monaco-editor/esm/vs/base/common/async.js';
11
+ import { CancellationTokenSource } from 'monaco-editor/esm/vs/base/common/cancellation.js';
12
+ import '../../../../../../override/vs/platform/dialogs/common/dialogs.js';
13
+ import Severity from 'monaco-editor/esm/vs/base/common/severity.js';
14
+ import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
15
+ import { registerAction2, Action2 } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
16
+ import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
17
+ import { IEnvironmentService } from 'monaco-editor/esm/vs/platform/environment/common/environment.js';
18
+ import { IUriIdentityService } from 'monaco-editor/esm/vs/platform/uriIdentity/common/uriIdentity.js';
19
+ import { reviveWorkspaceEditDto } from './mainThreadBulkEdits.js';
20
+ import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
21
+
22
+ var MainThreadFileSystemEventService_1;
23
+ let MainThreadFileSystemEventService = class MainThreadFileSystemEventService {
24
+ static { MainThreadFileSystemEventService_1 = this; }
25
+ static { this.MementoKeyAdditionalEdits = `file.particpants.additionalEdits`; }
26
+ constructor(extHostContext, fileService, workingCopyFileService, bulkEditService, progressService, dialogService, storageService, logService, envService, uriIdentService) {
27
+ this._listener = ( new DisposableStore());
28
+ const proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostFileSystemEventService));
29
+ this._listener.add(fileService.onDidFilesChange(event => {
30
+ proxy.$onFileEvent({
31
+ created: event.rawAdded,
32
+ changed: event.rawUpdated,
33
+ deleted: event.rawDeleted
34
+ });
35
+ }));
36
+ const fileOperationParticipant = new (class {
37
+ async participate(files, operation, undoInfo, timeout, token) {
38
+ if (undoInfo?.isUndoing) {
39
+ return;
40
+ }
41
+ const cts = ( new CancellationTokenSource(token));
42
+ const timer = setTimeout(() => cts.cancel(), timeout);
43
+ const data = await progressService.withProgress({
44
+ location: 15 ,
45
+ title: this._progressLabel(operation),
46
+ cancellable: true,
47
+ delay: Math.min(timeout / 2, 3000)
48
+ }, () => {
49
+ const onWillEvent = proxy.$onWillRunFileOperation(operation, files, timeout, cts.token);
50
+ return raceCancellation(onWillEvent, cts.token);
51
+ }, () => {
52
+ cts.cancel();
53
+ }).finally(() => {
54
+ cts.dispose();
55
+ clearTimeout(timer);
56
+ });
57
+ if (!data || data.edit.edits.length === 0) {
58
+ return;
59
+ }
60
+ const needsConfirmation = ( data.edit.edits.some(edit => edit.metadata?.needsConfirmation));
61
+ let showPreview = storageService.getBoolean(MainThreadFileSystemEventService_1.MementoKeyAdditionalEdits, 0 );
62
+ if (envService.extensionTestsLocationURI) {
63
+ showPreview = false;
64
+ }
65
+ if (showPreview === undefined) {
66
+ let message;
67
+ if (data.extensionNames.length === 1) {
68
+ if (operation === 0 ) {
69
+ message = ( localizeWithPath(
70
+ 'vs/workbench/api/browser/mainThreadFileSystemEventService',
71
+ 'ask.1.create',
72
+ "Extension '{0}' wants to make refactoring changes with this file creation",
73
+ data.extensionNames[0]
74
+ ));
75
+ }
76
+ else if (operation === 3 ) {
77
+ message = ( localizeWithPath(
78
+ 'vs/workbench/api/browser/mainThreadFileSystemEventService',
79
+ 'ask.1.copy',
80
+ "Extension '{0}' wants to make refactoring changes with this file copy",
81
+ data.extensionNames[0]
82
+ ));
83
+ }
84
+ else if (operation === 2 ) {
85
+ message = ( localizeWithPath(
86
+ 'vs/workbench/api/browser/mainThreadFileSystemEventService',
87
+ 'ask.1.move',
88
+ "Extension '{0}' wants to make refactoring changes with this file move",
89
+ data.extensionNames[0]
90
+ ));
91
+ }
92
+ else {
93
+ message = ( localizeWithPath(
94
+ 'vs/workbench/api/browser/mainThreadFileSystemEventService',
95
+ 'ask.1.delete',
96
+ "Extension '{0}' wants to make refactoring changes with this file deletion",
97
+ data.extensionNames[0]
98
+ ));
99
+ }
100
+ }
101
+ else {
102
+ if (operation === 0 ) {
103
+ message = ( localizeWithPath(
104
+ 'vs/workbench/api/browser/mainThreadFileSystemEventService',
105
+ { key: 'ask.N.create', comment: ['{0} is a number, e.g "3 extensions want..."'] },
106
+ "{0} extensions want to make refactoring changes with this file creation",
107
+ data.extensionNames.length
108
+ ));
109
+ }
110
+ else if (operation === 3 ) {
111
+ message = ( localizeWithPath(
112
+ 'vs/workbench/api/browser/mainThreadFileSystemEventService',
113
+ { key: 'ask.N.copy', comment: ['{0} is a number, e.g "3 extensions want..."'] },
114
+ "{0} extensions want to make refactoring changes with this file copy",
115
+ data.extensionNames.length
116
+ ));
117
+ }
118
+ else if (operation === 2 ) {
119
+ message = ( localizeWithPath(
120
+ 'vs/workbench/api/browser/mainThreadFileSystemEventService',
121
+ { key: 'ask.N.move', comment: ['{0} is a number, e.g "3 extensions want..."'] },
122
+ "{0} extensions want to make refactoring changes with this file move",
123
+ data.extensionNames.length
124
+ ));
125
+ }
126
+ else {
127
+ message = ( localizeWithPath(
128
+ 'vs/workbench/api/browser/mainThreadFileSystemEventService',
129
+ { key: 'ask.N.delete', comment: ['{0} is a number, e.g "3 extensions want..."'] },
130
+ "{0} extensions want to make refactoring changes with this file deletion",
131
+ data.extensionNames.length
132
+ ));
133
+ }
134
+ }
135
+ if (needsConfirmation) {
136
+ const { confirmed } = await dialogService.confirm({
137
+ type: Severity.Info,
138
+ message,
139
+ primaryButton: ( localizeWithPath(
140
+ 'vs/workbench/api/browser/mainThreadFileSystemEventService',
141
+ 'preview',
142
+ "Show &&Preview"
143
+ )),
144
+ cancelButton: ( localizeWithPath(
145
+ 'vs/workbench/api/browser/mainThreadFileSystemEventService',
146
+ 'cancel',
147
+ "Skip Changes"
148
+ ))
149
+ });
150
+ showPreview = true;
151
+ if (!confirmed) {
152
+ return;
153
+ }
154
+ }
155
+ else {
156
+ let Choice;
157
+ ( (function(Choice) {
158
+ Choice[Choice["OK"] = 0] = "OK";
159
+ Choice[Choice["Preview"] = 1] = "Preview";
160
+ Choice[Choice["Cancel"] = 2] = "Cancel";
161
+ })(Choice || (Choice = {})));
162
+ const { result, checkboxChecked } = await dialogService.prompt({
163
+ type: Severity.Info,
164
+ message,
165
+ buttons: [
166
+ {
167
+ label: ( localizeWithPath(
168
+ 'vs/workbench/api/browser/mainThreadFileSystemEventService',
169
+ { key: 'ok', comment: ['&& denotes a mnemonic'] },
170
+ "&&OK"
171
+ )),
172
+ run: () => Choice.OK
173
+ },
174
+ {
175
+ label: ( localizeWithPath(
176
+ 'vs/workbench/api/browser/mainThreadFileSystemEventService',
177
+ { key: 'preview', comment: ['&& denotes a mnemonic'] },
178
+ "Show &&Preview"
179
+ )),
180
+ run: () => Choice.Preview
181
+ }
182
+ ],
183
+ cancelButton: {
184
+ label: ( localizeWithPath(
185
+ 'vs/workbench/api/browser/mainThreadFileSystemEventService',
186
+ 'cancel',
187
+ "Skip Changes"
188
+ )),
189
+ run: () => Choice.Cancel
190
+ },
191
+ checkbox: { label: ( localizeWithPath(
192
+ 'vs/workbench/api/browser/mainThreadFileSystemEventService',
193
+ 'again',
194
+ "Don't ask again"
195
+ )) }
196
+ });
197
+ if (result === Choice.Cancel) {
198
+ return;
199
+ }
200
+ showPreview = result === Choice.Preview;
201
+ if (checkboxChecked) {
202
+ storageService.store(MainThreadFileSystemEventService_1.MementoKeyAdditionalEdits, showPreview, 0 , 0 );
203
+ }
204
+ }
205
+ }
206
+ logService.info('[onWill-handler] applying additional workspace edit from extensions', data.extensionNames);
207
+ await bulkEditService.apply(reviveWorkspaceEditDto(data.edit, uriIdentService), { undoRedoGroupId: undoInfo?.undoRedoGroupId, showPreview });
208
+ }
209
+ _progressLabel(operation) {
210
+ switch (operation) {
211
+ case 0 :
212
+ return ( localizeWithPath(
213
+ 'vs/workbench/api/browser/mainThreadFileSystemEventService',
214
+ 'msg-create',
215
+ "Running 'File Create' participants..."
216
+ ));
217
+ case 2 :
218
+ return ( localizeWithPath(
219
+ 'vs/workbench/api/browser/mainThreadFileSystemEventService',
220
+ 'msg-rename',
221
+ "Running 'File Rename' participants..."
222
+ ));
223
+ case 3 :
224
+ return ( localizeWithPath(
225
+ 'vs/workbench/api/browser/mainThreadFileSystemEventService',
226
+ 'msg-copy',
227
+ "Running 'File Copy' participants..."
228
+ ));
229
+ case 1 :
230
+ return ( localizeWithPath(
231
+ 'vs/workbench/api/browser/mainThreadFileSystemEventService',
232
+ 'msg-delete',
233
+ "Running 'File Delete' participants..."
234
+ ));
235
+ case 4 :
236
+ return ( localizeWithPath(
237
+ 'vs/workbench/api/browser/mainThreadFileSystemEventService',
238
+ 'msg-write',
239
+ "Running 'File Write' participants..."
240
+ ));
241
+ }
242
+ }
243
+ });
244
+ this._listener.add(workingCopyFileService.addFileOperationParticipant(fileOperationParticipant));
245
+ this._listener.add(workingCopyFileService.onDidRunWorkingCopyFileOperation(e => proxy.$onDidRunFileOperation(e.operation, e.files)));
246
+ }
247
+ dispose() {
248
+ this._listener.dispose();
249
+ }
250
+ };
251
+ MainThreadFileSystemEventService = MainThreadFileSystemEventService_1 = __decorate([
252
+ extHostCustomer,
253
+ ( __param(1, IFileService)),
254
+ ( __param(2, IWorkingCopyFileService)),
255
+ ( __param(3, IBulkEditService)),
256
+ ( __param(4, IProgressService)),
257
+ ( __param(5, IDialogService)),
258
+ ( __param(6, IStorageService)),
259
+ ( __param(7, ILogService)),
260
+ ( __param(8, IEnvironmentService)),
261
+ ( __param(9, IUriIdentityService))
262
+ ], MainThreadFileSystemEventService);
263
+ registerAction2(class ResetMemento extends Action2 {
264
+ constructor() {
265
+ super({
266
+ id: 'files.participants.resetChoice',
267
+ title: {
268
+ value: ( localizeWithPath(
269
+ 'vs/workbench/api/browser/mainThreadFileSystemEventService',
270
+ 'label',
271
+ "Reset choice for 'File operation needs preview'"
272
+ )),
273
+ original: `Reset choice for 'File operation needs preview'`
274
+ },
275
+ f1: true
276
+ });
277
+ }
278
+ run(accessor) {
279
+ accessor.get(IStorageService).remove(MainThreadFileSystemEventService.MementoKeyAdditionalEdits, 0 );
280
+ }
281
+ });
282
+
283
+ export { MainThreadFileSystemEventService };
@@ -0,0 +1,68 @@
1
+ import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
+ import { DisposableMap } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
3
+ import { IInlineChatService } from 'vscode/vscode/vs/workbench/contrib/inlineChat/common/inlineChat';
4
+ import { IUriIdentityService } from 'monaco-editor/esm/vs/platform/uriIdentity/common/uriIdentity.js';
5
+ import { reviveWorkspaceEditDto } from './mainThreadBulkEdits.js';
6
+ import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
7
+ import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
8
+
9
+ let MainThreadInlineChat = class MainThreadInlineChat {
10
+ constructor(extHostContext, _inlineChatService, _uriIdentService) {
11
+ this._inlineChatService = _inlineChatService;
12
+ this._uriIdentService = _uriIdentService;
13
+ this._registrations = ( new DisposableMap());
14
+ this._progresses = ( new Map());
15
+ this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostInlineChat));
16
+ }
17
+ dispose() {
18
+ this._registrations.dispose();
19
+ }
20
+ async $registerInteractiveEditorProvider(handle, label, debugName, supportsFeedback) {
21
+ const unreg = this._inlineChatService.addProvider({
22
+ debugName,
23
+ label,
24
+ prepareInlineChatSession: async (model, range, token) => {
25
+ const session = await this._proxy.$prepareSession(handle, model.uri, range, token);
26
+ if (!session) {
27
+ return undefined;
28
+ }
29
+ return {
30
+ ...session,
31
+ dispose: () => {
32
+ this._proxy.$releaseSession(handle, session.id);
33
+ }
34
+ };
35
+ },
36
+ provideResponse: async (item, request, progress, token) => {
37
+ this._progresses.set(request.requestId, progress);
38
+ try {
39
+ const result = await this._proxy.$provideResponse(handle, item, request, token);
40
+ if (result?.type === 'bulkEdit') {
41
+ result.edits = reviveWorkspaceEditDto(result.edits, this._uriIdentService);
42
+ }
43
+ return result;
44
+ }
45
+ finally {
46
+ this._progresses.delete(request.requestId);
47
+ }
48
+ },
49
+ handleInlineChatResponseFeedback: !supportsFeedback ? undefined : async (session, response, kind) => {
50
+ this._proxy.$handleFeedback(handle, session.id, response.id, kind);
51
+ }
52
+ });
53
+ this._registrations.set(handle, unreg);
54
+ }
55
+ async $handleProgressChunk(requestId, chunk) {
56
+ this._progresses.get(requestId)?.report(chunk);
57
+ }
58
+ async $unregisterInteractiveEditorProvider(handle) {
59
+ this._registrations.deleteAndDispose(handle);
60
+ }
61
+ };
62
+ MainThreadInlineChat = __decorate([
63
+ extHostNamedCustomer(MainContext.MainThreadInlineChat),
64
+ ( __param(1, IInlineChatService)),
65
+ ( __param(2, IUriIdentityService))
66
+ ], MainThreadInlineChat);
67
+
68
+ export { MainThreadInlineChat };
@@ -0,0 +1,28 @@
1
+ import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
+ import { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
3
+ import { PLAINTEXT_LANGUAGE_ID } from 'monaco-editor/esm/vs/editor/common/languages/modesRegistry.js';
4
+ import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
5
+ import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
6
+ import { IInteractiveDocumentService } from 'vscode/vscode/vs/workbench/contrib/interactive/browser/interactiveDocumentService';
7
+
8
+ let MainThreadInteractive = class MainThreadInteractive {
9
+ constructor(extHostContext, interactiveDocumentService) {
10
+ this._disposables = ( new DisposableStore());
11
+ this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostInteractive));
12
+ this._disposables.add(interactiveDocumentService.onWillAddInteractiveDocument((e) => {
13
+ this._proxy.$willAddInteractiveDocument(e.inputUri, '\n', PLAINTEXT_LANGUAGE_ID, e.notebookUri);
14
+ }));
15
+ this._disposables.add(interactiveDocumentService.onWillRemoveInteractiveDocument((e) => {
16
+ this._proxy.$willRemoveInteractiveDocument(e.inputUri, e.notebookUri);
17
+ }));
18
+ }
19
+ dispose() {
20
+ this._disposables.dispose();
21
+ }
22
+ };
23
+ MainThreadInteractive = __decorate([
24
+ extHostNamedCustomer(MainContext.MainThreadInteractive),
25
+ ( __param(1, IInteractiveDocumentService))
26
+ ], MainThreadInteractive);
27
+
28
+ export { MainThreadInteractive };