@codingame/monaco-vscode-extensions-service-override 4.5.2 → 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/platform/extensionManagement/common/extensionManagementCLI.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +19 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +29 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +44 -20
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +26 -9
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +15 -16
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +6 -3
- 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/services/extensions/common/abstractExtensionService.js +3 -2
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/lazyCreateExtensionHostManager.js +1 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +0 -70
- package/vscode/src/vs/workbench/api/browser/mainThreadIssueReporter.js +0 -50
package/extensions.js
CHANGED
|
@@ -110,7 +110,6 @@ import './vscode/src/vs/workbench/api/browser/mainThreadNotebookRenderers.js';
|
|
|
110
110
|
import './vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js';
|
|
111
111
|
import './vscode/src/vs/workbench/api/browser/mainThreadInteractive.js';
|
|
112
112
|
import './vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js';
|
|
113
|
-
import './vscode/src/vs/workbench/api/browser/mainThreadChat.js';
|
|
114
113
|
import './vscode/src/vs/workbench/api/browser/mainThreadTask.js';
|
|
115
114
|
import './vscode/src/vs/workbench/api/browser/mainThreadLabelService.js';
|
|
116
115
|
import './vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js';
|
|
@@ -122,7 +121,6 @@ import './vscode/src/vs/workbench/api/browser/mainThreadShare.js';
|
|
|
122
121
|
import './vscode/src/vs/workbench/api/browser/mainThreadProfileContentHandlers.js';
|
|
123
122
|
import './vscode/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.js';
|
|
124
123
|
import './vscode/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.js';
|
|
125
|
-
import './vscode/src/vs/workbench/api/browser/mainThreadIssueReporter.js';
|
|
126
124
|
|
|
127
125
|
let EsmWebWorkerExtensionHost = class EsmWebWorkerExtensionHost extends WebWorkerExtensionHost {
|
|
128
126
|
constructor(workerConfig, runningLocation, startup, _initDataProvider, _telemetryService, _contextService, _labelService, _logService, _loggerService, _environmentService, _userDataProfilesService, _productService, _layoutService, _storageService) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-extensions-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.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@5.0.0",
|
|
30
|
+
"@codingame/monaco-vscode-files-service-override": "5.0.0"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -92,7 +92,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
92
92
|
addInstallExtensionInfo(id, version, true);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
const installed = await this.extensionManagementService.getInstalled(
|
|
95
|
+
const installed = await this.extensionManagementService.getInstalled(undefined, installOptions.profileLocation);
|
|
96
96
|
if (installVSIXInfos.length) {
|
|
97
97
|
await Promise.all(( (installVSIXInfos.map(async ({ vsix, installOptions }) => {
|
|
98
98
|
try {
|
|
@@ -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: 3 , installPreReleaseVersion: oldVersion.
|
|
148
|
+
options: { operation: 3 , installPreReleaseVersion: oldVersion.preRelease, profileLocation }
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
}
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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,6 +57,16 @@ 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) {
|
|
@@ -77,20 +93,24 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
|
77
93
|
}
|
|
78
94
|
return this._proxy.$provideFollowups(request, handle, result, { history }, token);
|
|
79
95
|
},
|
|
80
|
-
provideWelcomeMessage: (token) => {
|
|
81
|
-
return this._proxy.$provideWelcomeMessage(handle, token);
|
|
96
|
+
provideWelcomeMessage: (location, token) => {
|
|
97
|
+
return this._proxy.$provideWelcomeMessage(handle, location, token);
|
|
82
98
|
},
|
|
83
|
-
provideSampleQuestions: (token) => {
|
|
84
|
-
return this._proxy.$provideSampleQuestions(handle, token);
|
|
99
|
+
provideSampleQuestions: (location, token) => {
|
|
100
|
+
return this._proxy.$provideSampleQuestions(handle, location, token);
|
|
85
101
|
}
|
|
86
102
|
};
|
|
87
103
|
let disposable;
|
|
88
104
|
if (!staticAgentRegistration && dynamicProps) {
|
|
105
|
+
const extensionDescription = this._extensionService.extensions.find(e => ExtensionIdentifier.equals(e.identifier, extension));
|
|
89
106
|
disposable = this._chatAgentService.registerDynamicAgent({
|
|
90
107
|
id,
|
|
91
108
|
name: dynamicProps.name,
|
|
92
109
|
description: dynamicProps.description,
|
|
93
110
|
extensionId: extension,
|
|
111
|
+
extensionDisplayName: extensionDescription?.displayName ?? extension.value,
|
|
112
|
+
extensionPublisherId: extensionDescription?.publisher ?? '',
|
|
113
|
+
extensionPublisherDisplayName: extensionDescription?.publisherDisplayName,
|
|
94
114
|
metadata: revive(metadata),
|
|
95
115
|
slashCommands: [],
|
|
96
116
|
locations: [ChatAgentLocation.Panel]
|
|
@@ -159,7 +179,7 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
|
159
179
|
kind: 18 ,
|
|
160
180
|
detail: v.detail,
|
|
161
181
|
documentation: v.documentation,
|
|
162
|
-
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 }] }
|
|
163
183
|
};
|
|
164
184
|
}));
|
|
165
185
|
return {
|
|
@@ -178,7 +198,9 @@ MainThreadChatAgents2 = __decorate([
|
|
|
178
198
|
( __param(2, IChatService)),
|
|
179
199
|
( __param(3, ILanguageFeaturesService)),
|
|
180
200
|
( __param(4, IChatWidgetService)),
|
|
181
|
-
( __param(5, IInstantiationService))
|
|
201
|
+
( __param(5, IInstantiationService)),
|
|
202
|
+
( __param(6, ILogService)),
|
|
203
|
+
( __param(7, IExtensionService))
|
|
182
204
|
], MainThreadChatAgents2);
|
|
183
205
|
function computeCompletionRanges(model, position, reg) {
|
|
184
206
|
const varWord = getWordAtText(position.column, reg, model.getLineContent(position.lineNumber), 0);
|
|
@@ -322,7 +322,7 @@ let MainThreadDebugService = class MainThreadDebugService {
|
|
|
322
322
|
this.getDebugAdapter(handle).acceptMessage(convertToVSCPaths(message, false));
|
|
323
323
|
}
|
|
324
324
|
$acceptDAError(handle, name, message, stack) {
|
|
325
|
-
this.
|
|
325
|
+
this._debugAdapters.get(handle)?.fireError(handle, ( new Error(`${name}: ${message}\n${stack}`)));
|
|
326
326
|
}
|
|
327
327
|
$acceptDAExit(handle, code, signal) {
|
|
328
328
|
this.getDebugAdapter(handle).fireExit(handle, code, signal);
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
-
import {
|
|
2
|
+
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
3
|
+
import { DisposableStore, DisposableMap } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { isEqual } from 'vscode/vscode/vs/base/common/resources';
|
|
5
|
+
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
6
|
+
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
7
|
+
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
3
8
|
import { ExtHostContext, MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
4
|
-
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
5
9
|
import { EditorResourceAccessor, SideBySideEditor } from 'vscode/vscode/vs/workbench/common/editor';
|
|
6
10
|
import { DiffEditorInput } from 'vscode/vscode/vs/workbench/common/editor/diffEditorInput';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
10
|
-
import { SIDE_GROUP } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
11
|
-
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
11
|
+
import { isGroupEditorMoveEvent } from 'vscode/vscode/vs/workbench/common/editor/editorGroupModel';
|
|
12
|
+
import { SideBySideEditorInput } from 'vscode/vscode/vs/workbench/common/editor/sideBySideEditorInput';
|
|
12
13
|
import { AbstractTextResourceEditorInput } from 'vscode/vscode/vs/workbench/common/editor/textResourceEditorInput';
|
|
13
|
-
import {
|
|
14
|
+
import { ChatEditorInput } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
|
|
14
15
|
import { CustomEditorInput } from 'vscode/vscode/vs/workbench/contrib/customEditor/browser/customEditorInput';
|
|
15
|
-
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
16
|
-
import { WebviewInput } from 'vscode/vscode/vs/workbench/contrib/webviewPanel/browser/webviewEditorInput';
|
|
17
|
-
import { TerminalEditorInput } from 'vscode/vscode/vs/workbench/contrib/terminal/browser/terminalEditorInput';
|
|
18
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
19
|
-
import { SideBySideEditorInput } from 'vscode/vscode/vs/workbench/common/editor/sideBySideEditorInput';
|
|
20
|
-
import { isEqual } from 'vscode/vscode/vs/base/common/resources';
|
|
21
|
-
import { isGroupEditorMoveEvent } from 'vscode/vscode/vs/workbench/common/editor/editorGroupModel';
|
|
22
16
|
import { InteractiveEditorInput } from 'vscode/vscode/vs/workbench/contrib/interactive/browser/interactiveEditorInput';
|
|
23
17
|
import { MergeEditorInput } from 'vscode/vscode/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput';
|
|
24
|
-
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
25
|
-
import { ChatEditorInput } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
|
|
26
18
|
import { MultiDiffEditorInput } from 'vscode/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput';
|
|
19
|
+
import { NotebookEditorInput } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookEditorInput';
|
|
20
|
+
import { TerminalEditorInput } from 'vscode/vscode/vs/workbench/contrib/terminal/browser/terminalEditorInput';
|
|
21
|
+
import { WebviewInput } from 'vscode/vscode/vs/workbench/contrib/webviewPanel/browser/webviewEditorInput';
|
|
22
|
+
import { editorGroupToColumn, columnToEditorGroup } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupColumn';
|
|
23
|
+
import { preferredSideBySideGroupDirection } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
|
|
24
|
+
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
25
|
+
import { SIDE_GROUP } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
26
|
+
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
27
|
+
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
27
28
|
|
|
28
29
|
let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
29
30
|
constructor(extHostContext, _editorGroupsService, _configurationService, _logService, editorService) {
|
|
@@ -34,6 +35,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
34
35
|
this._tabGroupModel = [];
|
|
35
36
|
this._groupLookup = ( new Map());
|
|
36
37
|
this._tabInfoLookup = ( new Map());
|
|
38
|
+
this._multiDiffEditorInputListeners = ( new DisposableMap());
|
|
37
39
|
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostEditorTabs));
|
|
38
40
|
this._dispoables.add(editorService.onDidEditorsChange((event) => {
|
|
39
41
|
try {
|
|
@@ -44,6 +46,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
44
46
|
this._createTabsModel();
|
|
45
47
|
}
|
|
46
48
|
}));
|
|
49
|
+
this._dispoables.add(this._multiDiffEditorInputListeners);
|
|
47
50
|
this._dispoables.add(this._editorGroupsService.onDidAddGroup(() => this._createTabsModel()));
|
|
48
51
|
this._dispoables.add(this._editorGroupsService.onDidRemoveGroup(() => this._createTabsModel()));
|
|
49
52
|
this._editorGroupsService.whenReady.then(() => this._createTabsModel());
|
|
@@ -150,12 +153,11 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
150
153
|
if (editor instanceof ChatEditorInput) {
|
|
151
154
|
return {
|
|
152
155
|
kind: 10 ,
|
|
153
|
-
providerId: editor.providerId ?? 'unknown',
|
|
154
156
|
};
|
|
155
157
|
}
|
|
156
158
|
if (editor instanceof MultiDiffEditorInput) {
|
|
157
159
|
const diffEditors = [];
|
|
158
|
-
for (const resource of (editor?.
|
|
160
|
+
for (const resource of (editor?.resources.get() ?? [])) {
|
|
159
161
|
if (resource.original && resource.modified) {
|
|
160
162
|
diffEditors.push({
|
|
161
163
|
kind: 2 ,
|
|
@@ -220,7 +222,23 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
220
222
|
}
|
|
221
223
|
const tabObject = this._buildTabObject(group, editorInput, editorIndex);
|
|
222
224
|
tabs.splice(editorIndex, 0, tabObject);
|
|
223
|
-
this.
|
|
225
|
+
const tabId = this._generateTabId(editorInput, groupId);
|
|
226
|
+
this._tabInfoLookup.set(tabId, { group, editorInput, tab: tabObject });
|
|
227
|
+
if (editorInput instanceof MultiDiffEditorInput) {
|
|
228
|
+
this._multiDiffEditorInputListeners.set(editorInput, Event.fromObservableLight(editorInput.resources)(() => {
|
|
229
|
+
const tabInfo = this._tabInfoLookup.get(tabId);
|
|
230
|
+
if (!tabInfo) {
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
tabInfo.tab = this._buildTabObject(group, editorInput, editorIndex);
|
|
234
|
+
this._proxy.$acceptTabOperation({
|
|
235
|
+
groupId,
|
|
236
|
+
index: editorIndex,
|
|
237
|
+
tabDto: tabInfo.tab,
|
|
238
|
+
kind: 2
|
|
239
|
+
});
|
|
240
|
+
}));
|
|
241
|
+
}
|
|
224
242
|
this._proxy.$acceptTabOperation({
|
|
225
243
|
groupId,
|
|
226
244
|
index: editorIndex,
|
|
@@ -240,6 +258,9 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
240
258
|
return;
|
|
241
259
|
}
|
|
242
260
|
this._tabInfoLookup.delete(removedTab[0]?.id ?? '');
|
|
261
|
+
if (removedTab[0]?.input instanceof MultiDiffEditorInput) {
|
|
262
|
+
this._multiDiffEditorInputListeners.deleteAndDispose(removedTab[0]?.input);
|
|
263
|
+
}
|
|
243
264
|
this._proxy.$acceptTabOperation({
|
|
244
265
|
groupId,
|
|
245
266
|
index: editorIndex,
|
|
@@ -334,6 +355,9 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
334
355
|
});
|
|
335
356
|
}
|
|
336
357
|
_createTabsModel() {
|
|
358
|
+
if (this._editorGroupsService.groups.length === 0) {
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
337
361
|
this._tabGroupModel = [];
|
|
338
362
|
this._groupLookup.clear();
|
|
339
363
|
this._tabInfoLookup.clear();
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
+
import { isFalsyOrEmpty } from 'vscode/vscode/vs/base/common/arrays';
|
|
2
3
|
import { VSDataTransfer, createStringDataTransferItem } from 'vscode/vscode/vs/base/common/dataTransfer';
|
|
3
4
|
import { CancellationError } from 'vscode/vscode/vs/base/common/errors';
|
|
4
5
|
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
6
|
+
import { HierarchicalKind } from 'vscode/vscode/vs/base/common/hierarchicalKind';
|
|
5
7
|
import { Disposable, DisposableMap, combinedDisposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
8
|
+
import { ResourceMap } from 'vscode/vscode/vs/base/common/map';
|
|
6
9
|
import { revive } from 'vscode/vscode/vs/base/common/marshalling';
|
|
7
10
|
import { mixin } from 'vscode/vscode/vs/base/common/objects';
|
|
8
11
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
@@ -19,9 +22,6 @@ import { WorkspaceSymbolProviderRegistry } from 'vscode/vscode/vs/workbench/cont
|
|
|
19
22
|
import { TypeHierarchyProviderRegistry } from 'vscode/vscode/vs/workbench/contrib/typeHierarchy/common/typeHierarchy';
|
|
20
23
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
21
24
|
import { ExtHostContext, MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
22
|
-
import { ResourceMap } from 'vscode/vscode/vs/base/common/map';
|
|
23
|
-
import { isFalsyOrEmpty } from 'vscode/vscode/vs/base/common/arrays';
|
|
24
|
-
import { HierarchicalKind } from 'vscode/vscode/vs/base/common/hierarchicalKind';
|
|
25
25
|
|
|
26
26
|
var MainThreadLanguageFeatures_1;
|
|
27
27
|
let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThreadLanguageFeatures extends Disposable {
|
|
@@ -202,8 +202,15 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
|
|
|
202
202
|
}
|
|
203
203
|
$registerHoverProvider(handle, selector) {
|
|
204
204
|
this._registrations.set(handle, this._languageFeaturesService.hoverProvider.register(selector, {
|
|
205
|
-
provideHover: (model, position, token) => {
|
|
206
|
-
|
|
205
|
+
provideHover: async (model, position, token, context) => {
|
|
206
|
+
const serializedContext = {
|
|
207
|
+
verbosityRequest: context?.verbosityRequest ? {
|
|
208
|
+
action: context.verbosityRequest.action,
|
|
209
|
+
previousHover: { id: context.verbosityRequest.previousHover.id }
|
|
210
|
+
} : undefined,
|
|
211
|
+
};
|
|
212
|
+
const hover = await this._proxy.$provideHover(handle, model.uri, position, serializedContext, token);
|
|
213
|
+
return hover;
|
|
207
214
|
}
|
|
208
215
|
}));
|
|
209
216
|
}
|
|
@@ -394,8 +401,9 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
|
|
|
394
401
|
}
|
|
395
402
|
$registerNewSymbolNamesProvider(handle, selector) {
|
|
396
403
|
this._registrations.set(handle, this._languageFeaturesService.newSymbolNamesProvider.register(selector, {
|
|
397
|
-
|
|
398
|
-
|
|
404
|
+
supportsAutomaticNewSymbolNamesTriggerKind: this._proxy.$supportsAutomaticNewSymbolNamesTriggerKind(handle),
|
|
405
|
+
provideNewSymbolNames: (model, range, triggerKind, token) => {
|
|
406
|
+
return this._proxy.$provideNewSymbolNames(handle, model.uri, range, triggerKind, token);
|
|
399
407
|
}
|
|
400
408
|
}));
|
|
401
409
|
}
|
|
@@ -800,7 +808,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
|
|
|
800
808
|
$registerDocumentOnDropEditProvider(handle, selector, metadata) {
|
|
801
809
|
const provider = ( new MainThreadDocumentOnDropEditProvider(handle, this._proxy, metadata, this._uriIdentService));
|
|
802
810
|
this._documentOnDropEditProviders.set(handle, provider);
|
|
803
|
-
this._registrations.set(handle, combinedDisposable(this._languageFeaturesService.
|
|
811
|
+
this._registrations.set(handle, combinedDisposable(this._languageFeaturesService.documentDropEditProvider.register(selector, provider), toDisposable(() => this._documentOnDropEditProviders.delete(handle))));
|
|
804
812
|
}
|
|
805
813
|
async $resolveDocumentOnDropFileData(handle, requestId, dataId) {
|
|
806
814
|
const provider = this._documentOnDropEditProviders.get(handle);
|
|
@@ -905,8 +913,17 @@ let MainThreadDocumentOnDropEditProvider = class MainThreadDocumentOnDropEditPro
|
|
|
905
913
|
this._uriIdentService = _uriIdentService;
|
|
906
914
|
this.dataTransfers = ( new DataTransferFileCache());
|
|
907
915
|
this.dropMimeTypes = metadata?.dropMimeTypes ?? ['*/*'];
|
|
916
|
+
if (metadata?.supportsResolve) {
|
|
917
|
+
this.resolveDocumentDropEdit = async (edit, token) => {
|
|
918
|
+
const resolved = await this._proxy.$resolvePasteEdit(this._handle, edit._cacheId, token);
|
|
919
|
+
if (resolved.additionalEdit) {
|
|
920
|
+
edit.additionalEdit = reviveWorkspaceEditDto(resolved.additionalEdit, this._uriIdentService);
|
|
921
|
+
}
|
|
922
|
+
return edit;
|
|
923
|
+
};
|
|
924
|
+
}
|
|
908
925
|
}
|
|
909
|
-
async
|
|
926
|
+
async provideDocumentDropEdits(model, position, dataTransfer, token) {
|
|
910
927
|
const request = this.dataTransfers.add(dataTransfer);
|
|
911
928
|
try {
|
|
912
929
|
const dataTransferDto = await DataTransfer.from(dataTransfer);
|
|
@@ -5,22 +5,20 @@ import { DisposableStore, DisposableMap, Disposable, toDisposable } from 'vscode
|
|
|
5
5
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
6
6
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
7
7
|
import { Progress } from 'vscode/vscode/vs/platform/progress/common/progress';
|
|
8
|
-
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
9
8
|
import { ExtHostContext, MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
9
|
+
import { ILanguageModelStatsService } from 'vscode/vscode/vs/workbench/contrib/chat/common/languageModelStats.service';
|
|
10
10
|
import { ILanguageModelsService } from 'vscode/vscode/vs/workbench/contrib/chat/common/languageModels.service';
|
|
11
11
|
import { IAuthenticationAccessService } from 'vscode/vscode/vs/workbench/services/authentication/browser/authenticationAccessService.service';
|
|
12
12
|
import { INTERNAL_AUTH_PROVIDER_PREFIX } from 'vscode/vscode/vs/workbench/services/authentication/common/authentication';
|
|
13
13
|
import { IAuthenticationService } from 'vscode/vscode/vs/workbench/services/authentication/common/authentication.service';
|
|
14
|
-
import { Extensions } from 'vscode/vscode/vs/workbench/services/extensionManagement/common/extensionFeatures';
|
|
15
|
-
import { IExtensionFeaturesManagementService } from 'vscode/vscode/vs/workbench/services/extensionManagement/common/extensionFeatures.service';
|
|
16
14
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
17
15
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
18
16
|
|
|
19
17
|
const _moduleId = "vs/workbench/api/browser/mainThreadLanguageModels";
|
|
20
18
|
let MainThreadLanguageModels = class MainThreadLanguageModels {
|
|
21
|
-
constructor(extHostContext, _chatProviderService,
|
|
19
|
+
constructor(extHostContext, _chatProviderService, _languageModelStatsService, _logService, _authenticationService, _authenticationAccessService, _extensionService) {
|
|
22
20
|
this._chatProviderService = _chatProviderService;
|
|
23
|
-
this.
|
|
21
|
+
this._languageModelStatsService = _languageModelStatsService;
|
|
24
22
|
this._logService = _logService;
|
|
25
23
|
this._authenticationService = _authenticationService;
|
|
26
24
|
this._authenticationAccessService = _authenticationAccessService;
|
|
@@ -49,18 +47,14 @@ let MainThreadLanguageModels = class MainThreadLanguageModels {
|
|
|
49
47
|
finally {
|
|
50
48
|
this._pendingProgress.delete(requestId);
|
|
51
49
|
}
|
|
52
|
-
}
|
|
50
|
+
},
|
|
51
|
+
provideTokenCount: (str, token) => {
|
|
52
|
+
return this._proxy.$provideTokenLength(handle, str, token);
|
|
53
|
+
},
|
|
53
54
|
}));
|
|
54
55
|
if (metadata.auth) {
|
|
55
56
|
dipsosables.add(this._registerAuthenticationProvider(metadata.extension, metadata.auth));
|
|
56
57
|
}
|
|
57
|
-
dipsosables.add(( (Registry.as(Extensions.ExtensionFeaturesRegistry))).registerExtensionFeature({
|
|
58
|
-
id: `lm-${identifier}`,
|
|
59
|
-
label: ( localizeWithPath(_moduleId, 0, "Language Model ({0})", `${identifier}`)),
|
|
60
|
-
access: {
|
|
61
|
-
canToggle: false,
|
|
62
|
-
},
|
|
63
|
-
}));
|
|
64
58
|
this._providerRegistrations.set(handle, dipsosables);
|
|
65
59
|
}
|
|
66
60
|
async $handleProgressChunk(requestId, chunk) {
|
|
@@ -69,6 +63,9 @@ let MainThreadLanguageModels = class MainThreadLanguageModels {
|
|
|
69
63
|
$unregisterProvider(handle) {
|
|
70
64
|
this._providerRegistrations.deleteAndDispose(handle);
|
|
71
65
|
}
|
|
66
|
+
$whenLanguageModelChatRequestMade(identifier, extensionId, participant, tokenCount) {
|
|
67
|
+
this._languageModelStatsService.update(identifier, extensionId, participant, tokenCount);
|
|
68
|
+
}
|
|
72
69
|
async $prepareChatAccess(extension, providerId, justification) {
|
|
73
70
|
const activate = this._extensionService.activateByEvent(`onLanguageModelAccess:${providerId}`);
|
|
74
71
|
const metadata = this._chatProviderService.lookupLanguageModel(providerId);
|
|
@@ -82,7 +79,6 @@ let MainThreadLanguageModels = class MainThreadLanguageModels {
|
|
|
82
79
|
return this._chatProviderService.lookupLanguageModel(providerId);
|
|
83
80
|
}
|
|
84
81
|
async $fetchResponse(extension, providerId, requestId, messages, options, token) {
|
|
85
|
-
await this._extensionFeaturesManagementService.getAccess(extension, `lm-${providerId}`);
|
|
86
82
|
this._logService.debug('[CHAT] extension request STARTED', extension.value, requestId);
|
|
87
83
|
const task = this._chatProviderService.makeLanguageModelChatRequest(providerId, extension, messages, options, ( (new Progress(value => {
|
|
88
84
|
this._proxy.$handleResponseFragment(requestId, value);
|
|
@@ -95,12 +91,15 @@ let MainThreadLanguageModels = class MainThreadLanguageModels {
|
|
|
95
91
|
});
|
|
96
92
|
return task;
|
|
97
93
|
}
|
|
94
|
+
$countTokens(provider, value, token) {
|
|
95
|
+
return this._chatProviderService.computeTokenLength(provider, value, token);
|
|
96
|
+
}
|
|
98
97
|
_registerAuthenticationProvider(extension, auth) {
|
|
99
98
|
const authProviderId = INTERNAL_AUTH_PROVIDER_PREFIX + extension.value;
|
|
100
99
|
if (this._authenticationService.getProviderIds().includes(authProviderId)) {
|
|
101
100
|
return Disposable.None;
|
|
102
101
|
}
|
|
103
|
-
const accountLabel = auth.accountLabel ?? ( localizeWithPath(_moduleId,
|
|
102
|
+
const accountLabel = auth.accountLabel ?? ( localizeWithPath(_moduleId, 0, 'Language Models'));
|
|
104
103
|
const disposables = ( (new DisposableStore()));
|
|
105
104
|
this._authenticationService.registerAuthenticationProvider(authProviderId, ( (new LanguageModelAccessAuthProvider(authProviderId, auth.providerLabel, accountLabel))));
|
|
106
105
|
disposables.add(toDisposable(() => {
|
|
@@ -127,7 +126,7 @@ let MainThreadLanguageModels = class MainThreadLanguageModels {
|
|
|
127
126
|
MainThreadLanguageModels = __decorate([
|
|
128
127
|
extHostNamedCustomer(MainContext.MainThreadLanguageModels),
|
|
129
128
|
( (__param(1, ILanguageModelsService))),
|
|
130
|
-
( (__param(2,
|
|
129
|
+
( (__param(2, ILanguageModelStatsService))),
|
|
131
130
|
( (__param(3, ILogService))),
|
|
132
131
|
( (__param(4, IAuthenticationService))),
|
|
133
132
|
( (__param(5, IAuthenticationAccessService))),
|
|
@@ -4,6 +4,7 @@ import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
|
4
4
|
import { generateUuid } from 'vscode/vscode/vs/base/common/uuid';
|
|
5
5
|
import { isString } from 'vscode/vscode/vs/base/common/types';
|
|
6
6
|
import { platform } from 'vscode/vscode/vs/base/common/platform';
|
|
7
|
+
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
7
8
|
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
|
|
8
9
|
import { TaskDefinition, PresentationOptions, RunOptions, CommandOptions, RuntimeType, TaskSourceKind, CustomTask, ContributedTask, ConfiguringTask } from 'vscode/vscode/vs/workbench/contrib/tasks/common/tasks';
|
|
9
10
|
import { ITaskService } from 'vscode/vscode/vs/workbench/contrib/tasks/common/taskService.service';
|
|
@@ -429,14 +430,15 @@ var TaskFilterDTO;
|
|
|
429
430
|
}
|
|
430
431
|
TaskFilterDTO.to = to;
|
|
431
432
|
})(TaskFilterDTO || (TaskFilterDTO = {}))));
|
|
432
|
-
let MainThreadTask = class MainThreadTask {
|
|
433
|
+
let MainThreadTask = class MainThreadTask extends Disposable {
|
|
433
434
|
constructor(extHostContext, _taskService, _workspaceContextServer, _configurationResolverService) {
|
|
435
|
+
super();
|
|
434
436
|
this._taskService = _taskService;
|
|
435
437
|
this._workspaceContextServer = _workspaceContextServer;
|
|
436
438
|
this._configurationResolverService = _configurationResolverService;
|
|
437
439
|
this._proxy = ( (extHostContext.getProxy(ExtHostContext.ExtHostTask)));
|
|
438
440
|
this._providers = ( (new Map()));
|
|
439
|
-
this._taskService.onDidStateChange(async (event) => {
|
|
441
|
+
this._register(this._taskService.onDidStateChange(async (event) => {
|
|
440
442
|
if (event.kind === "changed" ) {
|
|
441
443
|
return;
|
|
442
444
|
}
|
|
@@ -462,13 +464,14 @@ let MainThreadTask = class MainThreadTask {
|
|
|
462
464
|
else if (event.kind === "end" ) {
|
|
463
465
|
this._proxy.$OnDidEndTask(TaskExecutionDTO.from(task.getTaskExecution()));
|
|
464
466
|
}
|
|
465
|
-
});
|
|
467
|
+
}));
|
|
466
468
|
}
|
|
467
469
|
dispose() {
|
|
468
470
|
for (const value of ( (this._providers.values()))) {
|
|
469
471
|
value.disposable.dispose();
|
|
470
472
|
}
|
|
471
473
|
this._providers.clear();
|
|
474
|
+
super.dispose();
|
|
472
475
|
}
|
|
473
476
|
$createTaskId(taskDTO) {
|
|
474
477
|
return (
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
3
|
-
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
+
import { Disposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
4
5
|
import { ExtHostContext, MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
5
6
|
import { ITerminalService } from 'vscode/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
|
|
6
7
|
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
7
8
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
9
|
+
import { TerminalShellExecutionCommandLineConfidence } from 'vscode/vscode/vs/workbench/api/common/extHostTypes';
|
|
8
10
|
|
|
9
11
|
let MainThreadTerminalShellIntegration = class MainThreadTerminalShellIntegration extends Disposable {
|
|
10
12
|
constructor(extHostContext, _terminalService, workbenchEnvironmentService) {
|
|
11
13
|
super();
|
|
12
14
|
this._terminalService = _terminalService;
|
|
13
15
|
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostTerminalShellIntegration));
|
|
14
|
-
const
|
|
16
|
+
const instanceDataListeners = ( new Map());
|
|
17
|
+
this._register(toDisposable(() => {
|
|
18
|
+
for (const listener of ( instanceDataListeners.values())) {
|
|
19
|
+
listener.dispose();
|
|
20
|
+
}
|
|
21
|
+
}));
|
|
22
|
+
const onDidAddCommandDetection = this._store.add(this._terminalService.createOnInstanceEvent(instance => {
|
|
15
23
|
return ( Event.map(Event.filter(instance.capabilities.onDidAddCapabilityType, e => {
|
|
16
24
|
return e === 2 ;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
25
|
+
}), () => instance));
|
|
26
|
+
})).event;
|
|
19
27
|
this._store.add(onDidAddCommandDetection(e => this._proxy.$shellIntegrationChange(e.instanceId)));
|
|
20
28
|
const commandDetectionStartEvent = this._store.add(this._terminalService.createOnInstanceCapabilityEvent(2 , e => e.onCommandExecuted));
|
|
21
29
|
let currentCommand;
|
|
@@ -24,28 +32,48 @@ let MainThreadTerminalShellIntegration = class MainThreadTerminalShellIntegratio
|
|
|
24
32
|
return;
|
|
25
33
|
}
|
|
26
34
|
currentCommand = e.data;
|
|
27
|
-
|
|
35
|
+
const instanceId = e.instance.instanceId;
|
|
36
|
+
this._proxy.$shellExecutionStart(instanceId, e.data.command, convertToExtHostCommandLineConfidence(e.data), e.data.isTrusted, this._convertCwdToUri(e.data.cwd));
|
|
37
|
+
instanceDataListeners.get(instanceId)?.dispose();
|
|
38
|
+
instanceDataListeners.set(instanceId, Event.accumulate(e.instance.onData, 50, this._store)(events => this._proxy.$shellExecutionData(instanceId, events.join())));
|
|
28
39
|
}));
|
|
29
40
|
const commandDetectionEndEvent = this._store.add(this._terminalService.createOnInstanceCapabilityEvent(2 , e => e.onCommandFinished));
|
|
30
41
|
this._store.add(commandDetectionEndEvent.event(e => {
|
|
31
42
|
currentCommand = undefined;
|
|
32
|
-
|
|
43
|
+
const instanceId = e.instance.instanceId;
|
|
44
|
+
instanceDataListeners.get(instanceId)?.dispose();
|
|
45
|
+
setTimeout(() => {
|
|
46
|
+
this._proxy.$shellExecutionEnd(instanceId, e.data.command, convertToExtHostCommandLineConfidence(e.data), e.data.isTrusted, e.data.exitCode);
|
|
47
|
+
});
|
|
33
48
|
}));
|
|
34
49
|
const cwdChangeEvent = this._store.add(this._terminalService.createOnInstanceCapabilityEvent(0 , e => e.onDidChangeCwd));
|
|
35
|
-
this._store.add(cwdChangeEvent.event(e =>
|
|
50
|
+
this._store.add(cwdChangeEvent.event(e => {
|
|
51
|
+
this._proxy.$cwdChange(e.instance.instanceId, this._convertCwdToUri(e.data));
|
|
52
|
+
}));
|
|
36
53
|
this._store.add(this._terminalService.onDidDisposeInstance(e => this._proxy.$closeTerminal(e.instanceId)));
|
|
37
|
-
if (!workbenchEnvironmentService.remoteAuthority) {
|
|
38
|
-
this._store.add(this._terminalService.onAnyInstanceData(e => this._proxy.$shellExecutionData(e.instance.instanceId, e.data)));
|
|
39
|
-
}
|
|
40
54
|
}
|
|
41
55
|
$executeCommand(terminalId, commandLine) {
|
|
42
56
|
this._terminalService.getInstanceFromId(terminalId)?.runCommand(commandLine, true);
|
|
43
57
|
}
|
|
58
|
+
_convertCwdToUri(cwd) {
|
|
59
|
+
return cwd ? URI.file(cwd) : undefined;
|
|
60
|
+
}
|
|
44
61
|
};
|
|
45
62
|
MainThreadTerminalShellIntegration = __decorate([
|
|
46
63
|
extHostNamedCustomer(MainContext.MainThreadTerminalShellIntegration),
|
|
47
64
|
( __param(1, ITerminalService)),
|
|
48
65
|
( __param(2, IWorkbenchEnvironmentService))
|
|
49
66
|
], MainThreadTerminalShellIntegration);
|
|
67
|
+
function convertToExtHostCommandLineConfidence(command) {
|
|
68
|
+
switch (command.commandLineConfidence) {
|
|
69
|
+
case 'high':
|
|
70
|
+
return TerminalShellExecutionCommandLineConfidence.High;
|
|
71
|
+
case 'medium':
|
|
72
|
+
return TerminalShellExecutionCommandLineConfidence.Medium;
|
|
73
|
+
case 'low':
|
|
74
|
+
default:
|
|
75
|
+
return TerminalShellExecutionCommandLineConfidence.Low;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
50
78
|
|
|
51
79
|
export { MainThreadTerminalShellIntegration };
|
|
@@ -6,6 +6,7 @@ import 'vscode/vscode/vs/base/common/observableInternal/derived';
|
|
|
6
6
|
import 'vscode/vscode/vs/base/common/observableInternal/autorun';
|
|
7
7
|
import 'vscode/vscode/vs/base/common/observableInternal/utils';
|
|
8
8
|
import 'vscode/vscode/vs/base/common/cancellation';
|
|
9
|
+
import 'vscode/vscode/vs/base/common/arrays';
|
|
9
10
|
import { WellDefinedPrefixTree } from 'vscode/vscode/vs/base/common/prefixTree';
|
|
10
11
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
11
12
|
import { Range } from 'vscode/vscode/vs/editor/common/core/range';
|
|
@@ -9,6 +9,7 @@ import { mark } from 'vscode/vscode/vs/base/common/performance';
|
|
|
9
9
|
import { isCI } from 'vscode/vscode/vs/base/common/platform';
|
|
10
10
|
import { isEqualOrParent } from 'vscode/vscode/vs/base/common/resources';
|
|
11
11
|
import { StopWatch } from 'vscode/vscode/vs/base/common/stopwatch';
|
|
12
|
+
import { isDefined } from 'vscode/vscode/vs/base/common/types';
|
|
12
13
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
13
14
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
14
15
|
import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
@@ -641,7 +642,7 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
|
|
|
641
642
|
this._onDidChangeResponsiveChange.fire({
|
|
642
643
|
extensionHostKind: processManager.kind,
|
|
643
644
|
isResponsive: responsiveState === 0 ,
|
|
644
|
-
|
|
645
|
+
getInspectListener: (tryEnableInspector) => {
|
|
645
646
|
return processManager.getInspectPort(tryEnableInspector);
|
|
646
647
|
}
|
|
647
648
|
});
|
|
@@ -840,7 +841,7 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
|
|
|
840
841
|
}
|
|
841
842
|
async getInspectPorts(extensionHostKind, tryEnableInspector) {
|
|
842
843
|
const result = await Promise.all(( (this._getExtensionHostManagers(extensionHostKind).map(extHost => extHost.getInspectPort(tryEnableInspector)))));
|
|
843
|
-
return result.filter(
|
|
844
|
+
return result.filter(isDefined);
|
|
844
845
|
}
|
|
845
846
|
async setRemoteEnvironment(env) {
|
|
846
847
|
await ( (this._extensionHostManagers
|
|
@@ -266,7 +266,7 @@ let ExtensionHostManager = ExtensionHostManager_1 = class ExtensionHostManager e
|
|
|
266
266
|
return port;
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
return
|
|
269
|
+
return undefined;
|
|
270
270
|
}
|
|
271
271
|
async resolveAuthority(remoteAuthority, resolveAttempt) {
|
|
272
272
|
const sw = StopWatch.create(false);
|
package/vscode/src/vs/workbench/services/extensions/common/lazyCreateExtensionHostManager.js
CHANGED
|
@@ -105,10 +105,7 @@ let LazyCreateExtensionHostManager = class LazyCreateExtensionHostManager extend
|
|
|
105
105
|
}
|
|
106
106
|
async getInspectPort(tryEnableInspector) {
|
|
107
107
|
await this._startCalled.wait();
|
|
108
|
-
|
|
109
|
-
return this._actual.getInspectPort(tryEnableInspector);
|
|
110
|
-
}
|
|
111
|
-
return 0;
|
|
108
|
+
return this._actual?.getInspectPort(tryEnableInspector);
|
|
112
109
|
}
|
|
113
110
|
async resolveAuthority(remoteAuthority, resolveAttempt) {
|
|
114
111
|
await this._startCalled.wait();
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
-
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
3
|
-
import { Disposable, DisposableMap } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
|
-
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
5
|
-
import { ExtHostContext, MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
6
|
-
import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
7
|
-
import { IChatContributionService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContributionService.service';
|
|
8
|
-
import { IChatService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
9
|
-
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
10
|
-
|
|
11
|
-
let MainThreadChat = class MainThreadChat extends Disposable {
|
|
12
|
-
constructor(extHostContext, _chatService, _chatWidgetService, chatContribService) {
|
|
13
|
-
super();
|
|
14
|
-
this._chatService = _chatService;
|
|
15
|
-
this._chatWidgetService = _chatWidgetService;
|
|
16
|
-
this.chatContribService = chatContribService;
|
|
17
|
-
this._providerRegistrations = this._register(( new DisposableMap()));
|
|
18
|
-
this._stateEmitters = ( new Map());
|
|
19
|
-
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostChat));
|
|
20
|
-
}
|
|
21
|
-
$transferChatSession(sessionId, toWorkspace) {
|
|
22
|
-
const sessionIdStr = this._chatService.getSessionId(sessionId);
|
|
23
|
-
if (!sessionIdStr) {
|
|
24
|
-
throw ( new Error(`Failed to transfer session. Unknown session provider ID: ${sessionId}`));
|
|
25
|
-
}
|
|
26
|
-
const widget = this._chatWidgetService.getWidgetBySessionId(sessionIdStr);
|
|
27
|
-
const inputValue = widget?.inputEditor.getValue() ?? '';
|
|
28
|
-
this._chatService.transferChatSession({ sessionId: sessionIdStr, inputValue: inputValue }, URI.revive(toWorkspace));
|
|
29
|
-
}
|
|
30
|
-
async $registerChatProvider(handle, id) {
|
|
31
|
-
const registration = this.chatContribService.registeredProviders.find(staticProvider => staticProvider.id === id);
|
|
32
|
-
if (!registration) {
|
|
33
|
-
throw ( new Error(`Provider ${id} must be declared in the package.json.`));
|
|
34
|
-
}
|
|
35
|
-
const unreg = this._chatService.registerProvider({
|
|
36
|
-
id,
|
|
37
|
-
prepareSession: async (token) => {
|
|
38
|
-
const session = await this._proxy.$prepareChat(handle, token);
|
|
39
|
-
if (!session) {
|
|
40
|
-
return undefined;
|
|
41
|
-
}
|
|
42
|
-
const emitter = ( new Emitter());
|
|
43
|
-
this._stateEmitters.set(session.id, emitter);
|
|
44
|
-
return {
|
|
45
|
-
id: session.id,
|
|
46
|
-
dispose: () => {
|
|
47
|
-
emitter.dispose();
|
|
48
|
-
this._stateEmitters.delete(session.id);
|
|
49
|
-
this._proxy.$releaseSession(session.id);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
this._providerRegistrations.set(handle, unreg);
|
|
55
|
-
}
|
|
56
|
-
async $acceptChatState(sessionId, state) {
|
|
57
|
-
this._stateEmitters.get(sessionId)?.fire(state);
|
|
58
|
-
}
|
|
59
|
-
async $unregisterChatProvider(handle) {
|
|
60
|
-
this._providerRegistrations.deleteAndDispose(handle);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
MainThreadChat = __decorate([
|
|
64
|
-
extHostNamedCustomer(MainContext.MainThreadChat),
|
|
65
|
-
( __param(1, IChatService)),
|
|
66
|
-
( __param(2, IChatWidgetService)),
|
|
67
|
-
( __param(3, IChatContributionService))
|
|
68
|
-
], MainThreadChat);
|
|
69
|
-
|
|
70
|
-
export { MainThreadChat };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
-
import { Disposable, DisposableMap } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
-
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
4
|
-
import { ExtHostContext, MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
5
|
-
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
6
|
-
import { IWorkbenchIssueService } from 'vscode/vscode/vs/workbench/services/issue/common/issue.service';
|
|
7
|
-
|
|
8
|
-
let MainThreadIssueReporter = class MainThreadIssueReporter extends Disposable {
|
|
9
|
-
constructor(context, _issueService) {
|
|
10
|
-
super();
|
|
11
|
-
this._issueService = _issueService;
|
|
12
|
-
this._registrationsUri = this._register(( new DisposableMap()));
|
|
13
|
-
this._registrationsData = this._register(( new DisposableMap()));
|
|
14
|
-
this._proxy = ( context.getProxy(ExtHostContext.ExtHostIssueReporter));
|
|
15
|
-
}
|
|
16
|
-
$registerIssueUriRequestHandler(extensionId) {
|
|
17
|
-
const handler = {
|
|
18
|
-
provideIssueUrl: async (token) => {
|
|
19
|
-
const parts = await this._proxy.$getIssueReporterUri(extensionId, token);
|
|
20
|
-
return ( URI.from(parts));
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
this._registrationsUri.set(extensionId, this._issueService.registerIssueUriRequestHandler(extensionId, handler));
|
|
24
|
-
}
|
|
25
|
-
$unregisterIssueUriRequestHandler(extensionId) {
|
|
26
|
-
this._registrationsUri.deleteAndDispose(extensionId);
|
|
27
|
-
}
|
|
28
|
-
$registerIssueDataProvider(extensionId) {
|
|
29
|
-
const provider = {
|
|
30
|
-
provideIssueExtensionData: async (token) => {
|
|
31
|
-
const parts = await this._proxy.$getIssueReporterData(extensionId, token);
|
|
32
|
-
return parts;
|
|
33
|
-
},
|
|
34
|
-
provideIssueExtensionTemplate: async (token) => {
|
|
35
|
-
const parts = await this._proxy.$getIssueReporterTemplate(extensionId, token);
|
|
36
|
-
return parts;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
this._registrationsData.set(extensionId, this._issueService.registerIssueDataProvider(extensionId, provider));
|
|
40
|
-
}
|
|
41
|
-
$unregisterIssueDataProvider(extensionId) {
|
|
42
|
-
this._registrationsData.deleteAndDispose(extensionId);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
MainThreadIssueReporter = __decorate([
|
|
46
|
-
extHostNamedCustomer(MainContext.MainThreadIssueReporter),
|
|
47
|
-
( __param(1, IWorkbenchIssueService))
|
|
48
|
-
], MainThreadIssueReporter);
|
|
49
|
-
|
|
50
|
-
export { MainThreadIssueReporter };
|