🐛 fix logging bug

This commit is contained in:
Nate Sesti 2023-12-12 14:30:52 -08:00
parent b0dfb057ef
commit 94d93c985a
6 changed files with 17 additions and 25 deletions

View file

@ -12,7 +12,6 @@
"@electron/rebuild": "^3.2.10",
"@reduxjs/toolkit": "^1.9.3",
"axios": "^1.2.5",
"cargo-cp-artifact": "^0.1",
"core": "file:../../core",
"cors": "^2.8.5",
"downshift": "^7.6.0",
@ -75,7 +74,6 @@
"hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {
"cargo-cp-artifact": "^0.1",
"dotenv": "^16.3.1",
"handlebars": "^4.7.8",
"js-tiktoken": "^1.0.8",
@ -2473,14 +2471,6 @@
"node": ">= 6"
}
},
"node_modules/cargo-cp-artifact": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/cargo-cp-artifact/-/cargo-cp-artifact-0.1.8.tgz",
"integrity": "sha512-3j4DaoTrsCD1MRkTF2Soacii0Nx7UHCce0EwUf4fHnggwiE4fbmF2AbnfzayR36DF8KGadfh7M/Yfy625kgPlA==",
"bin": {
"cargo-cp-artifact": "bin/cargo-cp-artifact.js"
}
},
"node_modules/caseless": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
@ -11475,11 +11465,6 @@
"resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz",
"integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA=="
},
"cargo-cp-artifact": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/cargo-cp-artifact/-/cargo-cp-artifact-0.1.8.tgz",
"integrity": "sha512-3j4DaoTrsCD1MRkTF2Soacii0Nx7UHCce0EwUf4fHnggwiE4fbmF2AbnfzayR36DF8KGadfh7M/Yfy625kgPlA=="
},
"caseless": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",

View file

@ -1,4 +1,6 @@
import { FileEdit, RangeInFile } from "core/types";
import { getConfigJsonPath } from "core/util/paths";
import { readFileSync } from "fs";
import * as vscode from "vscode";
import { windowId } from "./activation/activate";
import { debugPanelWebview, getSidebarContent } from "./debugPanel";
@ -39,9 +41,15 @@ class IdeProtocolClient {
// Listen for file saving
vscode.workspace.onDidSaveTextDocument((event) => {
const filepath = event.uri.fsPath;
const contents = event.getText();
const config = JSON.parse(contents);
this.configUpdate(config);
if (
filepath.endsWith(".continue/config.json") ||
filepath.endsWith(".continue\\config.json")
) {
const config = readFileSync(getConfigJsonPath(), "utf8");
const configJson = JSON.parse(config);
this.configUpdate(configJson);
}
});
// Register a content provider for the readonly virtual documents

View file

@ -1146,11 +1146,6 @@ camelcase@^6.0.0:
resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz"
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
cargo-cp-artifact@^0.1:
version "0.1.8"
resolved "https://registry.npmjs.org/cargo-cp-artifact/-/cargo-cp-artifact-0.1.8.tgz"
integrity sha512-3j4DaoTrsCD1MRkTF2Soacii0Nx7UHCce0EwUf4fHnggwiE4fbmF2AbnfzayR36DF8KGadfh7M/Yfy625kgPlA==
caseless@~0.12.0:
version "0.12.0"
resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz"

1
gui/package-lock.json generated
View file

@ -60,7 +60,6 @@
"hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {
"cargo-cp-artifact": "^0.1",
"dotenv": "^16.3.1",
"handlebars": "^4.7.8",
"js-tiktoken": "^1.0.8",

View file

@ -156,6 +156,7 @@ function useChatHandler(dispatch: Dispatch) {
dispatch(setInactive());
} catch (e) {
console.log("Continue: error streaming response: ", e);
errorPopup(e.message);
}
}

View file

@ -109,7 +109,11 @@ export const stateSlice = createSlice({
};
},
addLogs: (state, { payload }: { payload: [string, string][] }) => {
state.history[state.history.length - 1].promptLogs.push(...payload);
if (state.history[state.history.length - 1].promptLogs) {
state.history[state.history.length - 1].promptLogs.push(...payload);
} else {
state.history[state.history.length - 1].promptLogs = payload;
}
},
addContextItemsAtIndex: (state, action) => {
if (action.payload.index < state.history.length) {