Skip to content

Commit 71ebcf9

Browse files
authored
send inline chat variable as dedicated hidden variable (microsoft#211285)
microsoft/vscode-copilot#5236
1 parent deb95fb commit 71ebcf9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ export class InlineChatError extends Error {
229229

230230
const _bridgeAgentId = 'brigde.editor';
231231
const _inlineChatContext = '_inlineChatContext';
232+
const _inlineChatDocument = '_inlineChatDocument';
232233

233234
class InlineChatContext {
234235

@@ -392,6 +393,17 @@ export class InlineChatSessionServiceImpl implements IInlineChatSessionService {
392393
return undefined;
393394
}
394395
));
396+
this._store.add(chatVariableService.registerVariable(
397+
{ name: _inlineChatDocument, description: '', hidden: true },
398+
async (_message, _arg, model) => {
399+
for (const [, data] of this._sessions) {
400+
if (data.session.chatModel === model) {
401+
return [{ level: 'full', value: data.session.textModelN.uri }];
402+
}
403+
}
404+
return undefined;
405+
}
406+
));
395407

396408
}
397409

0 commit comments

Comments
 (0)