From 699a74250fd4cf91af930ff63077aeb81f74856f Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Thu, 13 Jul 2023 09:55:09 -0700 Subject: show react immediately --- extension/src/activation/activate.ts | 72 ++++++++++++++++++------------------ extension/src/bridge.ts | 6 +-- 2 files changed, 38 insertions(+), 40 deletions(-) (limited to 'extension/src') diff --git a/extension/src/activation/activate.ts b/extension/src/activation/activate.ts index cd885b12..b03282e5 100644 --- a/extension/src/activation/activate.ts +++ b/extension/src/activation/activate.ts @@ -35,46 +35,48 @@ export async function activateExtension(context: vscode.ExtensionContext) { }) .catch((e) => console.log("Error checking for extension updates: ", e)); - // Start the Python server - await new Promise((resolve, reject) => { - vscode.window.withProgress( + const sessionIdPromise = (async () => { + // Start the Python server + await new Promise((resolve, reject) => { + vscode.window.withProgress( + { + location: vscode.ProgressLocation.Notification, + title: + "Starting Continue Server... (it may take a minute to download Python packages)", + cancellable: false, + }, + async (progress, token) => { + await startContinuePythonServer(); + resolve(null); + } + ); + }); + + // Initialize IDE Protocol Client + const serverUrl = getContinueServerUrl(); + ideProtocolClient = new IdeProtocolClient( + `${serverUrl.replace("http", "ws")}/ide/ws`, + context + ); + + return ideProtocolClient.getSessionId(); + })(); + + // Register the webview + const provider = new ContinueGUIWebviewViewProvider(sessionIdPromise); + + context.subscriptions.push( + vscode.window.registerWebviewViewProvider( + "continue.continueGUIView", + provider, { - location: vscode.ProgressLocation.Notification, - title: - "Starting Continue Server... (it may take a minute to download Python packages)", - cancellable: false, - }, - async (progress, token) => { - await startContinuePythonServer(); - resolve(null); + webviewOptions: { retainContextWhenHidden: true }, } - ); - }); + ) + ); // Register commands and providers sendTelemetryEvent(TelemetryEvent.ExtensionActivated); registerAllCodeLensProviders(context); registerAllCommands(context); - - // Initialize IDE Protocol Client - const serverUrl = getContinueServerUrl(); - ideProtocolClient = new IdeProtocolClient( - `${serverUrl.replace("http", "ws")}/ide/ws`, - context - ); - - { - const sessionIdPromise = await ideProtocolClient.getSessionId(); - const provider = new ContinueGUIWebviewViewProvider(sessionIdPromise); - - context.subscriptions.push( - vscode.window.registerWebviewViewProvider( - "continue.continueGUIView", - provider, - { - webviewOptions: { retainContextWhenHidden: true }, - } - ) - ); - } } diff --git a/extension/src/bridge.ts b/extension/src/bridge.ts index 7e6398be..d614ace4 100644 --- a/extension/src/bridge.ts +++ b/extension/src/bridge.ts @@ -1,11 +1,7 @@ import fetch from "node-fetch"; import * as path from "path"; import * as vscode from "vscode"; -import { - Configuration, - DebugApi, - UnittestApi, -} from "./client"; +import { Configuration, DebugApi, UnittestApi } from "./client"; import { convertSingleToDoubleQuoteJSON } from "./util/util"; import { getExtensionUri } from "./util/vscode"; import { extensionContext } from "./activation/activate"; -- cgit v1.2.3-70-g09d2 From 2f777ea933d4a41b600feedeff7d85257c5b136d Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 19 Jul 2023 18:45:46 -0700 Subject: transparent bg fix --- extension/package-lock.json | 4 ++-- extension/package.json | 2 +- extension/react-app/src/components/ComboBox.tsx | 3 +-- extension/react-app/src/components/PillButton.tsx | 2 ++ extension/src/commands.ts | 3 +++ 5 files changed, 9 insertions(+), 5 deletions(-) (limited to 'extension/src') diff --git a/extension/package-lock.json b/extension/package-lock.json index bc2824c4..3f9ff3aa 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.0.182", + "version": "0.0.184", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "continue", - "version": "0.0.182", + "version": "0.0.184", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", diff --git a/extension/package.json b/extension/package.json index 2998b148..72afa46f 100644 --- a/extension/package.json +++ b/extension/package.json @@ -14,7 +14,7 @@ "displayName": "Continue", "pricing": "Free", "description": "The open-source coding autopilot", - "version": "0.0.182", + "version": "0.0.184", "publisher": "Continue", "engines": { "vscode": "^1.67.0" diff --git a/extension/react-app/src/components/ComboBox.tsx b/extension/react-app/src/components/ComboBox.tsx index f327e3a3..1e2ca135 100644 --- a/extension/react-app/src/components/ComboBox.tsx +++ b/extension/react-app/src/components/ComboBox.tsx @@ -71,7 +71,6 @@ const Ul = styled.ul<{ : `transform: translateY(${2 * mainInputFontSize}px);`} position: absolute; background: ${vscBackground}; - background-color: ${secondaryDark}; color: ${vscForeground}; max-height: ${UlMaxHeight}px; width: calc(100% - 16px); @@ -96,7 +95,7 @@ const Li = styled.li<{ selected: boolean; isLastItem: boolean; }>` - background-color: ${secondaryDark}; + background-color: ${vscBackground}; ${({ highlighted }) => highlighted && "background: #ff000066;"} ${({ selected }) => selected && "font-weight: bold;"} padding: 0.5rem 0.75rem; diff --git a/extension/react-app/src/components/PillButton.tsx b/extension/react-app/src/components/PillButton.tsx index c24dba83..5929d06a 100644 --- a/extension/react-app/src/components/PillButton.tsx +++ b/extension/react-app/src/components/PillButton.tsx @@ -4,6 +4,7 @@ import { StyledTooltip, defaultBorderRadius, secondaryDark, + vscBackground, vscForeground, } from "."; import { @@ -113,6 +114,7 @@ const PillButton = (props: PillButtonProps) => { {props.onlyShowDelete || ( diff --git a/extension/src/commands.ts b/extension/src/commands.ts index 2b7f4c0c..1da2f04e 100644 --- a/extension/src/commands.ts +++ b/extension/src/commands.ts @@ -40,6 +40,9 @@ const commandsMap: { [command: string]: (...args: any) => any } = { edit ? "/edit " : "" }${code}\n\nHow do I fix this problem in the above code?: ${message}` ); + if (!edit) { + vscode.commands.executeCommand("continue.continueGUIView.focus"); + } }, "continue.focusContinueInput": async () => { if (focusedOnContinueInput) { -- cgit v1.2.3-70-g09d2 From 607ace7321d1ccf41292665ed625b44c222ec74b Mon Sep 17 00:00:00 2001 From: Ty Dunn Date: Fri, 21 Jul 2023 16:27:25 -0500 Subject: python3 --> python --- extension/src/activation/environmentSetup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'extension/src') diff --git a/extension/src/activation/environmentSetup.ts b/extension/src/activation/environmentSetup.ts index c341db39..94481430 100644 --- a/extension/src/activation/environmentSetup.ts +++ b/extension/src/activation/environmentSetup.ts @@ -139,7 +139,7 @@ export async function getPythonPipCommands() { if (!versionExists) { vscode.window.showErrorMessage( - "Continue requires Python3 version 3.8 or greater. Please update your Python3 installation, reload VS Code, and try again." + "Continue requires Python version 3.8 or greater. Please update your Python installation, reload VS Code, and try again." ); throw new Error("Python3.8 or greater is not installed."); } -- cgit v1.2.3-70-g09d2 From b97ceee5cad5f3a645f067353aa33c17dfcf0a60 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Fri, 21 Jul 2023 16:43:17 -0700 Subject: notify to reload window after changing settings --- extension/package-lock.json | 4 ++-- extension/package.json | 2 +- extension/src/continueIdeClient.ts | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) (limited to 'extension/src') diff --git a/extension/package-lock.json b/extension/package-lock.json index d44b84c4..5c8e27d0 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.0.187", + "version": "0.0.188", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "continue", - "version": "0.0.187", + "version": "0.0.188", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", diff --git a/extension/package.json b/extension/package.json index 34bc8bc4..3d44c156 100644 --- a/extension/package.json +++ b/extension/package.json @@ -14,7 +14,7 @@ "displayName": "Continue", "pricing": "Free", "description": "The open-source coding autopilot", - "version": "0.0.187", + "version": "0.0.188", "publisher": "Continue", "engines": { "vscode": "^1.67.0" diff --git a/extension/src/continueIdeClient.ts b/extension/src/continueIdeClient.ts index a1370a01..3a42e773 100644 --- a/extension/src/continueIdeClient.ts +++ b/extension/src/continueIdeClient.ts @@ -167,6 +167,20 @@ class IdeProtocolClient { documentContentProvider ) ); + + // Listen for changes to settings.json + vscode.workspace.onDidChangeConfiguration((event) => { + if (event.affectsConfiguration("continue")) { + vscode.window.showInformationMessage( + "Please reload VS Code for changes to Continue settings to take effect.", + "Reload" + ).then((selection) => { + if (selection === "Reload") { + vscode.commands.executeCommand("workbench.action.reloadWindow"); + } + }); + } + }); } async handleMessage( -- cgit v1.2.3-70-g09d2 From 64a36f5c91f13d0098a9651d39a90a17b4aad1fd Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Fri, 21 Jul 2023 19:55:08 -0700 Subject: remove Segment telemetry from React --- extension/src/activation/activate.ts | 1 - extension/src/activation/environmentSetup.ts | 17 +-------- extension/src/continueIdeClient.ts | 20 +++++------ extension/src/suggestions.ts | 3 -- extension/src/telemetry.ts | 53 ---------------------------- 5 files changed, 11 insertions(+), 83 deletions(-) delete mode 100644 extension/src/telemetry.ts (limited to 'extension/src') diff --git a/extension/src/activation/activate.ts b/extension/src/activation/activate.ts index a7f6c55b..65f026d8 100644 --- a/extension/src/activation/activate.ts +++ b/extension/src/activation/activate.ts @@ -1,7 +1,6 @@ import * as vscode from "vscode"; import { registerAllCommands } from "../commands"; import { registerAllCodeLensProviders } from "../lang-server/codeLens"; -import { sendTelemetryEvent, TelemetryEvent } from "../telemetry"; import IdeProtocolClient from "../continueIdeClient"; import { getContinueServerUrl } from "../bridge"; import { ContinueGUIWebviewViewProvider } from "../debugPanel"; diff --git a/extension/src/activation/environmentSetup.ts b/extension/src/activation/environmentSetup.ts index 94481430..5a9345a6 100644 --- a/extension/src/activation/environmentSetup.ts +++ b/extension/src/activation/environmentSetup.ts @@ -9,7 +9,6 @@ import fetch from "node-fetch"; import * as vscode from "vscode"; import * as os from "os"; import fkill from "fkill"; -import { sendTelemetryEvent, TelemetryEvent } from "../telemetry"; const WINDOWS_REMOTE_SIGNED_SCRIPTS_ERROR = "A Python virtual enviroment cannot be activated because running scripts is disabled for this user. In order to use Continue, please enable signed scripts to run with this command in PowerShell: `Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser`, reload VS Code, and then try again."; @@ -57,9 +56,6 @@ async function retryThenFail( vscode.window.showErrorMessage(msg); } - sendTelemetryEvent(TelemetryEvent.ExtensionSetupError, { - error: e.message, - }); throw e; } } @@ -83,12 +79,6 @@ async function runCommand(cmd: string): Promise<[string, string | undefined]> { stdout = ""; } - if (stderr) { - sendTelemetryEvent(TelemetryEvent.ExtensionSetupError, { - error: stderr, - }); - } - return [stdout, stderr]; } @@ -480,16 +470,11 @@ export async function startContinuePythonServer() { console.log("Successfully started Continue python server"); resolve(null); } else if (data.includes("ERROR") || data.includes("Traceback")) { - sendTelemetryEvent(TelemetryEvent.ExtensionSetupError, { - error: data, - }); + console.log("Error starting Continue python server: ", data); } }); child.on("error", (error: any) => { console.log(`error: ${error.message}`); - sendTelemetryEvent(TelemetryEvent.ExtensionSetupError, { - error: error.message, - }); }); // Write the current version of vscode to a file called server_version.txt diff --git a/extension/src/continueIdeClient.ts b/extension/src/continueIdeClient.ts index 3a42e773..802afc1d 100644 --- a/extension/src/continueIdeClient.ts +++ b/extension/src/continueIdeClient.ts @@ -16,7 +16,6 @@ import fs = require("fs"); import { WebsocketMessenger } from "./util/messenger"; import { diffManager } from "./diffs"; import path = require("path"); -import { sendTelemetryEvent, TelemetryEvent } from "./telemetry"; import { registerAllCodeLensProviders } from "./lang-server/codeLens"; import { registerAllCommands } from "./commands"; import registerQuickFixProvider from "./lang-server/codeActions"; @@ -81,7 +80,6 @@ class IdeProtocolClient { this._newWebsocketMessenger(); // Register commands and providers - sendTelemetryEvent(TelemetryEvent.ExtensionActivated); registerAllCodeLensProviders(context); registerAllCommands(context); registerQuickFixProvider(); @@ -171,14 +169,16 @@ class IdeProtocolClient { // Listen for changes to settings.json vscode.workspace.onDidChangeConfiguration((event) => { if (event.affectsConfiguration("continue")) { - vscode.window.showInformationMessage( - "Please reload VS Code for changes to Continue settings to take effect.", - "Reload" - ).then((selection) => { - if (selection === "Reload") { - vscode.commands.executeCommand("workbench.action.reloadWindow"); - } - }); + vscode.window + .showInformationMessage( + "Please reload VS Code for changes to Continue settings to take effect.", + "Reload" + ) + .then((selection) => { + if (selection === "Reload") { + vscode.commands.executeCommand("workbench.action.reloadWindow"); + } + }); } }); } diff --git a/extension/src/suggestions.ts b/extension/src/suggestions.ts index c2373223..5c2b8860 100644 --- a/extension/src/suggestions.ts +++ b/extension/src/suggestions.ts @@ -1,5 +1,4 @@ import * as vscode from "vscode"; -import { sendTelemetryEvent, TelemetryEvent } from "./telemetry"; import { openEditorAndRevealRange } from "./util/vscode"; import { translate } from "./util/vscode"; import { registerAllCodeLensProviders } from "./lang-server/codeLens"; @@ -244,7 +243,6 @@ function selectSuggestion( } export function acceptSuggestionCommand(key: SuggestionRanges | null = null) { - sendTelemetryEvent(TelemetryEvent.SuggestionAccepted); selectSuggestion("selected", key); } @@ -271,7 +269,6 @@ export function rejectAllSuggestionsCommand() { export async function rejectSuggestionCommand( key: SuggestionRanges | null = null ) { - sendTelemetryEvent(TelemetryEvent.SuggestionRejected); selectSuggestion("old", key); } diff --git a/extension/src/telemetry.ts b/extension/src/telemetry.ts deleted file mode 100644 index db5cb8ca..00000000 --- a/extension/src/telemetry.ts +++ /dev/null @@ -1,53 +0,0 @@ -import * as Segment from "@segment/analytics-node"; -import * as vscode from "vscode"; - -// Setup Segment -const SEGMENT_WRITE_KEY = "57yy2uYXH2bwMuy7djm9PorfFlYqbJL1"; -const analytics = new Segment.Analytics({ writeKey: SEGMENT_WRITE_KEY }); -analytics.identify({ - userId: vscode.env.machineId, - // traits: { - // name: "Michael Bolton", - // email: "mbolton@example.com", - // createdAt: new Date("2014-06-14T02:00:19.467Z"), - // }, -}); - -// Enum of telemetry events -export enum TelemetryEvent { - // Extension has been activated - ExtensionActivated = "ExtensionActivated", - // Suggestion has been accepted - SuggestionAccepted = "SuggestionAccepted", - // Suggestion has been rejected - SuggestionRejected = "SuggestionRejected", - // Queried universal prompt - UniversalPromptQuery = "UniversalPromptQuery", - // `Explain Code` button clicked - ExplainCode = "ExplainCode", - // `Generate Ideas` button clicked - GenerateIdeas = "GenerateIdeas", - // `Suggest Fix` button clicked - SuggestFix = "SuggestFix", - // `Create Test` button clicked - CreateTest = "CreateTest", - // `AutoDebug This Test` button clicked - AutoDebugThisTest = "AutoDebugThisTest", - // Command run to generate docstring - GenerateDocstring = "GenerateDocstring", - // Error setting up the extension - ExtensionSetupError = "ExtensionSetupError", -} - -export function sendTelemetryEvent( - event: TelemetryEvent, - properties?: Record -) { - if (!vscode.env.isTelemetryEnabled) return; - - analytics.track({ - event, - userId: vscode.env.machineId, - properties, - }); -} -- cgit v1.2.3-70-g09d2 From eb51662a0150f294c60b0fb38e057c9e8ffee2c9 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Sun, 23 Jul 2023 16:21:24 -0700 Subject: remove quick fix, it's unreliable rn --- extension/src/lang-server/codeActions.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'extension/src') diff --git a/extension/src/lang-server/codeActions.ts b/extension/src/lang-server/codeActions.ts index f0d61ace..892c69be 100644 --- a/extension/src/lang-server/codeActions.ts +++ b/extension/src/lang-server/codeActions.ts @@ -39,7 +39,10 @@ class ContinueQuickFixProvider implements vscode.CodeActionProvider { }; return quickFix; }; - return [createQuickFix(true), createQuickFix(false)]; + return [ + // createQuickFix(true), + createQuickFix(false), + ]; } } -- cgit v1.2.3-70-g09d2 From 9ed9c2dc9ee0a0ebbb79278109df6b2413688adf Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Mon, 24 Jul 2023 01:04:51 -0700 Subject: activation events * to load faster --- extension/package.json | 3 +-- extension/src/debugPanel.ts | 13 ------------- 2 files changed, 1 insertion(+), 15 deletions(-) (limited to 'extension/src') diff --git a/extension/package.json b/extension/package.json index 884b518c..4eca6e68 100644 --- a/extension/package.json +++ b/extension/package.json @@ -35,8 +35,7 @@ "chat" ], "activationEvents": [ - "onStartupFinished", - "onView:continueGUIView" + "*" ], "main": "./out/extension.js", "browser": "./out/extension.js", diff --git a/extension/src/debugPanel.ts b/extension/src/debugPanel.ts index dd24a8d8..f97cf846 100644 --- a/extension/src/debugPanel.ts +++ b/extension/src/debugPanel.ts @@ -181,19 +181,6 @@ export function setupDebugPanel( .getConfiguration("continue") .get("dataSwitch"), }); - - // // Listen for changes to server URL in settings - // vscode.workspace.onDidChangeConfiguration((event) => { - // if (event.affectsConfiguration("continue.serverUrl")) { - // debugPanelWebview?.postMessage({ - // type: "onLoad", - // vscMachineId: vscode.env.machineId, - // apiUrl: getContinueServerUrl(), - // sessionId, - // }); - // } - // }); - break; } case "toggleDataSwitch": { -- cgit v1.2.3-70-g09d2 From f3805d769c5c14bb8fbe2e33c7cdfe2a918cbd4a Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Mon, 24 Jul 2023 01:07:05 -0700 Subject: cleaning --- extension/src/activation/activate.ts | 5 ----- 1 file changed, 5 deletions(-) (limited to 'extension/src') diff --git a/extension/src/activation/activate.ts b/extension/src/activation/activate.ts index 0c6e6009..a1d88a31 100644 --- a/extension/src/activation/activate.ts +++ b/extension/src/activation/activate.ts @@ -1,6 +1,4 @@ import * as vscode from "vscode"; -import { registerAllCommands } from "../commands"; -import { registerAllCodeLensProviders } from "../lang-server/codeLens"; import IdeProtocolClient from "../continueIdeClient"; import { getContinueServerUrl } from "../bridge"; import { ContinueGUIWebviewViewProvider } from "../debugPanel"; @@ -9,9 +7,6 @@ import { startContinuePythonServer, } from "./environmentSetup"; import fetch from "node-fetch"; -import registerQuickFixProvider from "../lang-server/codeActions"; -import { get } from "http"; -// import { CapturedTerminal } from "../terminal/terminalEmulator"; const PACKAGE_JSON_RAW_GITHUB_URL = "https://raw.githubusercontent.com/continuedev/continue/HEAD/extension/package.json"; -- cgit v1.2.3-70-g09d2