Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chat features #173

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
ideChatPageChange,
ideEscapeKeyPressed,
ideIsChatStreaming,
setCurrentProjectInfo

Check failure on line 37 in src/sidebar.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 'setCurrentProjectInfo'.

Check failure on line 37 in src/sidebar.ts

View workflow job for this annotation

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

Module '"refact-chat-js/dist/events"' has no exported member 'setCurrentProjectInfo'.
} from "refact-chat-js/dist/events";
import { basename, join } from "path";
import { diff_paste_back } from "./chatTab";
Expand Down Expand Up @@ -119,6 +120,10 @@
}
}));

this._disposables.push(vscode.workspace.onDidChangeWorkspaceFolders((event) => {
this.sendCurrentProjectInfo();
}));


// this._disposables.push(vscode.workspace.onDidOpenTextDocument((event) => {
// console.log("onDidOpenTextDocument");
Expand Down Expand Up @@ -848,6 +853,11 @@
}
}

sendCurrentProjectInfo() {
const action = setCurrentProjectInfo({name: vscode.workspace.name ?? ""});
this._view?.webview.postMessage(action);
}


async createInitialState(thread?: ChatThread, tabbed = false): Promise<Partial<InitialState>> {
const fontSize = vscode.workspace.getConfiguration().get<number>("editor.fontSize") ?? 12;
Expand All @@ -874,6 +884,9 @@
features: {
vecdb,
ast,
images: true,
statistics: true,
knowledge: false,

Check failure on line 889 in src/sidebar.ts

View workflow job for this annotation

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

Type '{ vecdb: boolean; ast: boolean; images: true; statistics: true; knowledge: false; }' is not assignable to type '{ statistics?: boolean | undefined; vecdb?: boolean | undefined; ast?: boolean | undefined; images?: boolean | undefined; }'.

Check failure on line 889 in src/sidebar.ts

View workflow job for this annotation

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

Type '{ vecdb: boolean; ast: boolean; images: true; statistics: true; knowledge: false; }' is not assignable to type '{ statistics?: boolean | undefined; vecdb?: boolean | undefined; ast?: boolean | undefined; images?: boolean | undefined; }'.
},
keyBindings: {
completeManual,
Expand All @@ -884,6 +897,7 @@
};

const state: Partial<InitialState> = {
current_project: {name: vscode.workspace.name ?? ""},

Check failure on line 900 in src/sidebar.ts

View workflow job for this annotation

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

Type '{ current_project: { name: string; }; config: Config; }' is not assignable to type 'Partial<InitialState>'.

Check failure on line 900 in src/sidebar.ts

View workflow job for this annotation

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

Type '{ current_project: { name: string; }; config: Config; }' is not assignable to type 'Partial<InitialState>'.
config,
};

Expand Down
Loading