Replace 'path' with 'fsPath' in registerAddContextCommand

- Update callback function to use 'fsPath' instead of 'path'.
- Modify sendFileSelectMessage call to pass 'uri.fsPath'.
This commit is contained in:
bobo.yang 2023-06-13 11:05:42 +08:00
parent 3fc21b920e
commit ae15158fe5

View File

@ -20,12 +20,12 @@ async function ensureChatPanel(context: vscode.ExtensionContext): Promise<boolea
}
function registerAddContextCommand(context: vscode.ExtensionContext) {
const callback = async (uri: { path: any; }) => {
const callback = async (uri: { fsPath: any; }) => {
if (!await ensureChatPanel(context)) {
return;
}
await sendFileSelectMessage(ExtensionContextHolder.provider?.view()!, uri.path);
await sendFileSelectMessage(ExtensionContextHolder.provider?.view()!, uri.fsPath);
};
context.subscriptions.push(vscode.commands.registerCommand('devchat.addConext', callback));
context.subscriptions.push(vscode.commands.registerCommand('devchat.addConext_chinese', callback));