feat: submit file changes to the llm (#11)

This commit is contained in:
Dominic Elm
2024-07-25 17:28:23 +02:00
committed by GitHub
parent a5ed695cb3
commit 2cb3f09947
18 changed files with 415 additions and 57 deletions

View File

@@ -10,7 +10,7 @@ export class EditorStore {
#filesStore: FilesStore;
selectedFile: SelectedFile = import.meta.hot?.data.selectedFile ?? atom<string | undefined>();
documents: MapStore<EditorDocuments> = import.meta.hot?.data.documents ?? map<EditorDocuments>({});
documents: MapStore<EditorDocuments> = import.meta.hot?.data.documents ?? map({});
currentDocument = computed([this.documents, this.selectedFile], (documents, selectedFile) => {
if (!selectedFile) {
@@ -74,7 +74,7 @@ export class EditorStore {
});
}
updateFile(filePath: string, newContent: string | Uint8Array) {
updateFile(filePath: string, newContent: string) {
const documents = this.documents.get();
const documentState = documents[filePath];