mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-28 12:33:35 +01:00
lock inline chat to its own agent so that must intellisense is disabled (#275857)
fixes https://github.com/microsoft/vscode/issues/275819
This commit is contained in:
@@ -14,7 +14,7 @@ import { Lazy } from '../../../../base/common/lazy.js';
|
||||
import { DisposableStore, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js';
|
||||
import { Schemas } from '../../../../base/common/network.js';
|
||||
import { MovingAverage } from '../../../../base/common/numbers.js';
|
||||
import { autorun, derived, IObservable, observableSignalFromEvent, observableValue, waitForState } from '../../../../base/common/observable.js';
|
||||
import { autorun, derived, IObservable, observableFromEvent, observableSignalFromEvent, observableValue, waitForState } from '../../../../base/common/observable.js';
|
||||
import { isEqual } from '../../../../base/common/resources.js';
|
||||
import { StopWatch } from '../../../../base/common/stopwatch.js';
|
||||
import { assertType } from '../../../../base/common/types.js';
|
||||
@@ -49,6 +49,7 @@ import { ISharedWebContentExtractorService } from '../../../../platform/webConte
|
||||
import { IEditorService, SIDE_GROUP } from '../../../services/editor/common/editorService.js';
|
||||
import { IChatAttachmentResolveService } from '../../chat/browser/chatAttachmentResolveService.js';
|
||||
import { IChatWidgetLocationOptions } from '../../chat/browser/chatWidget.js';
|
||||
import { IChatAgentService } from '../../chat/common/chatAgents.js';
|
||||
import { ChatContextKeys } from '../../chat/common/chatContextKeys.js';
|
||||
import { IChatEditingSession, ModifiedFileEntryState } from '../../chat/common/chatEditingService.js';
|
||||
import { ChatRequestRemovalReason, IChatRequestModel, IChatTextEditGroup, IChatTextEditGroupState, IResponse } from '../../chat/common/chatModel.js';
|
||||
@@ -1269,7 +1270,7 @@ export class InlineChatController2 implements IEditorContribution {
|
||||
@IChatAttachmentResolveService private readonly _chatAttachmentResolveService: IChatAttachmentResolveService,
|
||||
@IEditorService private readonly _editorService: IEditorService,
|
||||
@IMarkerDecorationsService private readonly _markerDecorationsService: IMarkerDecorationsService,
|
||||
@IInlineChatSessionService inlineChatService: IInlineChatSessionService,
|
||||
@IChatAgentService chatAgentService: IChatAgentService,
|
||||
@IChatService chatService: IChatService,
|
||||
) {
|
||||
|
||||
@@ -1335,8 +1336,21 @@ export class InlineChatController2 implements IEditorContribution {
|
||||
{ editor: this._editor, notebookEditor },
|
||||
);
|
||||
|
||||
this._store.add(result);
|
||||
|
||||
result.domNode.classList.add('inline-chat-2');
|
||||
|
||||
// agent lock
|
||||
const agentObs = observableFromEvent(this, chatAgentService.onDidChangeAgents, () => chatAgentService.getDefaultAgent(ChatAgentLocation.EditorInline));
|
||||
this._store.add(autorun(r => {
|
||||
const agent = agentObs.read(r);
|
||||
if (agent) {
|
||||
result.widget.chatWidget.lockToCodingAgent(agent.name, agent.fullName || agent.name, agent.id);
|
||||
} else {
|
||||
result.widget.chatWidget.unlockFromCodingAgent();
|
||||
}
|
||||
}));
|
||||
|
||||
return result;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user