@codingame/monaco-vscode-extensions-service-override 5.2.0 → 6.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 +4 -4
- package/package.json +3 -3
- package/vscode/src/vs/base/common/console.js +2 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +6 -6
- package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.js +1 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +35 -21
- package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +2 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +72 -8
- package/vscode/src/vs/workbench/api/browser/mainThreadChatVariables.js +3 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +25 -16
- package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.js +11 -9
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +22 -14
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +18 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +3 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +12 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +14 -16
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +38 -38
- package/vscode/src/vs/workbench/api/browser/mainThreadEmbeddings.js +73 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +9 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +5 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +18 -15
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +28 -26
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +8 -16
- package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +4 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.js +2 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +3 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +42 -14
- package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +6 -17
- package/vscode/src/vs/workbench/api/browser/mainThreadSpeech.js +34 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.js +4 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadStorage.js +2 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +16 -16
- package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +4 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.js +5 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +8 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +6 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +4 -4
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +2 -1
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +2 -1
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +12 -10
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +27 -21
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +15 -11
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +2 -2
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +19 -16
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +7 -6
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +12 -12
- package/vscode/src/vs/workbench/services/extensions/common/extensionStorageMigration.js +3 -2
- package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +15 -2
- package/vscode/src/vs/workbench/services/extensions/common/lazyCreateExtensionHostManager.js +2 -2
- package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +10 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js +0 -72
package/extensions.js
CHANGED
|
@@ -45,6 +45,7 @@ import './vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js';
|
|
|
45
45
|
import './vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js';
|
|
46
46
|
import './vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js';
|
|
47
47
|
import './vscode/src/vs/workbench/api/browser/mainThreadChatVariables.js';
|
|
48
|
+
import './vscode/src/vs/workbench/api/browser/mainThreadEmbeddings.js';
|
|
48
49
|
import './vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js';
|
|
49
50
|
import './vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js';
|
|
50
51
|
import './vscode/src/vs/workbench/api/browser/mainThreadClipboard.js';
|
|
@@ -61,12 +62,12 @@ import './vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js';
|
|
|
61
62
|
import 'vscode/vscode/vs/base/common/event';
|
|
62
63
|
import 'vscode/vscode/vs/base/common/lifecycle';
|
|
63
64
|
import 'vscode/vscode/vs/editor/common/config/editorOptions';
|
|
65
|
+
import 'vscode/vscode/vs/editor/common/core/selection';
|
|
66
|
+
import 'vscode/vscode/vs/editor/common/editorCommon';
|
|
64
67
|
import 'vscode/vscode/vs/editor/contrib/snippet/browser/snippetController2';
|
|
65
68
|
import 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
66
69
|
import 'vscode/vscode/vs/base/common/arrays';
|
|
67
|
-
import 'vscode/vscode/vs/
|
|
68
|
-
import 'vscode/vscode/vs/base/common/cancellation';
|
|
69
|
-
import 'vscode/vscode/vs/editor/contrib/editorState/browser/keybindingCancellation';
|
|
70
|
+
import 'vscode/vscode/vs/editor/contrib/editorState/browser/editorState';
|
|
70
71
|
import 'vscode/vscode/vs/editor/contrib/snippet/browser/snippetParser';
|
|
71
72
|
import './vscode/src/vs/workbench/api/browser/mainThreadEditors.js';
|
|
72
73
|
import './vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js';
|
|
@@ -109,7 +110,6 @@ import './vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEdit
|
|
|
109
110
|
import './vscode/src/vs/workbench/api/browser/mainThreadNotebookRenderers.js';
|
|
110
111
|
import './vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js';
|
|
111
112
|
import './vscode/src/vs/workbench/api/browser/mainThreadInteractive.js';
|
|
112
|
-
import './vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js';
|
|
113
113
|
import './vscode/src/vs/workbench/api/browser/mainThreadTask.js';
|
|
114
114
|
import './vscode/src/vs/workbench/api/browser/mainThreadLabelService.js';
|
|
115
115
|
import './vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-extensions-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
30
|
-
"@codingame/monaco-vscode-files-service-override": "
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@6.0.0",
|
|
30
|
+
"@codingame/monaco-vscode-files-service-override": "6.0.0"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -6,10 +6,10 @@ import { basename } from 'vscode/vscode/vs/base/common/resources';
|
|
|
6
6
|
import { semverExports } from 'vscode/external/vscode-semver/semver.js';
|
|
7
7
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
8
8
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
9
|
-
import { EXTENSION_IDENTIFIER_REGEX } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement';
|
|
9
|
+
import { InstallOperation, EXTENSION_IDENTIFIER_REGEX } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement';
|
|
10
10
|
import { IExtensionManagementService, IExtensionGalleryService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement.service';
|
|
11
11
|
import { getIdAndVersion, areSameExtensions, getGalleryExtensionId, getExtensionId } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagementUtil';
|
|
12
|
-
import { EXTENSION_CATEGORIES } from 'vscode/vscode/vs/platform/extensions/common/extensions';
|
|
12
|
+
import { ExtensionType, EXTENSION_CATEGORIES } from 'vscode/vscode/vs/platform/extensions/common/extensions';
|
|
13
13
|
|
|
14
14
|
const _moduleId = "vs/platform/extensionManagement/common/extensionManagementCLI";
|
|
15
15
|
const notFound = (id) => ( localizeWithPath(_moduleId, 0, "Extension '{0}' not found.", id));
|
|
@@ -29,7 +29,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
29
29
|
return undefined;
|
|
30
30
|
}
|
|
31
31
|
async listExtensions(showVersions, category, profileLocation) {
|
|
32
|
-
let extensions = await this.extensionManagementService.getInstalled(
|
|
32
|
+
let extensions = await this.extensionManagementService.getInstalled(ExtensionType.User, profileLocation);
|
|
33
33
|
const categories = ( (EXTENSION_CATEGORIES.map(c => c.toLowerCase())));
|
|
34
34
|
if (category && category !== '') {
|
|
35
35
|
if (categories.indexOf(category.toLowerCase()) < 0) {
|
|
@@ -125,7 +125,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
async updateExtensions(profileLocation) {
|
|
128
|
-
const installedExtensions = await this.extensionManagementService.getInstalled(
|
|
128
|
+
const installedExtensions = await this.extensionManagementService.getInstalled(ExtensionType.User, profileLocation);
|
|
129
129
|
const installedExtensionsQuery = [];
|
|
130
130
|
for (const extension of installedExtensions) {
|
|
131
131
|
if (!!extension.identifier.uuid) {
|
|
@@ -145,7 +145,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
145
145
|
if (areSameExtensions(oldVersion.identifier, newVersion.identifier) && semverExports.gt(newVersion.version, oldVersion.manifest.version)) {
|
|
146
146
|
extensionsToUpdate.push({
|
|
147
147
|
extension: newVersion,
|
|
148
|
-
options: { operation:
|
|
148
|
+
options: { operation: InstallOperation.Update, installPreReleaseVersion: oldVersion.preRelease, profileLocation }
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
}
|
|
@@ -364,7 +364,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
364
364
|
if (!extensionsToUninstall.length) {
|
|
365
365
|
throw ( (new Error(`${this.notInstalled(id)}\n${useId}`)));
|
|
366
366
|
}
|
|
367
|
-
if (( (extensionsToUninstall.some(e => e.type ===
|
|
367
|
+
if (( (extensionsToUninstall.some(e => e.type === ExtensionType.System)))) {
|
|
368
368
|
this.logger.info(( localizeWithPath(
|
|
369
369
|
_moduleId,
|
|
370
370
|
24,
|
package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
+
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
2
3
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
3
4
|
import { FileAccess, Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
4
5
|
import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService.service';
|
|
@@ -2,11 +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 { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
4
4
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
5
|
+
import { INTERNAL_AUTH_PROVIDER_PREFIX } from 'vscode/vscode/vs/workbench/services/authentication/common/authentication';
|
|
5
6
|
import { IAuthenticationService, IAuthenticationExtensionsService } from 'vscode/vscode/vs/workbench/services/authentication/common/authentication.service';
|
|
6
7
|
import { ExtHostContext, MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
7
8
|
import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
8
9
|
import Severity$1 from 'vscode/vscode/vs/base/common/severity';
|
|
9
10
|
import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification.service';
|
|
11
|
+
import { ActivationKind } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
|
|
10
12
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
11
13
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
12
14
|
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
@@ -75,7 +77,7 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
75
77
|
}
|
|
76
78
|
async $ensureProvider(id) {
|
|
77
79
|
if (!this.authenticationService.isAuthenticationProviderRegistered(id)) {
|
|
78
|
-
return await this.extensionService.activateByEvent(getAuthenticationProviderActivationEvent(id),
|
|
80
|
+
return await this.extensionService.activateByEvent(getAuthenticationProviderActivationEvent(id), ActivationKind.Immediate);
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
83
|
$sendDidChangeSessions(providerId, event) {
|
|
@@ -87,25 +89,37 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
87
89
|
$removeSession(providerId, sessionId) {
|
|
88
90
|
return this.authenticationService.removeSession(providerId, sessionId);
|
|
89
91
|
}
|
|
90
|
-
async loginPrompt(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
92
|
+
async loginPrompt(provider, extensionName, recreatingSession, options) {
|
|
93
|
+
let message;
|
|
94
|
+
if (provider.id.startsWith(INTERNAL_AUTH_PROVIDER_PREFIX)) {
|
|
95
|
+
message = ( localizeWithPath(
|
|
96
|
+
_moduleId,
|
|
97
|
+
1,
|
|
98
|
+
"The extension '{0}' wants to access the language models provided by {1}.",
|
|
99
|
+
extensionName,
|
|
100
|
+
provider.label
|
|
101
|
+
));
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
message = recreatingSession
|
|
105
|
+
? ( localizeWithPath(
|
|
106
|
+
_moduleId,
|
|
107
|
+
2,
|
|
108
|
+
"The extension '{0}' wants you to sign in again using {1}.",
|
|
109
|
+
extensionName,
|
|
110
|
+
provider.label
|
|
111
|
+
))
|
|
112
|
+
: ( localizeWithPath(
|
|
113
|
+
_moduleId,
|
|
114
|
+
3,
|
|
115
|
+
"The extension '{0}' wants to sign in using {1}.",
|
|
116
|
+
extensionName,
|
|
117
|
+
provider.label
|
|
118
|
+
));
|
|
119
|
+
}
|
|
106
120
|
const buttons = [
|
|
107
121
|
{
|
|
108
|
-
label: ( localizeWithPath(_moduleId,
|
|
122
|
+
label: ( localizeWithPath(_moduleId, 4, "&&Allow")),
|
|
109
123
|
run() {
|
|
110
124
|
return true;
|
|
111
125
|
},
|
|
@@ -113,9 +127,9 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
113
127
|
];
|
|
114
128
|
if (options?.learnMore) {
|
|
115
129
|
buttons.push({
|
|
116
|
-
label: ( localizeWithPath(_moduleId,
|
|
130
|
+
label: ( localizeWithPath(_moduleId, 5, "Learn more")),
|
|
117
131
|
run: async () => {
|
|
118
|
-
const result = this.loginPrompt(
|
|
132
|
+
const result = this.loginPrompt(provider, extensionName, recreatingSession, options);
|
|
119
133
|
await this.openerService.open(URI.revive(options.learnMore), { allowCommands: true });
|
|
120
134
|
return await result;
|
|
121
135
|
}
|
|
@@ -173,7 +187,7 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
173
187
|
uiOptions = options.forceNewSession;
|
|
174
188
|
}
|
|
175
189
|
const recreatingSession = !!(options.forceNewSession && sessions.length);
|
|
176
|
-
const isAllowed = await this.loginPrompt(provider
|
|
190
|
+
const isAllowed = await this.loginPrompt(provider, extensionName, recreatingSession, uiOptions);
|
|
177
191
|
if (!isAllowed) {
|
|
178
192
|
throw ( (new Error('User did not consent to login.')));
|
|
179
193
|
}
|
|
@@ -6,6 +6,7 @@ import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
|
6
6
|
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
7
7
|
import { MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
8
8
|
import { ResourceNotebookCellEdit } from 'vscode/vscode/vs/workbench/contrib/bulkEdit/browser/bulkCellEdits';
|
|
9
|
+
import { CellEditType } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
9
10
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
10
11
|
|
|
11
12
|
let MainThreadBulkEdits = class MainThreadBulkEdits {
|
|
@@ -61,7 +62,7 @@ function reviveWorkspaceEditDto(data, uriIdentityService, resolveDataTransferFil
|
|
|
61
62
|
if (ResourceNotebookCellEdit.is(edit)) {
|
|
62
63
|
edit.resource = uriIdentityService.asCanonicalUri(edit.resource);
|
|
63
64
|
const cellEdit = edit.cellEdit;
|
|
64
|
-
if (cellEdit.editType ===
|
|
65
|
+
if (cellEdit.editType === CellEditType.Replace) {
|
|
65
66
|
edit.cellEdit = {
|
|
66
67
|
...cellEdit,
|
|
67
68
|
cells: ( cellEdit.cells.map(cell => ({
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
+
import { DeferredPromise } from 'vscode/vscode/vs/base/common/async';
|
|
3
|
+
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
2
4
|
import { Disposable, DisposableMap } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
5
|
import { revive } from 'vscode/vscode/vs/base/common/marshalling';
|
|
4
6
|
import { escapeRegExpCharacters } from 'vscode/vscode/vs/base/common/strings';
|
|
7
|
+
import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
5
8
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
6
9
|
import { Range } from 'vscode/vscode/vs/editor/common/core/range';
|
|
7
10
|
import { getWordAtText } from 'vscode/vscode/vs/editor/common/core/wordHelper';
|
|
11
|
+
import { CompletionItemKind } from 'vscode/vscode/vs/editor/common/languages';
|
|
8
12
|
import { ILanguageFeaturesService } from 'vscode/vscode/vs/editor/common/services/languageFeatures';
|
|
9
13
|
import { ExtensionIdentifier } from 'vscode/vscode/vs/platform/extensions/common/extensions';
|
|
10
14
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
@@ -21,6 +25,29 @@ import { IChatService } from 'vscode/vscode/vs/workbench/contrib/chat/common/cha
|
|
|
21
25
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
22
26
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
23
27
|
|
|
28
|
+
class MainThreadChatTask {
|
|
29
|
+
get onDidAddProgress() { return this._onDidAddProgress.event; }
|
|
30
|
+
constructor(content) {
|
|
31
|
+
this.content = content;
|
|
32
|
+
this.kind = 'progressTask';
|
|
33
|
+
this.deferred = ( new DeferredPromise());
|
|
34
|
+
this._onDidAddProgress = ( new Emitter());
|
|
35
|
+
this.progress = [];
|
|
36
|
+
}
|
|
37
|
+
task() {
|
|
38
|
+
return this.deferred.p;
|
|
39
|
+
}
|
|
40
|
+
isSettled() {
|
|
41
|
+
return this.deferred.isSettled;
|
|
42
|
+
}
|
|
43
|
+
complete(v) {
|
|
44
|
+
this.deferred.complete(v);
|
|
45
|
+
}
|
|
46
|
+
add(progress) {
|
|
47
|
+
this.progress.push(progress);
|
|
48
|
+
this._onDidAddProgress.fire(progress);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
24
51
|
let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
25
52
|
constructor(extHostContext, _chatAgentService, _chatService, _languageFeaturesService, _chatWidgetService, _instantiationService, _logService, _extensionService) {
|
|
26
53
|
super();
|
|
@@ -33,7 +60,10 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
|
33
60
|
this._extensionService = _extensionService;
|
|
34
61
|
this._agents = this._register(( new DisposableMap()));
|
|
35
62
|
this._agentCompletionProviders = this._register(( new DisposableMap()));
|
|
63
|
+
this._agentIdsToCompletionProviders = this._register(( new DisposableMap()));
|
|
36
64
|
this._pendingProgress = ( new Map());
|
|
65
|
+
this._responsePartHandlePool = 0;
|
|
66
|
+
this._activeTasks = ( new Map());
|
|
37
67
|
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostChatAgents2));
|
|
38
68
|
this._register(this._chatService.onDidDisposeSession(e => {
|
|
39
69
|
this._proxy.$releaseSession(e.sessionId);
|
|
@@ -105,12 +135,13 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
|
105
135
|
const extensionDescription = this._extensionService.extensions.find(e => ExtensionIdentifier.equals(e.identifier, extension));
|
|
106
136
|
disposable = this._chatAgentService.registerDynamicAgent({
|
|
107
137
|
id,
|
|
108
|
-
name: dynamicProps.name,
|
|
138
|
+
name: dynamicProps.name ?? '',
|
|
109
139
|
description: dynamicProps.description,
|
|
110
140
|
extensionId: extension,
|
|
111
141
|
extensionDisplayName: extensionDescription?.displayName ?? extension.value,
|
|
112
142
|
extensionPublisherId: extensionDescription?.publisher ?? '',
|
|
113
|
-
|
|
143
|
+
publisherDisplayName: dynamicProps.publisherName,
|
|
144
|
+
fullName: dynamicProps.fullName,
|
|
114
145
|
metadata: revive(metadata),
|
|
115
146
|
slashCommands: [],
|
|
116
147
|
locations: [ChatAgentLocation.Panel]
|
|
@@ -134,11 +165,43 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
|
134
165
|
data.hasFollowups = metadataUpdate.hasFollowups;
|
|
135
166
|
this._chatAgentService.updateAgent(data.id, revive(metadataUpdate));
|
|
136
167
|
}
|
|
137
|
-
async $handleProgressChunk(requestId, progress) {
|
|
168
|
+
async $handleProgressChunk(requestId, progress, responsePartHandle) {
|
|
138
169
|
const revivedProgress = revive(progress);
|
|
170
|
+
if (revivedProgress.kind === 'progressTask') {
|
|
171
|
+
const handle = ++this._responsePartHandlePool;
|
|
172
|
+
const responsePartId = `${requestId}_${handle}`;
|
|
173
|
+
const task = ( new MainThreadChatTask(revivedProgress.content));
|
|
174
|
+
this._activeTasks.set(responsePartId, task);
|
|
175
|
+
this._pendingProgress.get(requestId)?.(task);
|
|
176
|
+
return handle;
|
|
177
|
+
}
|
|
178
|
+
else if (responsePartHandle !== undefined) {
|
|
179
|
+
const responsePartId = `${requestId}_${responsePartHandle}`;
|
|
180
|
+
const task = this._activeTasks.get(responsePartId);
|
|
181
|
+
switch (revivedProgress.kind) {
|
|
182
|
+
case 'progressTaskResult':
|
|
183
|
+
if (task && revivedProgress.content) {
|
|
184
|
+
task.complete(revivedProgress.content.value);
|
|
185
|
+
this._activeTasks.delete(responsePartId);
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
task?.complete(undefined);
|
|
189
|
+
}
|
|
190
|
+
return responsePartHandle;
|
|
191
|
+
case 'warning':
|
|
192
|
+
case 'reference':
|
|
193
|
+
task?.add(revivedProgress);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
139
197
|
this._pendingProgress.get(requestId)?.(revivedProgress);
|
|
140
198
|
}
|
|
141
|
-
$registerAgentCompletionsProvider(handle, triggerCharacters) {
|
|
199
|
+
$registerAgentCompletionsProvider(handle, id, triggerCharacters) {
|
|
200
|
+
const provide = async (query, token) => {
|
|
201
|
+
const completions = await this._proxy.$invokeCompletionProvider(handle, query, token);
|
|
202
|
+
return ( completions.map((c) => ({ ...c, icon: c.icon ? ThemeIcon.fromId(c.icon) : undefined })));
|
|
203
|
+
};
|
|
204
|
+
this._agentIdsToCompletionProviders.set(id, this._chatAgentService.registerAgentCompletionProvider(id, provide));
|
|
142
205
|
this._agentCompletionProviders.set(handle, this._languageFeaturesService.completionProvider.register({ scheme: ChatInputPart.INPUT_SCHEME, hasAccessToAllModels: true }, {
|
|
143
206
|
_debugDisplayName: 'chatAgentCompletions:' + handle,
|
|
144
207
|
triggerCharacters,
|
|
@@ -163,7 +226,7 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
|
163
226
|
if (!range) {
|
|
164
227
|
return null;
|
|
165
228
|
}
|
|
166
|
-
const result = await
|
|
229
|
+
const result = await provide(query, token);
|
|
167
230
|
const variableItems = ( result.map(v => {
|
|
168
231
|
const insertText = v.insertText ?? (typeof v.label === 'string' ? v.label : v.label.label);
|
|
169
232
|
const rangeAfterInsert = ( new Range(
|
|
@@ -176,10 +239,10 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
|
176
239
|
label: v.label,
|
|
177
240
|
range,
|
|
178
241
|
insertText: insertText + ' ',
|
|
179
|
-
kind:
|
|
242
|
+
kind: CompletionItemKind.Text,
|
|
180
243
|
detail: v.detail,
|
|
181
244
|
documentation: v.documentation,
|
|
182
|
-
command: { id: AddDynamicVariableAction.ID, title: '', arguments: [{ widget, range: rangeAfterInsert, variableData: revive(v.
|
|
245
|
+
command: { id: AddDynamicVariableAction.ID, title: '', arguments: [{ id: v.id, widget, range: rangeAfterInsert, variableData: revive(v.value), command: v.command }] }
|
|
183
246
|
};
|
|
184
247
|
}));
|
|
185
248
|
return {
|
|
@@ -188,8 +251,9 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
|
188
251
|
}
|
|
189
252
|
}));
|
|
190
253
|
}
|
|
191
|
-
$unregisterAgentCompletionsProvider(handle) {
|
|
254
|
+
$unregisterAgentCompletionsProvider(handle, id) {
|
|
192
255
|
this._agentCompletionProviders.deleteAndDispose(handle);
|
|
256
|
+
this._agentIdsToCompletionProviders.deleteAndDispose(id);
|
|
193
257
|
}
|
|
194
258
|
};
|
|
195
259
|
MainThreadChatAgents2 = __decorate([
|
|
@@ -32,6 +32,9 @@ let MainThreadChatVariables = class MainThreadChatVariables {
|
|
|
32
32
|
$unregisterVariable(handle) {
|
|
33
33
|
this._variables.deleteAndDispose(handle);
|
|
34
34
|
}
|
|
35
|
+
$attachContext(name, value, location) {
|
|
36
|
+
this._chatVariablesService.attachContext(name, revive(value), location);
|
|
37
|
+
}
|
|
35
38
|
};
|
|
36
39
|
MainThreadChatVariables = __decorate([
|
|
37
40
|
extHostNamedCustomer(MainContext.MainThreadChatVariables),
|
|
@@ -9,13 +9,14 @@ import { ICommentService } from 'vscode/vscode/vs/workbench/contrib/comments/bro
|
|
|
9
9
|
import { CommentsPanel } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentsView';
|
|
10
10
|
import { ExtHostContext, MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
11
11
|
import { COMMENTS_VIEW_ID, COMMENTS_VIEW_TITLE, COMMENTS_VIEW_STORAGE_ID } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentsTreeViewer';
|
|
12
|
-
import { Extensions } from 'vscode/vscode/vs/workbench/common/views';
|
|
12
|
+
import { Extensions, ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
|
|
13
13
|
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views.service';
|
|
14
14
|
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
15
15
|
import { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
|
|
16
16
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
17
17
|
import { registerIcon } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
|
|
18
18
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
19
|
+
import { MarshalledId } from 'vscode/vscode/vs/base/common/marshallingIds';
|
|
19
20
|
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
20
21
|
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
21
22
|
|
|
@@ -69,8 +70,10 @@ class MainThreadCommentThread {
|
|
|
69
70
|
return this._collapsibleState;
|
|
70
71
|
}
|
|
71
72
|
set collapsibleState(newState) {
|
|
72
|
-
this._collapsibleState
|
|
73
|
-
|
|
73
|
+
if (newState !== this._collapsibleState) {
|
|
74
|
+
this._collapsibleState = newState;
|
|
75
|
+
this._onDidChangeCollapsibleState.fire(this._collapsibleState);
|
|
76
|
+
}
|
|
74
77
|
}
|
|
75
78
|
get initialCollapsibleState() {
|
|
76
79
|
return this._initialCollapsibleState;
|
|
@@ -105,7 +108,7 @@ class MainThreadCommentThread {
|
|
|
105
108
|
get isTemplate() {
|
|
106
109
|
return this._isTemplate;
|
|
107
110
|
}
|
|
108
|
-
constructor(commentThreadHandle, controllerHandle, extensionId, threadId, resource, _range, _canReply, _isTemplate) {
|
|
111
|
+
constructor(commentThreadHandle, controllerHandle, extensionId, threadId, resource, _range, _canReply, _isTemplate, editorId) {
|
|
109
112
|
this.commentThreadHandle = commentThreadHandle;
|
|
110
113
|
this.controllerHandle = controllerHandle;
|
|
111
114
|
this.extensionId = extensionId;
|
|
@@ -114,6 +117,7 @@ class MainThreadCommentThread {
|
|
|
114
117
|
this._range = _range;
|
|
115
118
|
this._canReply = _canReply;
|
|
116
119
|
this._isTemplate = _isTemplate;
|
|
120
|
+
this.editorId = editorId;
|
|
117
121
|
this._onDidChangeInput = ( (new Emitter()));
|
|
118
122
|
this._onDidChangeLabel = ( (new Emitter()));
|
|
119
123
|
this.onDidChangeLabel = this._onDidChangeLabel.event;
|
|
@@ -175,7 +179,7 @@ class MainThreadCommentThread {
|
|
|
175
179
|
}
|
|
176
180
|
toJSON() {
|
|
177
181
|
return {
|
|
178
|
-
$mid:
|
|
182
|
+
$mid: MarshalledId.CommentThread,
|
|
179
183
|
commentControlHandle: this.controllerHandle,
|
|
180
184
|
commentThreadHandle: this.commentThreadHandle,
|
|
181
185
|
};
|
|
@@ -228,7 +232,7 @@ class MainThreadCommentController {
|
|
|
228
232
|
updateFeatures(features) {
|
|
229
233
|
this._features = features;
|
|
230
234
|
}
|
|
231
|
-
createCommentThread(extensionId, commentThreadHandle, threadId, resource, range, isTemplate) {
|
|
235
|
+
createCommentThread(extensionId, commentThreadHandle, threadId, resource, range, isTemplate, editorId) {
|
|
232
236
|
const thread = ( (new MainThreadCommentThread(
|
|
233
237
|
commentThreadHandle,
|
|
234
238
|
this.handle,
|
|
@@ -237,7 +241,8 @@ class MainThreadCommentController {
|
|
|
237
241
|
(URI.revive(resource).toString()),
|
|
238
242
|
range,
|
|
239
243
|
true,
|
|
240
|
-
isTemplate
|
|
244
|
+
isTemplate,
|
|
245
|
+
editorId
|
|
241
246
|
)));
|
|
242
247
|
this._threads.set(commentThreadHandle, thread);
|
|
243
248
|
if (thread.isDocumentCommentThread()) {
|
|
@@ -341,7 +346,9 @@ class MainThreadCommentController {
|
|
|
341
346
|
for (const thread of [...( (this._threads.keys()))]) {
|
|
342
347
|
const commentThread = this._threads.get(thread);
|
|
343
348
|
if (commentThread.resource === ( (resource.toString()))) {
|
|
344
|
-
|
|
349
|
+
if (commentThread.isDocumentCommentThread()) {
|
|
350
|
+
ret.push(commentThread);
|
|
351
|
+
}
|
|
345
352
|
}
|
|
346
353
|
}
|
|
347
354
|
const commentingRanges = await this._proxy.$provideCommentingRanges(this.handle, resource, token);
|
|
@@ -352,7 +359,7 @@ class MainThreadCommentController {
|
|
|
352
359
|
commentingRanges: {
|
|
353
360
|
resource: resource,
|
|
354
361
|
ranges: commentingRanges?.ranges || [],
|
|
355
|
-
fileComments: commentingRanges?.fileComments
|
|
362
|
+
fileComments: !!commentingRanges?.fileComments
|
|
356
363
|
}
|
|
357
364
|
};
|
|
358
365
|
}
|
|
@@ -368,7 +375,9 @@ class MainThreadCommentController {
|
|
|
368
375
|
for (const thread of [...( (this._threads.keys()))]) {
|
|
369
376
|
const commentThread = this._threads.get(thread);
|
|
370
377
|
if (commentThread.resource === ( (resource.toString()))) {
|
|
371
|
-
|
|
378
|
+
if (!commentThread.isDocumentCommentThread()) {
|
|
379
|
+
ret.push(commentThread);
|
|
380
|
+
}
|
|
372
381
|
}
|
|
373
382
|
}
|
|
374
383
|
return {
|
|
@@ -387,15 +396,15 @@ class MainThreadCommentController {
|
|
|
387
396
|
}
|
|
388
397
|
return ret;
|
|
389
398
|
}
|
|
390
|
-
createCommentThreadTemplate(resource, range) {
|
|
391
|
-
return this._proxy.$createCommentThreadTemplate(this.handle, resource, range);
|
|
399
|
+
createCommentThreadTemplate(resource, range, editorId) {
|
|
400
|
+
return this._proxy.$createCommentThreadTemplate(this.handle, resource, range, editorId);
|
|
392
401
|
}
|
|
393
402
|
async updateCommentThreadTemplate(threadHandle, range) {
|
|
394
403
|
await this._proxy.$updateCommentThreadTemplate(this.handle, threadHandle, range);
|
|
395
404
|
}
|
|
396
405
|
toJSON() {
|
|
397
406
|
return {
|
|
398
|
-
$mid:
|
|
407
|
+
$mid: MarshalledId.CommentController,
|
|
399
408
|
handle: this.handle
|
|
400
409
|
};
|
|
401
410
|
}
|
|
@@ -455,12 +464,12 @@ let MainThreadComments = class MainThreadComments extends Disposable {
|
|
|
455
464
|
}
|
|
456
465
|
provider.updateFeatures(features);
|
|
457
466
|
}
|
|
458
|
-
$createCommentThread(handle, commentThreadHandle, threadId, resource, range, extensionId, isTemplate) {
|
|
467
|
+
$createCommentThread(handle, commentThreadHandle, threadId, resource, range, extensionId, isTemplate, editorId) {
|
|
459
468
|
const provider = this._commentControllers.get(handle);
|
|
460
469
|
if (!provider) {
|
|
461
470
|
return undefined;
|
|
462
471
|
}
|
|
463
|
-
return provider.createCommentThread(extensionId.value, commentThreadHandle, threadId, resource, range, isTemplate);
|
|
472
|
+
return provider.createCommentThread(extensionId.value, commentThreadHandle, threadId, resource, range, isTemplate, editorId);
|
|
464
473
|
}
|
|
465
474
|
$updateCommentThread(handle, commentThreadHandle, threadId, resource, changes) {
|
|
466
475
|
const provider = this._commentControllers.get(handle);
|
|
@@ -496,7 +505,7 @@ let MainThreadComments = class MainThreadComments extends Disposable {
|
|
|
496
505
|
hideIfEmpty: true,
|
|
497
506
|
icon: commentsViewIcon,
|
|
498
507
|
order: 10,
|
|
499
|
-
},
|
|
508
|
+
}, ViewContainerLocation.Panel);
|
|
500
509
|
( (Registry.as(Extensions.ViewsRegistry))).registerViews([{
|
|
501
510
|
id: COMMENTS_VIEW_ID,
|
|
502
511
|
name: COMMENTS_VIEW_TITLE,
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
3
3
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
4
|
-
import { getScopes, Extensions } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
4
|
+
import { getScopes, Extensions, ConfigurationScope } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
5
|
+
import { WorkbenchState } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
5
6
|
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
|
|
6
7
|
import { ExtHostContext, MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
7
8
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
9
|
+
import { ConfigurationTarget } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
8
10
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
9
11
|
import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/common/environment.service';
|
|
10
12
|
|
|
@@ -41,13 +43,13 @@ let MainThreadConfiguration = class MainThreadConfiguration {
|
|
|
41
43
|
target = target !== null && target !== undefined ? target : this.deriveConfigurationTarget(key, overrides);
|
|
42
44
|
const configurationValue = this.configurationService.inspect(key, overrides);
|
|
43
45
|
switch (target) {
|
|
44
|
-
case
|
|
46
|
+
case ConfigurationTarget.MEMORY:
|
|
45
47
|
return this._updateValue(key, value, target, configurationValue?.memory?.override, overrides, scopeToLanguage);
|
|
46
|
-
case
|
|
48
|
+
case ConfigurationTarget.WORKSPACE_FOLDER:
|
|
47
49
|
return this._updateValue(key, value, target, configurationValue?.workspaceFolder?.override, overrides, scopeToLanguage);
|
|
48
|
-
case
|
|
50
|
+
case ConfigurationTarget.WORKSPACE:
|
|
49
51
|
return this._updateValue(key, value, target, configurationValue?.workspace?.override, overrides, scopeToLanguage);
|
|
50
|
-
case
|
|
52
|
+
case ConfigurationTarget.USER_REMOTE:
|
|
51
53
|
return this._updateValue(key, value, target, configurationValue?.userRemote?.override, overrides, scopeToLanguage);
|
|
52
54
|
default:
|
|
53
55
|
return this._updateValue(key, value, target, configurationValue?.userLocal?.override, overrides, scopeToLanguage);
|
|
@@ -61,13 +63,13 @@ let MainThreadConfiguration = class MainThreadConfiguration {
|
|
|
61
63
|
return this.configurationService.updateValue(key, value, overrides, configurationTarget, { donotNotifyError: true });
|
|
62
64
|
}
|
|
63
65
|
deriveConfigurationTarget(key, overrides) {
|
|
64
|
-
if (overrides.resource && this._workspaceContextService.getWorkbenchState() ===
|
|
66
|
+
if (overrides.resource && this._workspaceContextService.getWorkbenchState() === WorkbenchState.WORKSPACE) {
|
|
65
67
|
const configurationProperties = ( Registry.as(Extensions.Configuration)).getConfigurationProperties();
|
|
66
|
-
if (configurationProperties[key] && (
|
|
67
|
-
return
|
|
68
|
+
if (configurationProperties[key] && (configurationProperties[key].scope === ConfigurationScope.RESOURCE || configurationProperties[key].scope === ConfigurationScope.LANGUAGE_OVERRIDABLE)) {
|
|
69
|
+
return ConfigurationTarget.WORKSPACE_FOLDER;
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
|
-
return
|
|
72
|
+
return ConfigurationTarget.WORKSPACE;
|
|
71
73
|
}
|
|
72
74
|
};
|
|
73
75
|
MainThreadConfiguration = __decorate([
|