DeepCodeGeniusWeb-vscode/src/handler/addRefCommandContext.ts
2023-05-08 12:48:59 +08:00

11 lines
488 B
TypeScript

import * as vscode from 'vscode';
import { handleRefCommand } from '../context/contextRef';
// message: { command: 'addRefCommandContext', refCommand: string }
// User input: /ref ls . then "ls ." will be passed to refCommand
export async function addRefCommandContext(message: any, panel: vscode.WebviewPanel): Promise<void> {
const contextStr = await handleRefCommand(message.refCommand);
panel.webview.postMessage({ command: 'appendContext', context: contextStr });
return;
}