summaryrefslogtreecommitdiff
path: root/extension
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-07-25 22:26:09 -0700
committerNate Sesti <sestinj@gmail.com>2023-07-25 22:26:09 -0700
commit861a873f7ecf455b9c7833040b2a8163e369e062 (patch)
tree311d384ed52cb04822b59cf7f6c416e191d80f44 /extension
parentf0df0fdc1fb7d8e65e27abe633da1831b8172b35 (diff)
downloadsncontinue-861a873f7ecf455b9c7833040b2a8163e369e062.tar.gz
sncontinue-861a873f7ecf455b9c7833040b2a8163e369e062.tar.bz2
sncontinue-861a873f7ecf455b9c7833040b2a8163e369e062.zip
checkpoint. Somewhat working, just a bit slow, probably some blocking meilisearch calls still happening
Diffstat (limited to 'extension')
-rw-r--r--extension/react-app/src/main.tsx7
-rw-r--r--extension/src/activation/activate.ts3
-rw-r--r--extension/src/continueIdeClient.ts3
-rw-r--r--extension/src/debugPanel.ts2
-rw-r--r--extension/src/util/messenger.ts9
5 files changed, 15 insertions, 9 deletions
diff --git a/extension/react-app/src/main.tsx b/extension/react-app/src/main.tsx
index a76bced6..1776490c 100644
--- a/extension/react-app/src/main.tsx
+++ b/extension/react-app/src/main.tsx
@@ -8,12 +8,11 @@ import "./index.css";
import posthog from "posthog-js";
import { PostHogProvider } from "posthog-js/react";
+console.log("Starting React");
+
posthog.init("phc_JS6XFROuNbhJtVCEdTSYk6gl5ArRrTNMpCcguAXlSPs", {
api_host: "https://app.posthog.com",
- session_recording: {
- // WARNING: Only enable this if you understand the security implications
- recordCrossOriginIframes: true,
- } as any,
+ disable_session_recording: true,
});
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
diff --git a/extension/src/activation/activate.ts b/extension/src/activation/activate.ts
index a1d88a31..356d0256 100644
--- a/extension/src/activation/activate.ts
+++ b/extension/src/activation/activate.ts
@@ -17,7 +17,7 @@ export let ideProtocolClient: IdeProtocolClient;
export async function activateExtension(context: vscode.ExtensionContext) {
extensionContext = context;
-
+ console.log("Using Continue version: ", getExtensionVersion());
// 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)
@@ -67,6 +67,7 @@ export async function activateExtension(context: vscode.ExtensionContext) {
}, 2000);
});
+ console.log("Continue server started");
// Initialize IDE Protocol Client
const serverUrl = getContinueServerUrl();
ideProtocolClient = new IdeProtocolClient(
diff --git a/extension/src/continueIdeClient.ts b/extension/src/continueIdeClient.ts
index 802afc1d..d92a829d 100644
--- a/extension/src/continueIdeClient.ts
+++ b/extension/src/continueIdeClient.ts
@@ -399,8 +399,9 @@ class IdeProtocolClient {
}
}, 1000);
});
+ console.log("Getting session ID");
const resp = await this.messenger?.sendAndReceive("getSessionId", {});
- // console.log("New Continue session with ID: ", sessionId);
+ console.log("New Continue session with ID: ", resp.sessionId);
this._sessionId = resp.sessionId;
return resp.sessionId;
}
diff --git a/extension/src/debugPanel.ts b/extension/src/debugPanel.ts
index 6da79cdc..6dcb588a 100644
--- a/extension/src/debugPanel.ts
+++ b/extension/src/debugPanel.ts
@@ -166,11 +166,13 @@ export function setupDebugPanel(
switch (data.type) {
case "onLoad": {
let sessionId: string;
+ console.log("Running onLoad");
if (typeof sessionIdPromise === "string") {
sessionId = sessionIdPromise;
} else {
sessionId = await sessionIdPromise;
}
+ console.log("Done with onLoad: ", sessionId);
panel.webview.postMessage({
type: "onLoad",
vscMachineId: vscode.env.machineId,
diff --git a/extension/src/util/messenger.ts b/extension/src/util/messenger.ts
index 3044898e..e28040f5 100644
--- a/extension/src/util/messenger.ts
+++ b/extension/src/util/messenger.ts
@@ -39,6 +39,7 @@ export class WebsocketMessenger extends Messenger {
// var WebSocket = require("ws");
// }
+ console.log("Creating websocket at: ", this.serverUrl);
const newWebsocket = new WebSocket(this.serverUrl);
for (const listener of this.onOpenListeners) {
this.onOpen(listener);
@@ -105,12 +106,14 @@ export class WebsocketMessenger extends Messenger {
send(messageType: string, data: object) {
const payload = JSON.stringify({ messageType, data });
if (this.websocket.readyState === this.websocket.OPEN) {
+ console.log("websocket is open, sending message: ", messageType);
this.websocket.send(payload);
} else {
- if (this.websocket.readyState !== this.websocket.CONNECTING) {
- this.websocket = this._newWebsocket();
- }
+ console.log("websocket is not open, creating new websocket", messageType);
+ this.websocket = this._newWebsocket();
+
this.websocket.addEventListener("open", () => {
+ console.log("websocket is open, resending message: ", messageType);
this.websocket.send(payload);
});
}