summaryrefslogtreecommitdiff
path: root/extension
diff options
context:
space:
mode:
Diffstat (limited to 'extension')
-rw-r--r--extension/react-app/src/pages/gui.tsx3
-rw-r--r--extension/scripts/install_from_source.py37
-rw-r--r--extension/src/continueIdeClient.ts9
3 files changed, 32 insertions, 17 deletions
diff --git a/extension/react-app/src/pages/gui.tsx b/extension/react-app/src/pages/gui.tsx
index 9bb558c7..72b2e139 100644
--- a/extension/react-app/src/pages/gui.tsx
+++ b/extension/react-app/src/pages/gui.tsx
@@ -313,6 +313,9 @@ function GUI(props: GUIProps) {
<>
<Loader />
<p style={{ textAlign: "center" }}>Loading Continue server...</p>
+ {/* <p style={{ textAlign: "center" }}>
+ Make sure you have a folder opened in VS Code
+ </p> */}
</>
)}
{history?.timeline.map((node: HistoryNode, index: number) => {
diff --git a/extension/scripts/install_from_source.py b/extension/scripts/install_from_source.py
index bbb86797..d004259b 100644
--- a/extension/scripts/install_from_source.py
+++ b/extension/scripts/install_from_source.py
@@ -6,7 +6,28 @@ def run(cmd: str):
return subprocess.run(cmd, shell=True, capture_output=False)
+def get_latest_version() -> str:
+ latest = None
+ latest_major = 0
+ latest_minor = 0
+ latest_patch = 0
+ for file in os.listdir("../build"):
+ if file.endswith(".vsix"):
+ version = file.split("-")[1].split(".vsix")[0]
+ major, minor, patch = list(
+ map(lambda x: int(x), version.split(".")))
+ if latest is None or (major >= latest_major and minor >= latest_minor and patch > latest_patch):
+ latest = file
+ latest_major = major
+ latest_minor = minor
+ latest_patch = patch
+
+
def main():
+ # Clear out old stuff
+ run(f"rm -rf ../build/{get_latest_version()}")
+ run("rm ../server/continuedev-0.1.2-py3-none-any.whl")
+
# Check for Python and Node - we won't install them, but will warn
resp1 = run("python --version")
resp2 = run("python3 --version")
@@ -39,21 +60,7 @@ def main():
print("This was the error: ", resp.stderr)
return
- latest = None
- latest_major = 0
- latest_minor = 0
- latest_patch = 0
- for file in os.listdir("../build"):
- if file.endswith(".vsix"):
- version = file.split("-")[1].split(".vsix")[0]
- major, minor, patch = list(
- map(lambda x: int(x), version.split(".")))
- if latest is None or (major >= latest_major and minor >= latest_minor and patch > latest_patch):
- latest = file
- latest_major = major
- latest_minor = minor
- latest_patch = patch
-
+ latest = get_latest_version()
resp = run(f"cd ..; code --install-extension ./build/{latest}")
print("Continue VS Code extension installed successfully. Please restart VS Code to use it.")
diff --git a/extension/src/continueIdeClient.ts b/extension/src/continueIdeClient.ts
index d92a829d..4e6f0494 100644
--- a/extension/src/continueIdeClient.ts
+++ b/extension/src/continueIdeClient.ts
@@ -19,6 +19,7 @@ import path = require("path");
import { registerAllCodeLensProviders } from "./lang-server/codeLens";
import { registerAllCommands } from "./commands";
import registerQuickFixProvider from "./lang-server/codeActions";
+const os = require("os");
const continueVirtualDocumentScheme = "continue";
@@ -70,7 +71,11 @@ class IdeProtocolClient {
reconnect();
});
messenger.onMessage((messageType, data, messenger) => {
- this.handleMessage(messageType, data, messenger);
+ this.handleMessage(messageType, data, messenger).catch((err) => {
+ vscode.window.showErrorMessage(
+ "Error handling message from Continue server: " + err.message
+ );
+ });
});
}
@@ -267,7 +272,7 @@ class IdeProtocolClient {
getWorkspaceDirectory() {
if (!vscode.workspace.workspaceFolders) {
// Return the home directory
- return process.env.HOME || process.env.USERPROFILE || "/";
+ return os.homedir();
}
return vscode.workspace.workspaceFolders[0].uri.fsPath;
}