summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-06-29 09:51:24 -0700
committerNate Sesti <sestinj@gmail.com>2023-06-29 09:51:24 -0700
commit1c85d3c1e184bb6434339af533df16667866e786 (patch)
tree3b4b6e10ee1d8d317ceef119ac7b30afbe439912
parent14f779412c086d569d6f86b9c3e871cbeb45c95a (diff)
downloadsncontinue-1c85d3c1e184bb6434339af533df16667866e786.tar.gz
sncontinue-1c85d3c1e184bb6434339af533df16667866e786.tar.bz2
sncontinue-1c85d3c1e184bb6434339af533df16667866e786.zip
messaging of welcome step
-rw-r--r--extension/media/walkthrough.md1
-rw-r--r--extension/package-lock.json4
-rw-r--r--extension/package.json2
-rw-r--r--extension/react-app/src/tabs/gui.tsx28
-rw-r--r--extension/src/activation/environmentSetup.ts9
-rw-r--r--extension/src/continueIdeClient.ts15
-rw-r--r--extension/src/util/messenger.ts8
7 files changed, 50 insertions, 17 deletions
diff --git a/extension/media/walkthrough.md b/extension/media/walkthrough.md
new file mode 100644
index 00000000..fe77a69a
--- /dev/null
+++ b/extension/media/walkthrough.md
@@ -0,0 +1 @@
+# Welcome to Continue
diff --git a/extension/package-lock.json b/extension/package-lock.json
index 241ea5ca..c33567c4 100644
--- a/extension/package-lock.json
+++ b/extension/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "continue",
- "version": "0.0.86",
+ "version": "0.0.88",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "continue",
- "version": "0.0.86",
+ "version": "0.0.88",
"license": "Apache-2.0",
"dependencies": {
"@electron/rebuild": "^3.2.10",
diff --git a/extension/package.json b/extension/package.json
index 7eca6042..e34af438 100644
--- a/extension/package.json
+++ b/extension/package.json
@@ -14,7 +14,7 @@
"displayName": "Continue",
"pricing": "Free",
"description": "Accelerating software development with language models",
- "version": "0.0.86",
+ "version": "0.0.88",
"publisher": "Continue",
"engines": {
"vscode": "^1.74.0"
diff --git a/extension/react-app/src/tabs/gui.tsx b/extension/react-app/src/tabs/gui.tsx
index 249d9785..8d21a457 100644
--- a/extension/react-app/src/tabs/gui.tsx
+++ b/extension/react-app/src/tabs/gui.tsx
@@ -63,7 +63,12 @@ function GUI(props: GUIProps) {
>([]);
const [dataSwitchChecked, setDataSwitchChecked] = useState(false);
const [showDataSharingInfo, setShowDataSharingInfo] = useState(false);
- const [stepsOpen, setStepsOpen] = useState<boolean[]>([]);
+ const [stepsOpen, setStepsOpen] = useState<boolean[]>([
+ true,
+ true,
+ true,
+ true,
+ ]);
const [history, setHistory] = useState<History | undefined>({
timeline: [
{
@@ -78,13 +83,24 @@ function GUI(props: GUIProps) {
{
name: "Welcome to Continue",
hide: false,
- description:
- "Type '/' to see the list of available slash commands. If you highlight code, edits and explanations will be localized to the highlighted range. Otherwise, the currently open file is used. In both cases, the code is combined with the previous steps to construct the context.",
+ description: `Welcome to Continue`,
system_message: null,
chat_context: [],
manage_own_chat_context: false,
- message:
- "Type '/' to see the list of available slash commands. If you highlight code, edits and explanations will be localized to the highlighted range. Otherwise, the currently open file is used. In both cases, the code is combined with the previous steps to construct the context.",
+ message: `# Welcome to Continue
+
+ _If it's your first time using Continue, it can take up to a minute for the server to install._
+
+ Continue is not perfect, but a great tool to add to your toolbox. These are the tasks that Continue is currently best at:
+
+ - Highlight a section of code and instruct Continue to refactor it, e.g. \`"/edit make this use more descriptive variable names"\`
+ - Ask questions of the open file, e.g. \`"/explain what is the purpose of each of these if statements?"\`
+ - Ask Continue to build the scaffolding of a new file from scratch, e.g. \`"add a React component for syntax highlighted code"\`
+
+ You can use "slash commands" to directly instruct Continue what to do, or just enter a request and it will automatically decide next steps. To see the list of available slash commands, type '/'.
+
+ If you highlight code, edits and explanations will be localized to the highlighted range. Otherwise, the currently open file is used. In both cases, the code is combined with the previous steps to construct the context.
+ `,
},
{
name: "Welcome to Continue!",
@@ -585,7 +601,7 @@ function GUI(props: GUIProps) {
onClick={() => {
client?.sendClear();
}}
- text="Clear All"
+ text="Clear"
>
<Trash size="1.6em" />
</HeaderButtonWithText>
diff --git a/extension/src/activation/environmentSetup.ts b/extension/src/activation/environmentSetup.ts
index 823670fd..b8c23733 100644
--- a/extension/src/activation/environmentSetup.ts
+++ b/extension/src/activation/environmentSetup.ts
@@ -150,11 +150,10 @@ async function setupPythonEnv() {
// Repeat until it is successfully created (sometimes it fails to generate the bin, need to try again)
while (true) {
const [, stderr] = await runCommand(createEnvCommand);
- if (stderr) {
- throw new Error(stderr);
- }
if (checkEnvExists()) {
break;
+ } else if (stderr) {
+ throw new Error(stderr);
} else {
// Remove the env and try again
const removeCommand = `rm -rf "${path.join(
@@ -180,7 +179,6 @@ async function setupPythonEnv() {
activateCmd,
pipUpgradeCmd,
`${pipCmd} install -r requirements.txt`,
- touchCmd,
].join(" ; ");
const [, stderr] = await runCommand(installRequirementsCommand);
if (stderr) {
@@ -273,13 +271,14 @@ export async function startContinuePythonServer() {
console.log(`stdout: ${data}`);
});
child.stderr.on("data", (data: any) => {
- console.log(`stderr: ${data}`);
if (
data.includes("Uvicorn running on") || // Successfully started the server
data.includes("address already in use") // The server is already running (probably a simultaneously opened VS Code window)
) {
console.log("Successfully started Continue python server");
resolve(null);
+ } else {
+ console.log(`stderr: ${data}`);
}
});
child.on("error", (error: any) => {
diff --git a/extension/src/continueIdeClient.ts b/extension/src/continueIdeClient.ts
index 8ab3e075..d983d93a 100644
--- a/extension/src/continueIdeClient.ts
+++ b/extension/src/continueIdeClient.ts
@@ -226,9 +226,18 @@ class IdeProtocolClient {
}
async getSessionId(): Promise<string> {
- if (this.messenger === null) {
- console.log("MESSENGER IS NULL");
- }
+ await new Promise((resolve, reject) => {
+ // Repeatedly try to connect to the server
+ const interval = setInterval(() => {
+ if (
+ this.messenger &&
+ this.messenger.websocket.readyState === 1 // 1 => OPEN
+ ) {
+ clearInterval(interval);
+ resolve(null);
+ }
+ }, 1000);
+ });
const resp = await this.messenger?.sendAndReceive("openGUI", {});
const sessionId = resp.sessionId;
console.log("New Continue session with ID: ", sessionId);
diff --git a/extension/src/util/messenger.ts b/extension/src/util/messenger.ts
index 6f8bb29d..e4133230 100644
--- a/extension/src/util/messenger.ts
+++ b/extension/src/util/messenger.ts
@@ -54,6 +54,14 @@ export class WebsocketMessenger extends Messenger {
super();
this.serverUrl = serverUrl;
this.websocket = this._newWebsocket();
+
+ const interval = setInterval(() => {
+ if (this.websocket.readyState === this.websocket.OPEN) {
+ clearInterval(interval);
+ } else if (this.websocket.readyState !== this.websocket.CONNECTING) {
+ this.websocket = this._newWebsocket();
+ }
+ }, 1000);
}
send(messageType: string, data: object) {