mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
send inline chat variable as dedicated hidden variable (#211285)
https://github.com/microsoft/vscode-copilot/issues/5236
This commit is contained in:
@@ -229,6 +229,7 @@ export class InlineChatError extends Error {
|
||||
|
||||
const _bridgeAgentId = 'brigde.editor';
|
||||
const _inlineChatContext = '_inlineChatContext';
|
||||
const _inlineChatDocument = '_inlineChatDocument';
|
||||
|
||||
class InlineChatContext {
|
||||
|
||||
@@ -392,6 +393,17 @@ export class InlineChatSessionServiceImpl implements IInlineChatSessionService {
|
||||
return undefined;
|
||||
}
|
||||
));
|
||||
this._store.add(chatVariableService.registerVariable(
|
||||
{ name: _inlineChatDocument, description: '', hidden: true },
|
||||
async (_message, _arg, model) => {
|
||||
for (const [, data] of this._sessions) {
|
||||
if (data.session.chatModel === model) {
|
||||
return [{ level: 'full', value: data.session.textModelN.uri }];
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user