@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,61 @@
1
+ import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
+ import { DisposableMap } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
3
+ import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
4
+ import { Progress } from 'monaco-editor/esm/vs/platform/progress/common/progress.js';
5
+ import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
6
+ import { IChatProviderService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatProvider';
7
+ import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
8
+
9
+ let MainThreadChatProvider = class MainThreadChatProvider {
10
+ constructor(extHostContext, _chatProviderService, _logService) {
11
+ this._chatProviderService = _chatProviderService;
12
+ this._logService = _logService;
13
+ this._providerRegistrations = ( new DisposableMap());
14
+ this._pendingProgress = ( new Map());
15
+ this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostChatProvider));
16
+ }
17
+ dispose() {
18
+ this._providerRegistrations.dispose();
19
+ }
20
+ $registerProvider(handle, identifier, metadata) {
21
+ const registration = this._chatProviderService.registerChatResponseProvider(identifier, {
22
+ metadata,
23
+ provideChatResponse: async (messages, options, progress, token) => {
24
+ const requestId = (Math.random() * 1e6) | 0;
25
+ this._pendingProgress.set(requestId, progress);
26
+ try {
27
+ await this._proxy.$provideChatResponse(handle, requestId, messages, options, token);
28
+ }
29
+ finally {
30
+ this._pendingProgress.delete(requestId);
31
+ }
32
+ }
33
+ });
34
+ this._providerRegistrations.set(handle, registration);
35
+ }
36
+ async $handleProgressChunk(requestId, chunk) {
37
+ this._pendingProgress.get(requestId)?.report(chunk);
38
+ }
39
+ $unregisterProvider(handle) {
40
+ this._providerRegistrations.deleteAndDispose(handle);
41
+ }
42
+ async $fetchResponse(extension, providerId, requestId, messages, options, token) {
43
+ this._logService.debug('[CHAT] extension request STARTED', extension.value, requestId);
44
+ const task = this._chatProviderService.fetchChatResponse(providerId, messages, options, ( new Progress(value => {
45
+ this._proxy.$handleResponseFragment(requestId, value);
46
+ })), token);
47
+ task.catch(err => {
48
+ this._logService.error('[CHAT] extension request ERRORED', err, extension.value, requestId);
49
+ }).finally(() => {
50
+ this._logService.debug('[CHAT] extension request DONE', extension.value, requestId);
51
+ });
52
+ return task;
53
+ }
54
+ };
55
+ MainThreadChatProvider = __decorate([
56
+ extHostNamedCustomer(MainContext.MainThreadChatProvider),
57
+ ( __param(1, IChatProviderService)),
58
+ ( __param(2, ILogService))
59
+ ], MainThreadChatProvider);
60
+
61
+ export { MainThreadChatProvider };
@@ -0,0 +1,49 @@
1
+ import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
+ import { DisposableMap } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
3
+ import { revive } from 'monaco-editor/esm/vs/base/common/marshalling.js';
4
+ import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
5
+ import { IChatSlashCommandService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatSlashCommands';
6
+ import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
7
+
8
+ let MainThreadChatSlashCommands = class MainThreadChatSlashCommands {
9
+ constructor(extHostContext, _chatSlashCommandService) {
10
+ this._chatSlashCommandService = _chatSlashCommandService;
11
+ this._commands = ( new DisposableMap());
12
+ this._pendingProgress = ( new Map());
13
+ this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostChatSlashCommands));
14
+ }
15
+ dispose() {
16
+ this._commands.clearAndDisposeAll();
17
+ }
18
+ $registerCommand(handle, name, detail) {
19
+ if (!this._chatSlashCommandService.hasCommand(name)) {
20
+ this._chatSlashCommandService.registerSlashData({
21
+ command: name,
22
+ detail
23
+ });
24
+ }
25
+ const d = this._chatSlashCommandService.registerSlashCallback(name, async (prompt, progress, history, token) => {
26
+ const requestId = Math.random();
27
+ this._pendingProgress.set(requestId, progress);
28
+ try {
29
+ return await this._proxy.$executeCommand(handle, requestId, prompt, { history }, token);
30
+ }
31
+ finally {
32
+ this._pendingProgress.delete(requestId);
33
+ }
34
+ });
35
+ this._commands.set(handle, d);
36
+ }
37
+ async $handleProgressChunk(requestId, chunk) {
38
+ this._pendingProgress.get(requestId)?.report(revive(chunk));
39
+ }
40
+ $unregisterCommand(handle) {
41
+ this._commands.deleteAndDispose(handle);
42
+ }
43
+ };
44
+ MainThreadChatSlashCommands = __decorate([
45
+ extHostNamedCustomer(MainContext.MainThreadChatSlashCommands),
46
+ ( __param(1, IChatSlashCommandService))
47
+ ], MainThreadChatSlashCommands);
48
+
49
+ export { MainThreadChatSlashCommands };
@@ -0,0 +1,31 @@
1
+ import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
+ import { DisposableMap } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
3
+ import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
4
+ import { IChatVariablesService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatVariables';
5
+ import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
6
+
7
+ let MainThreadChatSlashCommands = class MainThreadChatSlashCommands {
8
+ constructor(extHostContext, _chatVariablesService) {
9
+ this._chatVariablesService = _chatVariablesService;
10
+ this._variables = ( new DisposableMap());
11
+ this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostChatVariables));
12
+ }
13
+ dispose() {
14
+ this._variables.clearAndDisposeAll();
15
+ }
16
+ $registerVariable(handle, data) {
17
+ const registration = this._chatVariablesService.registerVariable(data, (messageText, _arg, _model, token) => {
18
+ return this._proxy.$resolveVariable(handle, messageText, token);
19
+ });
20
+ this._variables.set(handle, registration);
21
+ }
22
+ $unregisterVariable(handle) {
23
+ this._variables.deleteAndDispose(handle);
24
+ }
25
+ };
26
+ MainThreadChatSlashCommands = __decorate([
27
+ extHostNamedCustomer(MainContext.MainThreadChatVariables),
28
+ ( __param(1, IChatVariablesService))
29
+ ], MainThreadChatSlashCommands);
30
+
31
+ export { MainThreadChatSlashCommands };
@@ -0,0 +1,24 @@
1
+ import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
+ import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
3
+ import { MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
4
+ import { IClipboardService } from 'monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js';
5
+
6
+ let MainThreadClipboard = class MainThreadClipboard {
7
+ constructor(_context, _clipboardService) {
8
+ this._clipboardService = _clipboardService;
9
+ }
10
+ dispose() {
11
+ }
12
+ $readText() {
13
+ return this._clipboardService.readText();
14
+ }
15
+ $writeText(value) {
16
+ return this._clipboardService.writeText(value);
17
+ }
18
+ };
19
+ MainThreadClipboard = __decorate([
20
+ extHostNamedCustomer(MainContext.MainThreadClipboard),
21
+ ( __param(1, IClipboardService))
22
+ ], MainThreadClipboard);
23
+
24
+ export { MainThreadClipboard };
@@ -0,0 +1,107 @@
1
+ import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
+ import { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
3
+ import { isEqual } from 'monaco-editor/esm/vs/base/common/resources.js';
4
+ import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
5
+ import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
6
+ import { reviveWebviewContentOptions } from './mainThreadWebviews.js';
7
+ import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
8
+ import { IWebviewService } from 'vscode/vscode/vs/workbench/contrib/webview/browser/webview';
9
+ import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
10
+
11
+ class EditorWebviewZone {
12
+ constructor(editor, line, height, webview) {
13
+ this.editor = editor;
14
+ this.line = line;
15
+ this.height = height;
16
+ this.webview = webview;
17
+ this.domNode = document.createElement('div');
18
+ this.domNode.style.zIndex = '10';
19
+ this.afterLineNumber = line;
20
+ this.afterColumn = 1;
21
+ this.heightInLines = height;
22
+ editor.changeViewZones(accessor => this._id = accessor.addZone(this));
23
+ webview.mountTo(this.domNode);
24
+ }
25
+ dispose() {
26
+ this.editor.changeViewZones(accessor => this._id && accessor.removeZone(this._id));
27
+ }
28
+ }
29
+ let MainThreadEditorInsets = class MainThreadEditorInsets {
30
+ constructor(context, _editorService, _webviewService) {
31
+ this._editorService = _editorService;
32
+ this._webviewService = _webviewService;
33
+ this._disposables = ( new DisposableStore());
34
+ this._insets = ( new Map());
35
+ this._proxy = ( context.getProxy(ExtHostContext.ExtHostEditorInsets));
36
+ }
37
+ dispose() {
38
+ this._disposables.dispose();
39
+ }
40
+ async $createEditorInset(handle, id, uri, line, height, options, extensionId, extensionLocation) {
41
+ let editor;
42
+ id = id.substr(0, id.indexOf(','));
43
+ for (const candidate of this._editorService.listCodeEditors()) {
44
+ if (candidate.getId() === id && candidate.hasModel() && isEqual(candidate.getModel().uri, URI.revive(uri))) {
45
+ editor = candidate;
46
+ break;
47
+ }
48
+ }
49
+ if (!editor) {
50
+ setTimeout(() => this._proxy.$onDidDispose(handle));
51
+ return;
52
+ }
53
+ const disposables = ( new DisposableStore());
54
+ const webview = this._webviewService.createWebviewElement({
55
+ title: undefined,
56
+ options: {
57
+ enableFindWidget: false,
58
+ },
59
+ contentOptions: reviveWebviewContentOptions(options),
60
+ extension: { id: extensionId, location: URI.revive(extensionLocation) }
61
+ });
62
+ const webviewZone = ( new EditorWebviewZone(editor, line, height, webview));
63
+ const remove = () => {
64
+ disposables.dispose();
65
+ this._proxy.$onDidDispose(handle);
66
+ this._insets.delete(handle);
67
+ };
68
+ disposables.add(editor.onDidChangeModel(remove));
69
+ disposables.add(editor.onDidDispose(remove));
70
+ disposables.add(webviewZone);
71
+ disposables.add(webview);
72
+ disposables.add(webview.onMessage(msg => this._proxy.$onDidReceiveMessage(handle, msg.message)));
73
+ this._insets.set(handle, webviewZone);
74
+ }
75
+ $disposeEditorInset(handle) {
76
+ const inset = this.getInset(handle);
77
+ this._insets.delete(handle);
78
+ inset.dispose();
79
+ }
80
+ $setHtml(handle, value) {
81
+ const inset = this.getInset(handle);
82
+ inset.webview.setHtml(value);
83
+ }
84
+ $setOptions(handle, options) {
85
+ const inset = this.getInset(handle);
86
+ inset.webview.contentOptions = reviveWebviewContentOptions(options);
87
+ }
88
+ async $postMessage(handle, value) {
89
+ const inset = this.getInset(handle);
90
+ inset.webview.postMessage(value);
91
+ return true;
92
+ }
93
+ getInset(handle) {
94
+ const inset = this._insets.get(handle);
95
+ if (!inset) {
96
+ throw new Error('Unknown inset');
97
+ }
98
+ return inset;
99
+ }
100
+ };
101
+ MainThreadEditorInsets = __decorate([
102
+ extHostNamedCustomer(MainContext.MainThreadEditorInsets),
103
+ ( __param(1, ICodeEditorService)),
104
+ ( __param(2, IWebviewService))
105
+ ], MainThreadEditorInsets);
106
+
107
+ export { MainThreadEditorInsets };
@@ -0,0 +1,94 @@
1
+ import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
+ import { DisposableMap } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
3
+ import { revive } from 'monaco-editor/esm/vs/base/common/marshalling.js';
4
+ import { ICommandService, CommandsRegistry } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
5
+ import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
6
+ import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
7
+ import { SerializableObjectWithBuffers } from 'vscode/vscode/vs/workbench/services/extensions/common/proxyIdentifier';
8
+ import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
9
+
10
+ let MainThreadCommands = class MainThreadCommands {
11
+ constructor(extHostContext, _commandService, _extensionService) {
12
+ this._commandService = _commandService;
13
+ this._extensionService = _extensionService;
14
+ this._commandRegistrations = ( new DisposableMap());
15
+ this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostCommands));
16
+ this._generateCommandsDocumentationRegistration = CommandsRegistry.registerCommand('_generateCommandsDocumentation', () => this._generateCommandsDocumentation());
17
+ }
18
+ dispose() {
19
+ this._commandRegistrations.dispose();
20
+ this._generateCommandsDocumentationRegistration.dispose();
21
+ }
22
+ async _generateCommandsDocumentation() {
23
+ const result = await this._proxy.$getContributedCommandHandlerDescriptions();
24
+ const commands = CommandsRegistry.getCommands();
25
+ for (const [id, command] of commands) {
26
+ if (command.description) {
27
+ result[id] = command.description;
28
+ }
29
+ }
30
+ const all = [];
31
+ for (const id in result) {
32
+ all.push('`' + id + '` - ' + _generateMarkdown(result[id]));
33
+ }
34
+ console.log(all.join('\n'));
35
+ }
36
+ $registerCommand(id) {
37
+ this._commandRegistrations.set(id, CommandsRegistry.registerCommand(id, (accessor, ...args) => {
38
+ return this._proxy.$executeContributedCommand(id, ...args).then(result => {
39
+ return revive(result);
40
+ });
41
+ }));
42
+ }
43
+ $unregisterCommand(id) {
44
+ this._commandRegistrations.deleteAndDispose(id);
45
+ }
46
+ $fireCommandActivationEvent(id) {
47
+ const activationEvent = `onCommand:${id}`;
48
+ if (!this._extensionService.activationEventIsDone(activationEvent)) {
49
+ this._extensionService.activateByEvent(activationEvent);
50
+ }
51
+ }
52
+ async $executeCommand(id, args, retry) {
53
+ if (args instanceof SerializableObjectWithBuffers) {
54
+ args = args.value;
55
+ }
56
+ for (let i = 0; i < args.length; i++) {
57
+ args[i] = revive(args[i]);
58
+ }
59
+ if (retry && args.length > 0 && !CommandsRegistry.getCommand(id)) {
60
+ await this._extensionService.activateByEvent(`onCommand:${id}`);
61
+ throw new Error('$executeCommand:retry');
62
+ }
63
+ return this._commandService.executeCommand(id, ...args);
64
+ }
65
+ $getCommands() {
66
+ return Promise.resolve([...( CommandsRegistry.getCommands().keys())]);
67
+ }
68
+ };
69
+ MainThreadCommands = __decorate([
70
+ extHostNamedCustomer(MainContext.MainThreadCommands),
71
+ ( __param(1, ICommandService)),
72
+ ( __param(2, IExtensionService))
73
+ ], MainThreadCommands);
74
+ function _generateMarkdown(description) {
75
+ if (typeof description === 'string') {
76
+ return description;
77
+ }
78
+ else {
79
+ const parts = [description.description];
80
+ parts.push('\n\n');
81
+ if (description.args) {
82
+ for (const arg of description.args) {
83
+ parts.push(`* _${arg.name}_ - ${arg.description || ''}\n`);
84
+ }
85
+ }
86
+ if (description.returns) {
87
+ parts.push(`* _(returns)_ - ${description.returns}`);
88
+ }
89
+ parts.push('\n\n');
90
+ return parts.join('');
91
+ }
92
+ }
93
+
94
+ export { MainThreadCommands };