@codingame/monaco-vscode-extensions-service-override 4.5.1 → 5.0.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.
- package/extensions.js +0 -2
- package/package.json +3 -3
- package/vscode/src/vs/base/common/console.js +1 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +69 -136
- package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +32 -37
- package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +20 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +12 -11
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +34 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +44 -38
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +60 -66
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +6 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +10 -9
- package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +45 -21
- package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +41 -50
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +53 -100
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +30 -13
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +32 -41
- package/vscode/src/vs/workbench/api/browser/mainThreadLogService.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +47 -56
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +3 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +5 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +7 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +11 -12
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +8 -11
- package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +185 -165
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.js +38 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +1 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +28 -30
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +23 -23
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewViews.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +19 -18
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +36 -33
- package/vscode/src/vs/workbench/api/common/shared/dataTransferCache.js +2 -2
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +56 -121
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +5 -5
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +133 -144
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +34 -33
- package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +9 -8
- package/vscode/src/vs/workbench/services/extensions/common/lazyCreateExtensionHostManager.js +2 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +0 -70
- package/vscode/src/vs/workbench/api/browser/mainThreadIssueReporter.js +0 -50
|
@@ -16,7 +16,7 @@ let MainThreadBulkEdits = class MainThreadBulkEdits {
|
|
|
16
16
|
}
|
|
17
17
|
dispose() { }
|
|
18
18
|
$tryApplyWorkspaceEdit(dto, undoRedoGroupId, isRefactoring) {
|
|
19
|
-
const edits = reviveWorkspaceEditDto(dto, this._uriIdentService);
|
|
19
|
+
const edits = reviveWorkspaceEditDto(dto.value, this._uriIdentService);
|
|
20
20
|
return this._bulkEditService.apply(edits, { undoRedoGroupId, respectAutoSaveConfig: isRefactoring }).then((res) => res.isApplied, err => {
|
|
21
21
|
this._logService.warn(`IGNORING workspace edit: ${err}`);
|
|
22
22
|
return false;
|
|
@@ -50,7 +50,7 @@ function reviveWorkspaceEditDto(data, uriIdentityService, resolveDataTransferFil
|
|
|
50
50
|
edit.options.contents = resolveDataTransferFile(inContents.id);
|
|
51
51
|
}
|
|
52
52
|
else {
|
|
53
|
-
throw new Error('Could not revive data transfer file');
|
|
53
|
+
throw ( new Error('Could not revive data transfer file'));
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -60,6 +60,24 @@ function reviveWorkspaceEditDto(data, uriIdentityService, resolveDataTransferFil
|
|
|
60
60
|
}
|
|
61
61
|
if (ResourceNotebookCellEdit.is(edit)) {
|
|
62
62
|
edit.resource = uriIdentityService.asCanonicalUri(edit.resource);
|
|
63
|
+
const cellEdit = edit.cellEdit;
|
|
64
|
+
if (cellEdit.editType === 1 ) {
|
|
65
|
+
edit.cellEdit = {
|
|
66
|
+
...cellEdit,
|
|
67
|
+
cells: ( cellEdit.cells.map(cell => ({
|
|
68
|
+
...cell,
|
|
69
|
+
outputs: ( cell.outputs.map(output => ({
|
|
70
|
+
...output,
|
|
71
|
+
outputs: ( output.items.map(item => {
|
|
72
|
+
return {
|
|
73
|
+
mime: item.mime,
|
|
74
|
+
data: item.valueBytes
|
|
75
|
+
};
|
|
76
|
+
}))
|
|
77
|
+
})))
|
|
78
|
+
})))
|
|
79
|
+
};
|
|
80
|
+
}
|
|
63
81
|
}
|
|
64
82
|
}
|
|
65
83
|
return data;
|
|
@@ -18,6 +18,7 @@ import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/service
|
|
|
18
18
|
import { IExtensionManagementServerService } from 'vscode/vscode/vs/workbench/services/extensionManagement/common/extensionManagement.service';
|
|
19
19
|
import { IExtensionManifestPropertiesService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensionManifestPropertiesService.service';
|
|
20
20
|
|
|
21
|
+
const _moduleId = "vs/workbench/api/browser/mainThreadCLICommands";
|
|
21
22
|
CommandsRegistry.registerCommand('_remoteCLI.openExternal', function (accessor, uri) {
|
|
22
23
|
const openerService = accessor.get(IOpenerService);
|
|
23
24
|
return openerService.open(isString(uri) ? uri : URI.revive(uri), { openExternal: true, allowTunneling: true });
|
|
@@ -46,12 +47,12 @@ CommandsRegistry.registerCommand('_remoteCLI.manageExtensions', async function (
|
|
|
46
47
|
lines.push(message);
|
|
47
48
|
}
|
|
48
49
|
})();
|
|
49
|
-
const cliService = instantiationService.createChild(( new ServiceCollection([IExtensionManagementService, remoteExtensionManagementService]))).createInstance(RemoteExtensionManagementCLI, logger);
|
|
50
|
+
const cliService = instantiationService.createChild(( (new ServiceCollection([IExtensionManagementService, remoteExtensionManagementService])))).createInstance(RemoteExtensionManagementCLI, logger);
|
|
50
51
|
if (args.list) {
|
|
51
52
|
await cliService.listExtensions(!!args.list.showVersions, args.list.category, undefined);
|
|
52
53
|
}
|
|
53
54
|
else {
|
|
54
|
-
const revive = (inputs) => ( inputs.map(input => isString(input) ? input : URI.revive(input)));
|
|
55
|
+
const revive = (inputs) => ( (inputs.map(input => isString(input) ? input : URI.revive(input))));
|
|
55
56
|
if (Array.isArray(args.install) && args.install.length) {
|
|
56
57
|
try {
|
|
57
58
|
await cliService.installExtensions(revive(args.install), [], { isMachineScoped: true }, !!args.force);
|
|
@@ -85,8 +86,8 @@ let RemoteExtensionManagementCLI = class RemoteExtensionManagementCLI extends Ex
|
|
|
85
86
|
if (!this._extensionManifestPropertiesService.canExecuteOnWorkspace(manifest)
|
|
86
87
|
&& !(isWeb && this._extensionManifestPropertiesService.canExecuteOnWeb(manifest))) {
|
|
87
88
|
this.logger.info(( localizeWithPath(
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
_moduleId,
|
|
90
|
+
0,
|
|
90
91
|
"Cannot install the '{0}' extension because it is declared to not run in this setup.",
|
|
91
92
|
getExtensionId(manifest.publisher, manifest.name)
|
|
92
93
|
)));
|
|
@@ -95,10 +96,10 @@ let RemoteExtensionManagementCLI = class RemoteExtensionManagementCLI extends Ex
|
|
|
95
96
|
return true;
|
|
96
97
|
}
|
|
97
98
|
};
|
|
98
|
-
RemoteExtensionManagementCLI = ( __decorate([
|
|
99
|
-
( __param(1, IExtensionManagementService)),
|
|
100
|
-
( __param(2, IExtensionGalleryService)),
|
|
101
|
-
( __param(3, ILabelService)),
|
|
102
|
-
( __param(4, IWorkbenchEnvironmentService)),
|
|
103
|
-
( __param(5, IExtensionManifestPropertiesService))
|
|
104
|
-
], RemoteExtensionManagementCLI));
|
|
99
|
+
RemoteExtensionManagementCLI = ( (__decorate([
|
|
100
|
+
( (__param(1, IExtensionManagementService))),
|
|
101
|
+
( (__param(2, IExtensionGalleryService))),
|
|
102
|
+
( (__param(3, ILabelService))),
|
|
103
|
+
( (__param(4, IWorkbenchEnvironmentService))),
|
|
104
|
+
( (__param(5, IExtensionManifestPropertiesService)))
|
|
105
|
+
], RemoteExtensionManagementCLI)));
|
|
@@ -2,10 +2,13 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
|
2
2
|
import { Disposable, DisposableMap } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
3
|
import { revive } from 'vscode/vscode/vs/base/common/marshalling';
|
|
4
4
|
import { escapeRegExpCharacters } from 'vscode/vscode/vs/base/common/strings';
|
|
5
|
+
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
5
6
|
import { Range } from 'vscode/vscode/vs/editor/common/core/range';
|
|
6
7
|
import { getWordAtText } from 'vscode/vscode/vs/editor/common/core/wordHelper';
|
|
7
8
|
import { ILanguageFeaturesService } from 'vscode/vscode/vs/editor/common/services/languageFeatures';
|
|
9
|
+
import { ExtensionIdentifier } from 'vscode/vscode/vs/platform/extensions/common/extensions';
|
|
8
10
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
11
|
+
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
9
12
|
import { ExtHostContext, MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
10
13
|
import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
11
14
|
import { ChatInputPart } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chatInputPart';
|
|
@@ -16,15 +19,18 @@ import { ChatRequestAgentPart } from 'vscode/vscode/vs/workbench/contrib/chat/co
|
|
|
16
19
|
import { ChatRequestParser } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatRequestParser';
|
|
17
20
|
import { IChatService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
18
21
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
22
|
+
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
19
23
|
|
|
20
24
|
let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
21
|
-
constructor(extHostContext, _chatAgentService, _chatService, _languageFeaturesService, _chatWidgetService, _instantiationService) {
|
|
25
|
+
constructor(extHostContext, _chatAgentService, _chatService, _languageFeaturesService, _chatWidgetService, _instantiationService, _logService, _extensionService) {
|
|
22
26
|
super();
|
|
23
27
|
this._chatAgentService = _chatAgentService;
|
|
24
28
|
this._chatService = _chatService;
|
|
25
29
|
this._languageFeaturesService = _languageFeaturesService;
|
|
26
30
|
this._chatWidgetService = _chatWidgetService;
|
|
27
31
|
this._instantiationService = _instantiationService;
|
|
32
|
+
this._logService = _logService;
|
|
33
|
+
this._extensionService = _extensionService;
|
|
28
34
|
this._agents = this._register(( new DisposableMap()));
|
|
29
35
|
this._agentCompletionProviders = this._register(( new DisposableMap()));
|
|
30
36
|
this._pendingProgress = ( new Map());
|
|
@@ -51,13 +57,25 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
|
51
57
|
$unregisterAgent(handle) {
|
|
52
58
|
this._agents.deleteAndDispose(handle);
|
|
53
59
|
}
|
|
60
|
+
$transferActiveChatSession(toWorkspace) {
|
|
61
|
+
const widget = this._chatWidgetService.lastFocusedWidget;
|
|
62
|
+
const sessionId = widget?.viewModel?.model.sessionId;
|
|
63
|
+
if (!sessionId) {
|
|
64
|
+
this._logService.error(`MainThreadChat#$transferActiveChatSession: No active chat session found`);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const inputValue = widget?.inputEditor.getValue() ?? '';
|
|
68
|
+
this._chatService.transferChatSession({ sessionId, inputValue }, URI.revive(toWorkspace));
|
|
69
|
+
}
|
|
54
70
|
$registerAgent(handle, extension, id, metadata, dynamicProps) {
|
|
55
71
|
const staticAgentRegistration = this._chatAgentService.getAgent(id);
|
|
56
72
|
if (!staticAgentRegistration && !dynamicProps) {
|
|
57
73
|
if (this._chatAgentService.getAgentsByName(id).length) {
|
|
58
|
-
throw new Error(
|
|
74
|
+
throw ( new Error(
|
|
75
|
+
`chatParticipant must be declared with an ID in package.json. The "id" property may be missing! "${id}"`
|
|
76
|
+
));
|
|
59
77
|
}
|
|
60
|
-
throw new Error(`chatParticipant must be declared in package.json: ${id}`);
|
|
78
|
+
throw ( new Error(`chatParticipant must be declared in package.json: ${id}`));
|
|
61
79
|
}
|
|
62
80
|
const impl = {
|
|
63
81
|
invoke: async (request, progress, history, token) => {
|
|
@@ -75,20 +93,24 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
|
75
93
|
}
|
|
76
94
|
return this._proxy.$provideFollowups(request, handle, result, { history }, token);
|
|
77
95
|
},
|
|
78
|
-
provideWelcomeMessage: (token) => {
|
|
79
|
-
return this._proxy.$provideWelcomeMessage(handle, token);
|
|
96
|
+
provideWelcomeMessage: (location, token) => {
|
|
97
|
+
return this._proxy.$provideWelcomeMessage(handle, location, token);
|
|
80
98
|
},
|
|
81
|
-
provideSampleQuestions: (token) => {
|
|
82
|
-
return this._proxy.$provideSampleQuestions(handle, token);
|
|
99
|
+
provideSampleQuestions: (location, token) => {
|
|
100
|
+
return this._proxy.$provideSampleQuestions(handle, location, token);
|
|
83
101
|
}
|
|
84
102
|
};
|
|
85
103
|
let disposable;
|
|
86
104
|
if (!staticAgentRegistration && dynamicProps) {
|
|
105
|
+
const extensionDescription = this._extensionService.extensions.find(e => ExtensionIdentifier.equals(e.identifier, extension));
|
|
87
106
|
disposable = this._chatAgentService.registerDynamicAgent({
|
|
88
107
|
id,
|
|
89
108
|
name: dynamicProps.name,
|
|
90
109
|
description: dynamicProps.description,
|
|
91
110
|
extensionId: extension,
|
|
111
|
+
extensionDisplayName: extensionDescription?.displayName ?? extension.value,
|
|
112
|
+
extensionPublisherId: extensionDescription?.publisher ?? '',
|
|
113
|
+
extensionPublisherDisplayName: extensionDescription?.publisherDisplayName,
|
|
92
114
|
metadata: revive(metadata),
|
|
93
115
|
slashCommands: [],
|
|
94
116
|
locations: [ChatAgentLocation.Panel]
|
|
@@ -107,7 +129,7 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
|
107
129
|
$updateAgent(handle, metadataUpdate) {
|
|
108
130
|
const data = this._agents.get(handle);
|
|
109
131
|
if (!data) {
|
|
110
|
-
throw new Error(`No agent with handle ${handle} registered`);
|
|
132
|
+
throw ( new Error(`No agent with handle ${handle} registered`));
|
|
111
133
|
}
|
|
112
134
|
data.hasFollowups = metadataUpdate.hasFollowups;
|
|
113
135
|
this._chatAgentService.updateAgent(data.id, revive(metadataUpdate));
|
|
@@ -157,7 +179,7 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
|
157
179
|
kind: 18 ,
|
|
158
180
|
detail: v.detail,
|
|
159
181
|
documentation: v.documentation,
|
|
160
|
-
command: { id: AddDynamicVariableAction.ID, title: '', arguments: [{ widget, range: rangeAfterInsert, variableData: revive(v.values) }] }
|
|
182
|
+
command: { id: AddDynamicVariableAction.ID, title: '', arguments: [{ widget, range: rangeAfterInsert, variableData: revive(v.values), command: v.command }] }
|
|
161
183
|
};
|
|
162
184
|
}));
|
|
163
185
|
return {
|
|
@@ -176,7 +198,9 @@ MainThreadChatAgents2 = __decorate([
|
|
|
176
198
|
( __param(2, IChatService)),
|
|
177
199
|
( __param(3, ILanguageFeaturesService)),
|
|
178
200
|
( __param(4, IChatWidgetService)),
|
|
179
|
-
( __param(5, IInstantiationService))
|
|
201
|
+
( __param(5, IInstantiationService)),
|
|
202
|
+
( __param(6, ILogService)),
|
|
203
|
+
( __param(7, IExtensionService))
|
|
180
204
|
], MainThreadChatAgents2);
|
|
181
205
|
function computeCompletionRanges(model, position, reg) {
|
|
182
206
|
const varWord = getWordAtText(position.column, reg, model.getLineContent(position.lineNumber), 0);
|
|
@@ -60,7 +60,7 @@ let MainThreadCommands = class MainThreadCommands {
|
|
|
60
60
|
}
|
|
61
61
|
if (retry && args.length > 0 && !CommandsRegistry.getCommand(id)) {
|
|
62
62
|
await this._extensionService.activateByEvent(`onCommand:${id}`);
|
|
63
|
-
throw new Error('$executeCommand:retry');
|
|
63
|
+
throw ( new Error('$executeCommand:retry'));
|
|
64
64
|
}
|
|
65
65
|
return this._commandService.executeCommand(id, ...args);
|
|
66
66
|
}
|
|
@@ -19,6 +19,7 @@ import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
|
19
19
|
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
20
20
|
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
21
21
|
|
|
22
|
+
const _moduleId = "vs/workbench/api/browser/mainThreadComments";
|
|
22
23
|
class MainThreadCommentThread {
|
|
23
24
|
get input() {
|
|
24
25
|
return this._input;
|
|
@@ -113,20 +114,20 @@ class MainThreadCommentThread {
|
|
|
113
114
|
this._range = _range;
|
|
114
115
|
this._canReply = _canReply;
|
|
115
116
|
this._isTemplate = _isTemplate;
|
|
116
|
-
this._onDidChangeInput = ( new Emitter());
|
|
117
|
-
this._onDidChangeLabel = ( new Emitter());
|
|
117
|
+
this._onDidChangeInput = ( (new Emitter()));
|
|
118
|
+
this._onDidChangeLabel = ( (new Emitter()));
|
|
118
119
|
this.onDidChangeLabel = this._onDidChangeLabel.event;
|
|
119
|
-
this._onDidChangeComments = ( new Emitter());
|
|
120
|
-
this._onDidChangeCanReply = ( new Emitter());
|
|
121
|
-
this._onDidChangeRange = ( new Emitter());
|
|
120
|
+
this._onDidChangeComments = ( (new Emitter()));
|
|
121
|
+
this._onDidChangeCanReply = ( (new Emitter()));
|
|
122
|
+
this._onDidChangeRange = ( (new Emitter()));
|
|
122
123
|
this.onDidChangeRange = this._onDidChangeRange.event;
|
|
123
|
-
this._onDidChangeCollapsibleState = ( new Emitter());
|
|
124
|
+
this._onDidChangeCollapsibleState = ( (new Emitter()));
|
|
124
125
|
this.onDidChangeCollapsibleState = this._onDidChangeCollapsibleState.event;
|
|
125
|
-
this._onDidChangeInitialCollapsibleState = ( new Emitter());
|
|
126
|
+
this._onDidChangeInitialCollapsibleState = ( (new Emitter()));
|
|
126
127
|
this.onDidChangeInitialCollapsibleState = this._onDidChangeInitialCollapsibleState.event;
|
|
127
|
-
this._onDidChangeApplicability = ( new Emitter());
|
|
128
|
+
this._onDidChangeApplicability = ( (new Emitter()));
|
|
128
129
|
this.onDidChangeApplicability = this._onDidChangeApplicability.event;
|
|
129
|
-
this._onDidChangeState = ( new Emitter());
|
|
130
|
+
this._onDidChangeState = ( (new Emitter()));
|
|
130
131
|
this.onDidChangeState = this._onDidChangeState.event;
|
|
131
132
|
this._isDisposed = false;
|
|
132
133
|
if (_isTemplate) {
|
|
@@ -219,7 +220,7 @@ class MainThreadCommentController {
|
|
|
219
220
|
this._id = _id;
|
|
220
221
|
this._label = _label;
|
|
221
222
|
this._features = _features;
|
|
222
|
-
this._threads = ( new Map());
|
|
223
|
+
this._threads = ( (new Map()));
|
|
223
224
|
}
|
|
224
225
|
async setActiveCommentAndThread(commentInfo) {
|
|
225
226
|
return this._proxy.$setActiveComment(this._handle, commentInfo ? { commentThreadHandle: commentInfo.thread.commentThreadHandle, uniqueIdInThread: commentInfo.comment?.uniqueIdInThread } : undefined);
|
|
@@ -228,7 +229,16 @@ class MainThreadCommentController {
|
|
|
228
229
|
this._features = features;
|
|
229
230
|
}
|
|
230
231
|
createCommentThread(extensionId, commentThreadHandle, threadId, resource, range, isTemplate) {
|
|
231
|
-
const thread = ( new MainThreadCommentThread(
|
|
232
|
+
const thread = ( (new MainThreadCommentThread(
|
|
233
|
+
commentThreadHandle,
|
|
234
|
+
this.handle,
|
|
235
|
+
extensionId,
|
|
236
|
+
threadId,
|
|
237
|
+
(URI.revive(resource).toString()),
|
|
238
|
+
range,
|
|
239
|
+
true,
|
|
240
|
+
isTemplate
|
|
241
|
+
)));
|
|
232
242
|
this._threads.set(commentThreadHandle, thread);
|
|
233
243
|
if (thread.isDocumentCommentThread()) {
|
|
234
244
|
this._commentService.updateComments(this._uniqueId, {
|
|
@@ -310,7 +320,7 @@ class MainThreadCommentController {
|
|
|
310
320
|
getKnownThread(commentThreadHandle) {
|
|
311
321
|
const thread = this._threads.get(commentThreadHandle);
|
|
312
322
|
if (!thread) {
|
|
313
|
-
throw new Error('unknown thread');
|
|
323
|
+
throw ( (new Error('unknown thread')));
|
|
314
324
|
}
|
|
315
325
|
return thread;
|
|
316
326
|
}
|
|
@@ -328,9 +338,9 @@ class MainThreadCommentController {
|
|
|
328
338
|
};
|
|
329
339
|
}
|
|
330
340
|
const ret = [];
|
|
331
|
-
for (const thread of [...( this._threads.keys())]) {
|
|
341
|
+
for (const thread of [...( (this._threads.keys()))]) {
|
|
332
342
|
const commentThread = this._threads.get(thread);
|
|
333
|
-
if (commentThread.resource === ( resource.toString())) {
|
|
343
|
+
if (commentThread.resource === ( (resource.toString()))) {
|
|
334
344
|
ret.push(commentThread);
|
|
335
345
|
}
|
|
336
346
|
}
|
|
@@ -355,9 +365,9 @@ class MainThreadCommentController {
|
|
|
355
365
|
};
|
|
356
366
|
}
|
|
357
367
|
const ret = [];
|
|
358
|
-
for (const thread of [...( this._threads.keys())]) {
|
|
368
|
+
for (const thread of [...( (this._threads.keys()))]) {
|
|
359
369
|
const commentThread = this._threads.get(thread);
|
|
360
|
-
if (commentThread.resource === ( resource.toString())) {
|
|
370
|
+
if (commentThread.resource === ( (resource.toString()))) {
|
|
361
371
|
ret.push(commentThread);
|
|
362
372
|
}
|
|
363
373
|
}
|
|
@@ -372,7 +382,7 @@ class MainThreadCommentController {
|
|
|
372
382
|
}
|
|
373
383
|
getAllComments() {
|
|
374
384
|
const ret = [];
|
|
375
|
-
for (const thread of [...( this._threads.keys())]) {
|
|
385
|
+
for (const thread of [...( (this._threads.keys()))]) {
|
|
376
386
|
ret.push(this._threads.get(thread));
|
|
377
387
|
}
|
|
378
388
|
return ret;
|
|
@@ -390,22 +400,18 @@ class MainThreadCommentController {
|
|
|
390
400
|
};
|
|
391
401
|
}
|
|
392
402
|
}
|
|
393
|
-
const commentsViewIcon = registerIcon('comments-view-icon', Codicon.commentDiscussion, ( localizeWithPath(
|
|
394
|
-
'vs/workbench/api/browser/mainThreadComments',
|
|
395
|
-
'commentsViewIcon',
|
|
396
|
-
'View icon of the comments view.'
|
|
397
|
-
)));
|
|
403
|
+
const commentsViewIcon = registerIcon('comments-view-icon', Codicon.commentDiscussion, ( localizeWithPath(_moduleId, 0, 'View icon of the comments view.')));
|
|
398
404
|
let MainThreadComments = class MainThreadComments extends Disposable {
|
|
399
405
|
constructor(extHostContext, _commentService, _viewsService, _viewDescriptorService) {
|
|
400
406
|
super();
|
|
401
407
|
this._commentService = _commentService;
|
|
402
408
|
this._viewsService = _viewsService;
|
|
403
409
|
this._viewDescriptorService = _viewDescriptorService;
|
|
404
|
-
this._handlers = ( new Map());
|
|
405
|
-
this._commentControllers = ( new Map());
|
|
406
|
-
this._activeEditingCommentThreadDisposables = this._register(( new DisposableStore()));
|
|
410
|
+
this._handlers = ( (new Map()));
|
|
411
|
+
this._commentControllers = ( (new Map()));
|
|
412
|
+
this._activeEditingCommentThreadDisposables = this._register(( (new DisposableStore())));
|
|
407
413
|
this._openViewListener = null;
|
|
408
|
-
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostComments));
|
|
414
|
+
this._proxy = ( (extHostContext.getProxy(ExtHostContext.ExtHostComments)));
|
|
409
415
|
this._commentService.unregisterCommentController();
|
|
410
416
|
this._register(this._commentService.onDidChangeActiveEditingCommentThread(async (thread) => {
|
|
411
417
|
const handle = thread.controllerHandle;
|
|
@@ -421,7 +427,7 @@ let MainThreadComments = class MainThreadComments extends Disposable {
|
|
|
421
427
|
$registerCommentController(handle, id, label, extensionId) {
|
|
422
428
|
const providerId = `${id}-${extensionId}`;
|
|
423
429
|
this._handlers.set(handle, providerId);
|
|
424
|
-
const provider = ( new MainThreadCommentController(this._proxy, this._commentService, handle, providerId, id, label, {}));
|
|
430
|
+
const provider = ( (new MainThreadCommentController(this._proxy, this._commentService, handle, providerId, id, label, {})));
|
|
425
431
|
this._commentService.registerCommentController(providerId, provider);
|
|
426
432
|
this._commentControllers.set(handle, provider);
|
|
427
433
|
const commentsPanelAlreadyConstructed = !!this._viewDescriptorService.getViewDescriptorById(COMMENTS_VIEW_ID);
|
|
@@ -479,23 +485,23 @@ let MainThreadComments = class MainThreadComments extends Disposable {
|
|
|
479
485
|
}
|
|
480
486
|
registerView(commentsViewAlreadyRegistered) {
|
|
481
487
|
if (!commentsViewAlreadyRegistered) {
|
|
482
|
-
const VIEW_CONTAINER = ( Registry.as(Extensions.ViewContainersRegistry)).registerViewContainer({
|
|
488
|
+
const VIEW_CONTAINER = ( (Registry.as(Extensions.ViewContainersRegistry))).registerViewContainer({
|
|
483
489
|
id: COMMENTS_VIEW_ID,
|
|
484
490
|
title: COMMENTS_VIEW_TITLE,
|
|
485
|
-
ctorDescriptor: ( new SyncDescriptor(
|
|
491
|
+
ctorDescriptor: ( (new SyncDescriptor(
|
|
486
492
|
ViewPaneContainer,
|
|
487
493
|
[COMMENTS_VIEW_ID, { mergeViewWithContainerWhenSingleView: true }]
|
|
488
|
-
)),
|
|
494
|
+
))),
|
|
489
495
|
storageId: COMMENTS_VIEW_STORAGE_ID,
|
|
490
496
|
hideIfEmpty: true,
|
|
491
497
|
icon: commentsViewIcon,
|
|
492
498
|
order: 10,
|
|
493
499
|
}, 1 );
|
|
494
|
-
( Registry.as(Extensions.ViewsRegistry)).registerViews([{
|
|
500
|
+
( (Registry.as(Extensions.ViewsRegistry))).registerViews([{
|
|
495
501
|
id: COMMENTS_VIEW_ID,
|
|
496
502
|
name: COMMENTS_VIEW_TITLE,
|
|
497
503
|
canToggleVisibility: false,
|
|
498
|
-
ctorDescriptor: ( new SyncDescriptor(CommentsPanel)),
|
|
504
|
+
ctorDescriptor: ( (new SyncDescriptor(CommentsPanel))),
|
|
499
505
|
canMoveView: true,
|
|
500
506
|
containerIcon: commentsViewIcon,
|
|
501
507
|
focusCommand: {
|
|
@@ -505,7 +511,7 @@ let MainThreadComments = class MainThreadComments extends Disposable {
|
|
|
505
511
|
}
|
|
506
512
|
}
|
|
507
513
|
setComments() {
|
|
508
|
-
[...( this._commentControllers.keys())].forEach(handle => {
|
|
514
|
+
[...( (this._commentControllers.keys()))].forEach(handle => {
|
|
509
515
|
const threads = this._commentControllers.get(handle).getAllComments();
|
|
510
516
|
if (threads.length) {
|
|
511
517
|
const providerId = this.getHandler(handle);
|
|
@@ -545,17 +551,17 @@ let MainThreadComments = class MainThreadComments extends Disposable {
|
|
|
545
551
|
}));
|
|
546
552
|
}
|
|
547
553
|
getHandler(handle) {
|
|
548
|
-
if (!( this._handlers.has(handle))) {
|
|
549
|
-
throw new Error('Unknown handler');
|
|
554
|
+
if (!( (this._handlers.has(handle)))) {
|
|
555
|
+
throw ( (new Error('Unknown handler')));
|
|
550
556
|
}
|
|
551
557
|
return this._handlers.get(handle);
|
|
552
558
|
}
|
|
553
559
|
};
|
|
554
560
|
MainThreadComments = __decorate([
|
|
555
561
|
extHostNamedCustomer(MainContext.MainThreadComments),
|
|
556
|
-
( __param(1, ICommentService)),
|
|
557
|
-
( __param(2, IViewsService)),
|
|
558
|
-
( __param(3, IViewDescriptorService))
|
|
562
|
+
( (__param(1, ICommentService))),
|
|
563
|
+
( (__param(2, IViewsService))),
|
|
564
|
+
( (__param(3, IViewDescriptorService)))
|
|
559
565
|
], MainThreadComments);
|
|
560
566
|
|
|
561
567
|
export { MainThreadCommentController, MainThreadCommentThread, MainThreadComments };
|