Skip to content

Commit

Permalink
add snippet to textarea
Browse files Browse the repository at this point in the history
  • Loading branch information
oxyplay committed Oct 10, 2024
1 parent 5405bc8 commit 7c585a1
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/codeLens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import * as fetchH2 from 'fetch-h2';
import * as fetchAPI from "./fetchAPI";
import {
type ChatMessages,
type ChatMessage
type ChatMessage,
setInputValue,

Check failure on line 9 in src/codeLens.ts

View workflow job for this annotation

GitHub Actions / dist (x86_64-unknown-linux-gnu)

Module '"refact-chat-js/dist/events"' has no exported member 'setInputValue'.
} from "refact-chat-js/dist/events";


Expand Down Expand Up @@ -97,18 +98,10 @@ export async function code_lens_execute(code_lens: string, range: any) {
const block_range = new vscode.Range(start_of_line, end_of_line);
let text = vscode.window.activeTextEditor!.document.getText(block_range);
if(!auto_submit) {
// const query_text = `\`\`\`\n ${text}\n\`\`\`\n`;
// const questionData = {
// id: '',
// model: "",
// title: "",
// messages: [
// {role: "user", content: query_text}
// ] as ChatMessages,
// attach_file: false,
// tools: [],
// };
// global.side_panel?.goto_chat(questionData);
if (global && global.side_panel && global.side_panel._view) {
const message = setInputValue(text);
global.side_panel._view.webview.postMessage(message);
}
vscode.commands.executeCommand('refactaicmd.callChat', '');
} else {
let messages_data: ChatMessages = [];
Expand Down

0 comments on commit 7c585a1

Please sign in to comment.