summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-08-19 01:00:24 -0700
committerNate Sesti <sestinj@gmail.com>2023-08-19 01:00:24 -0700
commit17806d932502adbf974ccd93a670e57b78be9a08 (patch)
tree233c6cc182a1b1a496db1b491b79de6c2be6e684
parent70370bf0d033c2575c84ffe10c9e5c484bbad54f (diff)
downloadsncontinue-17806d932502adbf974ccd93a670e57b78be9a08.tar.gz
sncontinue-17806d932502adbf974ccd93a670e57b78be9a08.tar.bz2
sncontinue-17806d932502adbf974ccd93a670e57b78be9a08.zip
fix: :bug: make sure server_version.txt exists
-rw-r--r--continuedev/src/continuedev/libs/util/paths.py1
-rw-r--r--extension/react-app/src/components/Layout.tsx25
-rw-r--r--extension/react-app/src/pages/gui.tsx4
-rw-r--r--extension/src/activation/environmentSetup.ts15
-rw-r--r--extension/src/commands.ts7
5 files changed, 45 insertions, 7 deletions
diff --git a/continuedev/src/continuedev/libs/util/paths.py b/continuedev/src/continuedev/libs/util/paths.py
index 483f6b63..93ab16db 100644
--- a/continuedev/src/continuedev/libs/util/paths.py
+++ b/continuedev/src/continuedev/libs/util/paths.py
@@ -73,4 +73,5 @@ def getConfigFilePath() -> str:
def getLogFilePath():
path = os.path.join(getGlobalFolderPath(), "continue.log")
+ os.makedirs(os.path.dirname(path), exist_ok=True)
return path
diff --git a/extension/react-app/src/components/Layout.tsx b/extension/react-app/src/components/Layout.tsx
index 54a4517f..86192afb 100644
--- a/extension/react-app/src/components/Layout.tsx
+++ b/extension/react-app/src/components/Layout.tsx
@@ -17,6 +17,7 @@ import {
FolderIcon,
BookOpenIcon,
ChatBubbleOvalLeftEllipsisIcon,
+ SparklesIcon,
} from "@heroicons/react/24/outline";
import HeaderButtonWithText from "./HeaderButtonWithText";
import { useNavigate } from "react-router-dom";
@@ -138,6 +139,30 @@ const Layout = () => {
{bottomMessage}
</BottomMessageDiv>
<Footer>
+ <SparklesIcon
+ visibility={
+ localStorage.getItem("hideFeature") === "true"
+ ? "hidden"
+ : "visible"
+ }
+ className="mr-auto cursor-pointer"
+ onClick={() => {
+ localStorage.setItem("hideFeature", "true");
+ }}
+ onMouseEnter={() => {
+ dispatch(
+ setBottomMessage(
+ "🎁 New Feature: Use ⌘D automatically debug errors in the terminal"
+ )
+ );
+ }}
+ onMouseLeave={() => {
+ dispatch(setBottomMessage(undefined));
+ }}
+ width="1.3em"
+ height="1.3em"
+ color="yellow"
+ />
<HeaderButtonWithText
onClick={() => {
client?.loadSession(undefined);
diff --git a/extension/react-app/src/pages/gui.tsx b/extension/react-app/src/pages/gui.tsx
index 39a3f13a..86cb4b9a 100644
--- a/extension/react-app/src/pages/gui.tsx
+++ b/extension/react-app/src/pages/gui.tsx
@@ -405,8 +405,8 @@ function GUI(props: GUIProps) {
<div className="w-3/4 m-auto text-center text-xs">
{/* Tip: Drag the Continue logo from the far left of the window to the
right, then toggle Continue using option/alt+command+m. */}
- Tip: If there is an error in the terminal, use COMMAND+D to
- automatically debug
+ {/* Tip: If there is an error in the terminal, use COMMAND+D to
+ automatically debug */}
</div>
</>
)}
diff --git a/extension/src/activation/environmentSetup.ts b/extension/src/activation/environmentSetup.ts
index 36fa245f..fe0c8c0b 100644
--- a/extension/src/activation/environmentSetup.ts
+++ b/extension/src/activation/environmentSetup.ts
@@ -180,11 +180,16 @@ export async function startContinuePythonServer(redownload: boolean = true) {
let shouldDownload = true;
if (fs.existsSync(destination) && redownload) {
// Check if the server is the correct version
- const serverVersion = fs.readFileSync(serverVersionPath(), "utf8");
- if (serverVersion === getExtensionVersion()) {
- // The current version is already up and running, no need to continue
- console.log("Continue server already downloaded");
- shouldDownload = false;
+ if (fs.existsSync(serverVersionPath())) {
+ const serverVersion = fs.readFileSync(serverVersionPath(), "utf8");
+ if (serverVersion === getExtensionVersion()) {
+ // The current version is already up and running, no need to continue
+ console.log("Continue server already downloaded");
+ shouldDownload = false;
+ } else {
+ console.log("Old version of the server downloaded");
+ fs.unlinkSync(destination);
+ }
} else {
console.log("Old version of the server downloaded");
fs.unlinkSync(destination);
diff --git a/extension/src/commands.ts b/extension/src/commands.ts
index 4761826e..5a880690 100644
--- a/extension/src/commands.ts
+++ b/extension/src/commands.ts
@@ -1,6 +1,7 @@
import * as vscode from "vscode";
import * as path from "path";
import * as os from "os";
+import * as fs from "fs";
import { acceptDiffCommand, rejectDiffCommand } from "./diffs";
import { debugPanelWebview } from "./debugPanel";
@@ -60,6 +61,12 @@ const commandsMap: { [command: string]: (...args: any) => any } = {
"continue.viewLogs": async () => {
// Open ~/.continue/continue.log
const logFile = path.join(os.homedir(), ".continue", "continue.log");
+ // Make sure the file/directory exist
+ if (!fs.existsSync(logFile)) {
+ fs.mkdirSync(path.dirname(logFile), { recursive: true });
+ fs.writeFileSync(logFile, "");
+ }
+
const uri = vscode.Uri.file(logFile);
await vscode.window.showTextDocument(uri);
},