diff options
author | Nate Sesti <33237525+sestinj@users.noreply.github.com> | 2023-07-11 15:14:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-11 15:14:53 -0700 |
commit | 9adfb8bf5b9f44be82488e37bc32cbd9a8817b53 (patch) | |
tree | 8399d02483267ec024034a923475bd6eaf397154 /extension/src/activation/activate.ts | |
parent | 3f9e7a1fa59c4f684aef544436062f8825d77b31 (diff) | |
parent | 9846f4769ff33a346d76e26ad730d19770fe7e02 (diff) | |
download | sncontinue-9adfb8bf5b9f44be82488e37bc32cbd9a8817b53.tar.gz sncontinue-9adfb8bf5b9f44be82488e37bc32cbd9a8817b53.tar.bz2 sncontinue-9adfb8bf5b9f44be82488e37bc32cbd9a8817b53.zip |
Merge pull request #237 from continuedev/bug-squashing
Bug squashing
Diffstat (limited to 'extension/src/activation/activate.ts')
-rw-r--r-- | extension/src/activation/activate.ts | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/extension/src/activation/activate.ts b/extension/src/activation/activate.ts index 18650561..2c5ba58c 100644 --- a/extension/src/activation/activate.ts +++ b/extension/src/activation/activate.ts @@ -7,9 +7,16 @@ import IdeProtocolClient from "../continueIdeClient"; import { getContinueServerUrl } from "../bridge"; import { CapturedTerminal } from "../terminal/terminalEmulator"; import { setupDebugPanel, ContinueGUIWebviewViewProvider } from "../debugPanel"; -import { startContinuePythonServer } from "./environmentSetup"; +import { + getExtensionVersion, + startContinuePythonServer, +} from "./environmentSetup"; +import fetch from "node-fetch"; // import { CapturedTerminal } from "../terminal/terminalEmulator"; +const PACKAGE_JSON_RAW_GITHUB_URL = + "https://raw.githubusercontent.com/continuedev/continue/main/extension/package.json"; + export let extensionContext: vscode.ExtensionContext | undefined = undefined; export let ideProtocolClient: IdeProtocolClient; @@ -20,6 +27,19 @@ export async function activateExtension( ) { extensionContext = context; + // Before anything else, check whether this is an out-of-date version of the extension + // Do so by grabbing the package.json off of the GitHub respository for now. + fetch(PACKAGE_JSON_RAW_GITHUB_URL) + .then(async (res) => res.json()) + .then((packageJson) => { + if (packageJson.version !== getExtensionVersion()) { + vscode.window.showInformationMessage( + `You are using an out-of-date version of the Continue extension. Please update to the latest version.` + ); + } + }) + .catch((e) => console.log("Error checking for extension updates: ", e)); + await new Promise((resolve, reject) => { vscode.window.withProgress( { |