@codingame/monaco-vscode-extensions-service-override 36.2.7 → 37.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/package.json +3 -3
  2. package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +29 -29
  3. package/vscode/src/vs/platform/telemetry/common/assignmentContext.d.ts +4 -0
  4. package/vscode/src/vs/platform/telemetry/common/assignmentContext.js +13 -0
  5. package/vscode/src/vs/workbench/api/browser/mainThreadAgentEditorComments.d.ts +1 -0
  6. package/vscode/src/vs/workbench/api/browser/mainThreadAgentEditorComments.js +14 -1
  7. package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.d.ts +9 -3
  8. package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +56 -39
  9. package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +1 -1
  10. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.d.ts +2 -2
  11. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +6 -5
  12. package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.d.ts +2 -2
  13. package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.js +5 -2
  14. package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.js +2 -2
  15. package/vscode/src/vs/workbench/api/browser/mainThreadChatInputNotification.js +7 -2
  16. package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +8 -3
  17. package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +6 -6
  18. package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +2 -2
  19. package/vscode/src/vs/workbench/api/browser/mainThreadDataChannels.d.ts +17 -1
  20. package/vscode/src/vs/workbench/api/browser/mainThreadDataChannels.js +130 -4
  21. package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +2 -8
  22. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.d.ts +2 -3
  23. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +8 -12
  24. package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +1 -1
  25. package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +9 -1
  26. package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +11 -11
  27. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +20 -20
  28. package/vscode/src/vs/workbench/api/browser/mainThreadGitExtensionService.d.ts +1 -1
  29. package/vscode/src/vs/workbench/api/browser/mainThreadGitExtensionService.js +2 -2
  30. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +1 -0
  31. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +2 -2
  32. package/vscode/src/vs/workbench/api/browser/mainThreadMcp.d.ts +42 -0
  33. package/vscode/src/vs/workbench/api/browser/mainThreadMcp.js +42 -23
  34. package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +4 -4
  35. package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +2 -0
  36. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +1 -1
  37. package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +3 -3
  38. package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +1 -1
  39. package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +1 -1
  40. package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +1 -1
  41. package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.d.ts +19 -0
  42. package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +14 -1
  43. package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +12 -5
  44. package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +2 -2
  45. package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +5 -3
  46. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.d.ts +5 -1
  47. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +39 -4
  48. package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +1 -1
  49. package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +5 -5
  50. package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +1 -1
  51. package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +23 -23
  52. package/vscode/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.js +2 -2
  53. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +12 -12
  54. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +1 -1
  55. package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +1 -1
  56. package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +1 -1
  57. package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +4 -4
  58. package/vscode/src/vs/workbench/services/themes/browser/cssExtensionPoint.js +6 -6
@@ -39,7 +39,7 @@ import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode
39
39
  import { NotebookDto } from './mainThreadNotebookDto.js';
40
40
  import { isUntitledChatSession, getChatSessionType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatUri';
41
41
  import { ICustomizationHarnessService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService.service';
42
- import { AICustomizationManagementSection, AICustomizationSources } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService';
42
+ import { AICustomizationManagementSection } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService';
43
43
  import { IAgentPluginService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/agentPluginService.service';
44
44
  import { IWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service';
45
45
  import { getAgentSessionProvider, AgentSessionProviders } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessions';
@@ -187,6 +187,8 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
187
187
  return "extension";
188
188
  case PromptsStorage.plugin:
189
189
  return "plugin";
190
+ case PromptsStorage.builtIn:
191
+ return "builtin";
190
192
  }
191
193
  }
192
194
  _toCustomAgentDto(agent) {
@@ -734,7 +736,9 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
734
736
  }
735
737
  return ( folders.map(folder => ({
736
738
  uri: URI.revive(folder.uri),
737
- label: folder.label
739
+ label: folder.label,
740
+ source: folder.source,
741
+ destinationGroupId: folder.destinationGroupId
738
742
  })));
739
743
  }
740
744
  };
@@ -762,9 +766,6 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
762
766
  label: metadata.label,
763
767
  icon: metadata.iconId ? ThemeIcon.fromId(metadata.iconId) : ThemeIcon.fromId(Codicon.extensions.id),
764
768
  hiddenSections,
765
- getStorageSourceFilter: () => ({
766
- sources: AICustomizationSources.all
767
- }),
768
769
  itemProvider
769
770
  };
770
771
  const registration = this._customizationHarnessService.registerExternalHarness(descriptor);
@@ -1,6 +1,6 @@
1
1
  import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
2
  import { IExtHostContext } from "../../services/extensions/common/extHostCustomers.js";
3
- import { IChatContextItemDto, IDocumentFilterDto, MainThreadChatContextShape } from "@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol";
3
+ import { IChatContextItemDto, ITabSelectorDto, MainThreadChatContextShape } from "@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol";
4
4
  import { IChatContextService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/contextContrib/chatContextService.service";
5
5
  export declare class MainThreadChatContext extends Disposable implements MainThreadChatContextShape {
6
6
  private readonly _chatContextService;
@@ -9,7 +9,7 @@ export declare class MainThreadChatContext extends Disposable implements MainThr
9
9
  constructor(extHostContext: IExtHostContext, _chatContextService: IChatContextService);
10
10
  $registerChatWorkspaceContextProvider(handle: number, id: string): void;
11
11
  $registerChatExplicitContextProvider(handle: number, id: string): void;
12
- $registerChatResourceContextProvider(handle: number, id: string, selector: IDocumentFilterDto[]): void;
12
+ $registerChatResourceContextProvider(handle: number, id: string, selector: ITabSelectorDto): void;
13
13
  $unregisterChatContextProvider(handle: number): void;
14
14
  $updateWorkspaceContextItems(handle: number, items: IChatContextItemDto[]): void;
15
15
  $executeChatContextItemCommand(itemHandle: number): Promise<void>;
@@ -5,10 +5,12 @@ import { extHostNamedCustomer } from '../../services/extensions/common/extHostCu
5
5
  import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
6
6
  import { IChatContextService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/contextContrib/chatContextService.service';
7
7
  import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
8
+ import { IconPath } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHostTypeConverters';
8
9
 
9
10
  function reviveContextItem(item) {
10
11
  return {
11
12
  ...item,
13
+ iconPath: IconPath.to(item.iconPath),
12
14
  resourceUri: item.resourceUri ? URI.revive(item.resourceUri) : undefined
13
15
  };
14
16
  }
@@ -55,10 +57,11 @@ let MainThreadChatContext = class MainThreadChatContext extends Disposable {
55
57
  selector
56
58
  });
57
59
  this._chatContextService.registerChatResourceContextProvider(id, selector, {
58
- provideChatContext: async (resource, withValue, token) => {
60
+ provideChatContext: async (resource, withValue, viewType, token) => {
59
61
  const result = await this._proxy.$provideResourceChatContext(handle, {
60
62
  resource,
61
- withValue
63
+ withValue,
64
+ viewType
62
65
  }, token);
63
66
  return result ? reviveContextItem(result) : undefined;
64
67
  },
@@ -60,13 +60,13 @@ let MainThreadChatDebug = class MainThreadChatDebug extends Disposable {
60
60
  return uri;
61
61
  }
62
62
  }));
63
- this._chatDebugService.registerAvailableSessionsFetcher(async token => {
63
+ disposables.add(this._chatDebugService.registerAvailableSessionsFetcher(async token => {
64
64
  const entries = await this._proxy.$getAvailableDebugSessionResources(handle, token);
65
65
  return ( entries.map(e => ({
66
66
  uri: URI.revive(e.uri),
67
67
  title: e.title
68
68
  })));
69
- });
69
+ }));
70
70
  }
71
71
  $unregisterChatDebugLogProvider(handle) {
72
72
  const disposables = this._providerDisposables.get(handle);
@@ -1,6 +1,7 @@
1
1
 
2
2
  import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
3
  import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
4
+ import { ChatInputNotificationActionKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService';
4
5
  import { IChatInputNotificationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.service';
5
6
  import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
6
7
  import { MainContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
@@ -16,9 +17,13 @@ let MainThreadChatInputNotification = class MainThreadChatInputNotification exte
16
17
  severity: notification.severity,
17
18
  message: notification.message,
18
19
  description: notification.description,
19
- actions: notification.actions,
20
+ actions: ( notification.actions.map(action => ({
21
+ ...action,
22
+ kind: ChatInputNotificationActionKind.Command
23
+ }))),
20
24
  dismissible: notification.dismissible,
21
- autoDismissOnMessage: notification.autoDismissOnMessage
25
+ autoDismissOnMessage: notification.autoDismissOnMessage,
26
+ sessionTypes: notification.sessionTypes
22
27
  });
23
28
  }
24
29
  $disposeNotification(id) {
@@ -2,6 +2,7 @@
2
2
  import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
3
  import { raceCancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
4
4
  import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
5
+ import { isCancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
5
6
  import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
6
7
  import { markdownStringEqual, MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
7
8
  import { Disposable, DisposableResourceMap, DisposableMap, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
@@ -137,7 +138,7 @@ class ObservableChatSession extends Disposable {
137
138
  return confirmInterrupt();
138
139
  }
139
140
  return this._dialogService.confirm({
140
- message: ( localize(2738, "Are you sure you want to interrupt the active session?"))
141
+ message: ( localize(2973, "Are you sure you want to interrupt the active session?"))
141
142
  }).then(confirmed => {
142
143
  if (confirmed.confirmed) {
143
144
  return confirmInterrupt();
@@ -662,7 +663,7 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
662
663
  const options = {
663
664
  title: {
664
665
  preferred: originalEditor?.getName() || undefined,
665
- fallback: ( localize(2739, "{0}", contribution?.displayName))
666
+ fallback: ( localize(2974, "{0}", contribution?.displayName))
666
667
  }
667
668
  };
668
669
  const newSession = await this._chatSessionsService.getOrCreateChatSession(URI.revive(modifiedResource), CancellationToken.None);
@@ -850,7 +851,11 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
850
851
  if (options?.optionGroups && options.optionGroups.length) {
851
852
  this._chatSessionsService.setOptionGroupsForSessionType(chatSessionScheme, handle, [...options.optionGroups]);
852
853
  }
853
- }).catch(err => this._logService.error("Error fetching chat session options", err));
854
+ }).catch(err => {
855
+ if (!isCancellationError(err)) {
856
+ this._logService.error("Error fetching chat session options", err);
857
+ }
858
+ });
854
859
  }
855
860
  dispose() {
856
861
  for (const session of ( this._activeSessions.values())) {
@@ -468,7 +468,7 @@ let MainThreadCommentController = class MainThreadCommentController extends Disp
468
468
  }
469
469
  };
470
470
  MainThreadCommentController = ( __decorate([( __param(6, ICommentService)), ( __param(7, IUriIdentityService))], MainThreadCommentController));
471
- const commentsViewIcon = registerIcon("comments-view-icon", Codicon.commentDiscussion, ( localize(2740, "View icon of the comments view.")));
471
+ const commentsViewIcon = registerIcon("comments-view-icon", Codicon.commentDiscussion, ( localize(2975, "View icon of the comments view.")));
472
472
  let MainThreadComments = class MainThreadComments extends Disposable {
473
473
  constructor(
474
474
  extHostContext,
@@ -627,8 +627,8 @@ let MainThreadComments = class MainThreadComments extends Disposable {
627
627
  thread.collapsibleState = CommentThreadCollapsibleState.Collapsed;
628
628
  }
629
629
  registerView() {
630
- const commentsPanelAlreadyConstructed = !!this._viewDescriptorService.getViewDescriptorById(COMMENTS_VIEW_ID);
631
- if (!commentsPanelAlreadyConstructed) {
630
+ const commentsViewAlreadyRegistered = ( Registry.as(Extensions.ViewsRegistry)).getView(COMMENTS_VIEW_ID) !== null;
631
+ if (!commentsViewAlreadyRegistered) {
632
632
  const VIEW_CONTAINER = ( Registry.as(Extensions.ViewContainersRegistry)).registerViewContainer({
633
633
  id: COMMENTS_VIEW_ID,
634
634
  title: COMMENTS_VIEW_TITLE,
@@ -652,7 +652,7 @@ let MainThreadComments = class MainThreadComments extends Disposable {
652
652
  }
653
653
  }], VIEW_CONTAINER);
654
654
  }
655
- this.registerViewListeners(commentsPanelAlreadyConstructed);
655
+ this.registerViewListeners(commentsViewAlreadyRegistered);
656
656
  }
657
657
  setComments() {
658
658
  [...( this._commentControllers.keys())].forEach(handle => {
@@ -675,8 +675,8 @@ let MainThreadComments = class MainThreadComments extends Disposable {
675
675
  });
676
676
  }
677
677
  }
678
- registerViewListeners(commentsPanelAlreadyConstructed) {
679
- if (!commentsPanelAlreadyConstructed) {
678
+ registerViewListeners(commentsViewAlreadyRegistered) {
679
+ if (!commentsViewAlreadyRegistered) {
680
680
  this.registerViewOpenedListener();
681
681
  }
682
682
  if (!this._onChangeContainerListener.value) {
@@ -532,7 +532,7 @@ let MainThreadCustomEditorModel = MainThreadCustomEditorModel_1 = class MainThre
532
532
  this._register(workingCopyService.registerWorkingCopy(this));
533
533
  this._register(extensionService.onWillStop(e => {
534
534
  e.veto(true, ( localize(
535
- 2741,
535
+ 2976,
536
536
  "An extension provided editor for '{0}' is still open that would close otherwise.",
537
537
  this.name
538
538
  )));
@@ -600,7 +600,7 @@ let MainThreadCustomEditorModel = MainThreadCustomEditorModel_1 = class MainThre
600
600
  this._undoService.pushElement({
601
601
  type: UndoRedoElementType.Resource,
602
602
  resource: this._editorResource,
603
- label: label ?? ( localize(2742, "Edit")),
603
+ label: label ?? ( localize(2977, "Edit")),
604
604
  code: "undoredo.customEditorEdit",
605
605
  undo: () => this.undo(),
606
606
  redo: () => this.redo()
@@ -1,9 +1,25 @@
1
1
  import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
+ import { UriComponents } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
3
+ import { LinkPresentationKind } from "@codingame/monaco-vscode-api/vscode/vs/platform/dataChannel/common/dataChannel";
4
+ import { ILinkPresentationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/dataChannel/common/dataChannel.service";
2
5
  import { IDataChannelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/dataChannel/common/dataChannel.service";
6
+ import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
3
7
  import { IExtHostContext } from "../../services/extensions/common/extHostCustomers.js";
4
8
  import { MainThreadDataChannelsShape } from "@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol";
5
9
  export declare class MainThreadDataChannels extends Disposable implements MainThreadDataChannelsShape {
6
10
  private readonly _dataChannelService;
11
+ private readonly _linkPresentationService;
12
+ private readonly _logService;
7
13
  private readonly _proxy;
8
- constructor(extHostContext: IExtHostContext, _dataChannelService: IDataChannelService);
14
+ private readonly _linkPresentationWatchers;
15
+ private readonly _linkPresentationProviders;
16
+ private readonly _providedLinkPresentationWatchers;
17
+ private static _providedLinkPresentationWatcherHandlePool;
18
+ constructor(extHostContext: IExtHostContext, _dataChannelService: IDataChannelService, _linkPresentationService: ILinkPresentationService, _logService: ILogService);
19
+ $createLinkPresentationWatcher(handle: number, providerId: string, kind: LinkPresentationKind, resource: UriComponents): void;
20
+ $disposeLinkPresentationWatcher(handle: number): void;
21
+ $registerLinkPresentationProvider(handle: number, extensionId: string, providerId: string): void;
22
+ $unregisterLinkPresentationProvider(handle: number): void;
23
+ $acceptLinkPresentationProviderData(handle: number, data: unknown): void;
24
+ private _createExtensionLinkPresentationWatcher;
9
25
  }
@@ -1,20 +1,146 @@
1
1
 
2
2
  import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
- import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
4
- import { IDataChannelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dataChannel/common/dataChannel.service';
3
+ import { onUnexpectedError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
4
+ import { Disposable, DisposableMap, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
5
+ import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
6
+ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
7
+ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
8
+ import { parseLinkPresentation } from '@codingame/monaco-vscode-api/vscode/vs/platform/dataChannel/common/dataChannel';
9
+ import { IDataChannelService, ILinkPresentationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dataChannel/common/dataChannel.service';
10
+ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
5
11
  import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
6
12
  import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
13
+ import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
14
+ import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
7
15
 
16
+ var MainThreadDataChannels_1;
8
17
  let MainThreadDataChannels = class MainThreadDataChannels extends Disposable {
9
- constructor(extHostContext, _dataChannelService) {
18
+ static {
19
+ MainThreadDataChannels_1 = this;
20
+ }
21
+ static {
22
+ this._providedLinkPresentationWatcherHandlePool = 0;
23
+ }
24
+ constructor(extHostContext, _dataChannelService, _linkPresentationService, _logService) {
10
25
  super();
11
26
  this._dataChannelService = _dataChannelService;
27
+ this._linkPresentationService = _linkPresentationService;
28
+ this._logService = _logService;
29
+ this._linkPresentationWatchers = this._register(( new DisposableMap()));
30
+ this._linkPresentationProviders = this._register(( new DisposableMap()));
31
+ this._providedLinkPresentationWatchers = this._register(( new DisposableMap()));
12
32
  this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostDataChannels));
13
33
  this._register(this._dataChannelService.onDidSendData(e => {
14
34
  this._proxy.$onDidReceiveData(e.channelId, e.data);
15
35
  }));
36
+ const updateLinkPresentationRules = () => this._proxy.$acceptLinkPresentationRules(( this._linkPresentationService.linkPresentationRules.map(rule => ({
37
+ id: rule.id,
38
+ source: rule.uriPattern.source,
39
+ flags: rule.uriPattern.flags,
40
+ kind: rule.kind
41
+ }))));
42
+ updateLinkPresentationRules();
43
+ this._register(
44
+ this._linkPresentationService.onDidChangeLinkPresentationRules(updateLinkPresentationRules)
45
+ );
46
+ }
47
+ $createLinkPresentationWatcher(handle, providerId, kind, resource) {
48
+ const watcher = this._linkPresentationService.createLinkPresentationWatcher(providerId, URI.revive(resource));
49
+ if (!watcher) {
50
+ this._logService.warn(
51
+ `[MainThreadDataChannels] Link presentation provider '${providerId}' does not accept '${( URI.revive(resource).toString(true))}'`
52
+ );
53
+ this._proxy.$acceptLinkPresentation(handle, {
54
+ kind,
55
+ status: {
56
+ kind: "error",
57
+ label: ( localize(2978, "Not available"))
58
+ },
59
+ tooltip: ( localize(
60
+ 2979,
61
+ "The selected link presentation provider does not accept this resource."
62
+ )),
63
+ ariaLabel: ( localize(2980, "Link presentation is not available"))
64
+ });
65
+ return;
66
+ }
67
+ const store = ( new DisposableStore());
68
+ store.add(autorun(reader => {
69
+ const presentation = watcher.presentation.read(reader);
70
+ if (presentation) {
71
+ this._proxy.$acceptLinkPresentation(handle, presentation);
72
+ }
73
+ }));
74
+ store.add(watcher);
75
+ this._linkPresentationWatchers.set(handle, store);
76
+ }
77
+ $disposeLinkPresentationWatcher(handle) {
78
+ this._linkPresentationWatchers.deleteAndDispose(handle);
79
+ }
80
+ $registerLinkPresentationProvider(handle, extensionId, providerId) {
81
+ const provider = {
82
+ createLinkPresentationWatcher: resource => this._createExtensionLinkPresentationWatcher(handle, resource)
83
+ };
84
+ this._linkPresentationProviders.set(
85
+ handle,
86
+ this._linkPresentationService.registerExtensionLinkPresentationProvider(extensionId, providerId, provider)
87
+ );
88
+ }
89
+ $unregisterLinkPresentationProvider(handle) {
90
+ this._linkPresentationProviders.deleteAndDispose(handle);
91
+ }
92
+ $acceptLinkPresentationProviderData(handle, data) {
93
+ this._providedLinkPresentationWatchers.get(handle)?.acceptPresentation(data);
94
+ }
95
+ _createExtensionLinkPresentationWatcher(providerHandle, resource) {
96
+ const handle = MainThreadDataChannels_1._providedLinkPresentationWatcherHandlePool++;
97
+ const watcher = ( new MainThreadExtensionLinkPresentationWatcher(() => {
98
+ this._providedLinkPresentationWatchers.deleteAndLeak(handle);
99
+ this._proxy.$disposeLinkPresentationWatcher(handle);
100
+ }));
101
+ this._providedLinkPresentationWatchers.set(handle, watcher);
102
+ void this._proxy.$createLinkPresentationWatcher(handle, providerHandle, resource).then(data => watcher.initializePresentation(data), error => {
103
+ onUnexpectedError(error);
104
+ watcher.initializePresentation({
105
+ kind: "resource",
106
+ status: {
107
+ kind: "error",
108
+ label: ( localize(2978, "Not available"))
109
+ },
110
+ tooltip: ( localize(2981, "The link presentation provider failed to load.")),
111
+ ariaLabel: ( localize(2980, "Link presentation is not available"))
112
+ });
113
+ });
114
+ return watcher;
16
115
  }
17
116
  };
18
- MainThreadDataChannels = __decorate([extHostNamedCustomer(MainContext.MainThreadDataChannels), ( __param(1, IDataChannelService))], MainThreadDataChannels);
117
+ MainThreadDataChannels = MainThreadDataChannels_1 = __decorate([extHostNamedCustomer(MainContext.MainThreadDataChannels), ( __param(1, IDataChannelService)), ( __param(2, ILinkPresentationService)), ( __param(3, ILogService))], MainThreadDataChannels);
118
+ class MainThreadExtensionLinkPresentationWatcher extends Disposable {
119
+ constructor(_onDispose) {
120
+ super();
121
+ this._onDispose = _onDispose;
122
+ this._presentation = observableValue(this, undefined);
123
+ this.presentation = this._presentation;
124
+ this._isDisposed = false;
125
+ }
126
+ acceptPresentation(data) {
127
+ if (!this._isDisposed) {
128
+ this._presentation.set(parseLinkPresentation(data), undefined);
129
+ }
130
+ }
131
+ initializePresentation(data) {
132
+ if (!this._isDisposed && !this._presentation.get()) {
133
+ this.acceptPresentation(data);
134
+ }
135
+ }
136
+ dispose() {
137
+ if (this._isDisposed) {
138
+ return;
139
+ }
140
+ this._isDisposed = true;
141
+ super.dispose();
142
+ this._onDispose();
143
+ }
144
+ }
19
145
 
20
146
  export { MainThreadDataChannels };
@@ -52,14 +52,8 @@ let MainThreadDiagnostics = class MainThreadDiagnostics {
52
52
  resource,
53
53
  ignoreResourceFilters: true
54
54
  });
55
- if (allMarkerData.length === 0) {
56
- data.push([resource, []]);
57
- } else {
58
- const foreignMarkerData = allMarkerData.filter(marker => marker?.origin !== this.extHostId);
59
- if (foreignMarkerData.length > 0) {
60
- data.push([resource, foreignMarkerData]);
61
- }
62
- }
55
+ const markerData = allMarkerData.filter(marker => marker.origin !== this.extHostId);
56
+ data.push([resource, markerData]);
63
57
  }
64
58
  if (data.length > 0) {
65
59
  this._proxy.$acceptMarkersChange(data);
@@ -1,3 +1,4 @@
1
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
1
2
  import { ICodeEditor } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorBrowser";
2
3
  import { ICodeEditorService } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/codeEditorService.service";
3
4
  import { IModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service";
@@ -18,19 +19,17 @@ import { IPathService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/s
18
19
  import { IPaneCompositePartService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/panecomposite/browser/panecomposite.service";
19
20
  import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
20
21
  import { IQuickDiffModelService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/browser/quickDiffModel.service";
21
- export declare class MainThreadDocumentsAndEditors implements IMainThreadEditorLocator {
22
+ export declare class MainThreadDocumentsAndEditors extends Disposable implements IMainThreadEditorLocator {
22
23
  private readonly _modelService;
23
24
  private readonly _textFileService;
24
25
  private readonly _editorService;
25
26
  private readonly _editorGroupService;
26
27
  private readonly _clipboardService;
27
- private readonly _toDispose;
28
28
  private readonly _proxy;
29
29
  private readonly _mainThreadDocuments;
30
30
  private readonly _mainThreadEditors;
31
31
  private readonly _textEditors;
32
32
  constructor(extHostContext: IExtHostContext, _modelService: IModelService, _textFileService: ITextFileService, _editorService: IEditorService, codeEditorService: ICodeEditorService, fileService: IFileService, textModelResolverService: ITextModelService, _editorGroupService: IEditorGroupsService, paneCompositeService: IPaneCompositePartService, environmentService: IWorkbenchEnvironmentService, workingCopyFileService: IWorkingCopyFileService, uriIdentityService: IUriIdentityService, _clipboardService: IClipboardService, pathService: IPathService, configurationService: IConfigurationService, quickDiffModelService: IQuickDiffModelService);
33
- dispose(): void;
34
33
  private _onDelta;
35
34
  private _toModelAddData;
36
35
  private _toTextEditorAddData;
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
3
  import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
4
- import { DisposableStore, DisposableMap, combinedDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
4
+ import { DisposableStore, DisposableMap, combinedDisposable, Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
5
5
  import { isCodeEditor, isDiffEditor } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorBrowser';
6
6
  import { ICodeEditorService } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/codeEditorService.service';
7
7
  import { shouldSynchronizeModel } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model';
@@ -233,7 +233,7 @@ let MainThreadDocumentAndEditorStateComputer = class MainThreadDocumentAndEditor
233
233
  }
234
234
  };
235
235
  MainThreadDocumentAndEditorStateComputer = ( __decorate([( __param(1, IModelService)), ( __param(2, ICodeEditorService)), ( __param(3, IEditorService)), ( __param(4, IPaneCompositePartService))], MainThreadDocumentAndEditorStateComputer));
236
- let MainThreadDocumentsAndEditors = class MainThreadDocumentsAndEditors {
236
+ let MainThreadDocumentsAndEditors = class MainThreadDocumentsAndEditors extends Disposable {
237
237
  constructor(
238
238
  extHostContext,
239
239
  _modelService,
@@ -252,15 +252,15 @@ let MainThreadDocumentsAndEditors = class MainThreadDocumentsAndEditors {
252
252
  configurationService,
253
253
  quickDiffModelService
254
254
  ) {
255
+ super();
255
256
  this._modelService = _modelService;
256
257
  this._textFileService = _textFileService;
257
258
  this._editorService = _editorService;
258
259
  this._editorGroupService = _editorGroupService;
259
260
  this._clipboardService = _clipboardService;
260
- this._toDispose = ( new DisposableStore());
261
- this._textEditors = ( new Map());
261
+ this._textEditors = this._register(( new DisposableMap()));
262
262
  this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostDocumentsAndEditors));
263
- this._mainThreadDocuments = this._toDispose.add(( new MainThreadDocuments(
263
+ this._mainThreadDocuments = this._register(( new MainThreadDocuments(
264
264
  extHostContext,
265
265
  this._modelService,
266
266
  this._textFileService,
@@ -272,7 +272,7 @@ let MainThreadDocumentsAndEditors = class MainThreadDocumentsAndEditors {
272
272
  pathService
273
273
  )));
274
274
  extHostContext.set(MainContext.MainThreadDocuments, this._mainThreadDocuments);
275
- this._mainThreadEditors = this._toDispose.add(( new MainThreadTextEditors(
275
+ this._mainThreadEditors = this._register(( new MainThreadTextEditors(
276
276
  this,
277
277
  extHostContext,
278
278
  codeEditorService,
@@ -283,7 +283,7 @@ let MainThreadDocumentsAndEditors = class MainThreadDocumentsAndEditors {
283
283
  uriIdentityService
284
284
  )));
285
285
  extHostContext.set(MainContext.MainThreadTextEditors, this._mainThreadEditors);
286
- this._toDispose.add(( new MainThreadDocumentAndEditorStateComputer(
286
+ this._register(( new MainThreadDocumentAndEditorStateComputer(
287
287
  delta => this._onDelta(delta),
288
288
  _modelService,
289
289
  codeEditorService,
@@ -291,9 +291,6 @@ let MainThreadDocumentsAndEditors = class MainThreadDocumentsAndEditors {
291
291
  paneCompositeService
292
292
  )));
293
293
  }
294
- dispose() {
295
- this._toDispose.dispose();
296
- }
297
294
  _onDelta(delta) {
298
295
  const removedEditors = [];
299
296
  const addedEditors = [];
@@ -311,8 +308,7 @@ let MainThreadDocumentsAndEditors = class MainThreadDocumentsAndEditors {
311
308
  } of delta.removedEditors) {
312
309
  const mainThreadEditor = this._textEditors.get(id);
313
310
  if (mainThreadEditor) {
314
- mainThreadEditor.dispose();
315
- this._textEditors.delete(id);
311
+ this._textEditors.deleteAndDispose(id);
316
312
  removedEditors.push(id);
317
313
  }
318
314
  }
@@ -14,7 +14,7 @@ class ExtHostEditSessionIdentityCreateParticipant {
14
14
  }
15
15
  async participate(workspaceFolder, token) {
16
16
  const p = ( new Promise((resolve, reject) => {
17
- setTimeout(() => reject(( new Error(( localize(2743, "Aborted onWillCreateEditSessionIdentity-event after 10000ms"))))), this.timeout);
17
+ setTimeout(() => reject(( new Error(( localize(2982, "Aborted onWillCreateEditSessionIdentity-event after 10000ms"))))), this.timeout);
18
18
  this._proxy.$onWillCreateEditSessionIdentity(workspaceFolder.uri, token, this.timeout).then(resolve, reject);
19
19
  }));
20
20
  return raceCancellationError(p, token);
@@ -211,6 +211,9 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
211
211
  kind: TabModelOperationKind.TAB_UPDATE
212
212
  });
213
213
  } else {
214
+ if (this._editorGroupsService.activeModalEditorPart?.groups.some(group => group.id === groupId)) {
215
+ return;
216
+ }
214
217
  this._logService.error("Invalid model for label change, rebuilding");
215
218
  this._createTabsModel();
216
219
  }
@@ -240,7 +243,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
240
243
  if (!tabInfo) {
241
244
  return;
242
245
  }
243
- tabInfo.tab = this._buildTabObject(group, editorInput, editorIndex);
246
+ Object.assign(tabInfo.tab, this._buildTabObject(group, editorInput, editorIndex));
244
247
  this._proxy.$acceptTabOperation({
245
248
  groupId,
246
249
  index: editorIndex,
@@ -285,6 +288,11 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
285
288
  }
286
289
  const activeTab = tabs[editorIndex];
287
290
  activeTab.isActive = true;
291
+ for (const tab of tabs) {
292
+ if (tab !== activeTab) {
293
+ tab.isActive = false;
294
+ }
295
+ }
288
296
  this._proxy.$acceptTabOperation({
289
297
  groupId,
290
298
  index: editorIndex,