From 954283381c4744020986484061d41c12211bf433 Mon Sep 17 00:00:00 2001 From: Test Date: Thu, 17 Oct 2024 12:26:08 -0700 Subject: [PATCH 1/6] chore: remove old paths --- binary/package-lock.json | 1 + .../constants/ServerConstants.kt | 175 ------------------ extensions/vscode/package-lock.json | 4 +- extensions/vscode/package.json | 2 +- 4 files changed, 4 insertions(+), 178 deletions(-) delete mode 100644 extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/ServerConstants.kt diff --git a/binary/package-lock.json b/binary/package-lock.json index 932419aa6..11191c775 100644 --- a/binary/package-lock.json +++ b/binary/package-lock.json @@ -117,6 +117,7 @@ "@types/node-fetch": "^2.6.11", "@types/pg": "^8.11.6", "@types/request": "^2.48.12", + "@types/tar": "^6.1.13", "@types/uuid": "^9.0.7", "@types/win-ca": "^3.5.4", "cross-env": "^7.0.3", diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/ServerConstants.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/ServerConstants.kt deleted file mode 100644 index ece322284..000000000 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/ServerConstants.kt +++ /dev/null @@ -1,175 +0,0 @@ -package com.github.continuedev.continueintellijextension.constants - -import java.io.File -import java.nio.file.Files -import java.nio.file.Paths - -const val DEFAULT_CONFIG = """ -{ - "models": [ - { - "title": "GPT-4", - "provider": "free-trial", - "model": "gpt-4" - }, - { - "title": "GPT-3.5-Turbo", - "provider": "free-trial", - "model": "gpt-3.5-turbo" - }, - { - "title": "Phind CodeLlama", - "provider": "free-trial", - "model": "phind-codellama-34b" - }, - { - "title": "Gemini Pro", - "provider": "free-trial", - "model": "gemini-pro" - } - ], - "slashCommands": [ - { - "name": "edit", - "description": "Edit highlighted code" - }, - { - "name": "comment", - "description": "Write comments for the highlighted code" - }, - { - "name": "share", - "description": "Export the current chat session to markdown" - }, - { - "name": "cmd", - "description": "Generate a shell command" - } - ], - "customCommands": [ - { - "name": "test", - "prompt": "{{{ input }}}\n\nWrite a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.", - "description": "Write unit tests for highlighted code" - } - ], - "contextProviders": [ - { "name": "diff", "params": {} }, - { - "name": "open", - "params": {} - }, - { "name": "terminal", "params": {} } - ] -} -""" - -const val DEFAULT_CONFIG_JS = """ -function modifyConfig(config) { - return config; -} -export { - modifyConfig -}; -""" - -fun getContinueGlobalPath(): String { - val continuePath = Paths.get(System.getProperty("user.home"), ".continue") - if (Files.notExists(continuePath)) { - Files.createDirectories(continuePath) - } - return continuePath.toString() -} - -fun getContinueRemoteConfigPath(remoteHostname: String): String { - val path = Paths.get(getContinueGlobalPath(), ".configs") - if (Files.notExists(path)) { - Files.createDirectories(path) - } - return Paths.get(path.toString(), remoteHostname).toString() -} - - -fun getConfigJsonPath(remoteHostname: String? = null): String { - val path = Paths.get( - if (remoteHostname != null) getContinueRemoteConfigPath(remoteHostname) else getContinueGlobalPath(), - "config.json" - ) - if (Files.notExists(path)) { - Files.createFile(path) - Files.writeString(path, if (remoteHostname == null) DEFAULT_CONFIG else "{}") - } - return path.toString() -} - -fun getConfigJsPath(remoteHostname: String? = null): String { - val path = Paths.get( - if (remoteHostname != null) getContinueRemoteConfigPath(remoteHostname) else getContinueGlobalPath(), - "config.js" - ) - if (Files.notExists(path)) { - Files.createFile(path) - Files.writeString(path, DEFAULT_CONFIG_JS); - } - return path.toString() -} - -fun getSessionsDir(): String { - val path = Paths.get(getContinueGlobalPath(), "sessions") - if (Files.notExists(path)) { - Files.createDirectories(path) - } - return path.toString() -} - -fun getSessionsListPath(): String { - val path = Paths.get(getSessionsDir(), "sessions.json") - if (Files.notExists(path)) { - Files.createFile(path) - Files.writeString(path, "[]"); - } - return path.toString() -} - -fun getSessionFilePath(sessionId: String): String { - val path = Paths.get(getSessionsDir(), "$sessionId.json") - if (Files.notExists(path)) { - Files.createFile(path) - Files.writeString(path, "{}"); - } - return path.toString() -} - -fun devDataPath(): String { - val path = Paths.get(getContinueGlobalPath(), "dev_data") - if (Files.notExists(path)) { - Files.createDirectories(path) - } - return path.toString() -} - -fun getDevDataFilepath(filename: String): String { - val path = Paths.get(devDataPath(), filename) - if (Files.notExists(path)) { - Files.createFile(path) - } - return path.toString() -} - -fun getMigrationsFolderPath(): String { - val path = Paths.get(getContinueGlobalPath(), ".migrations") - if (Files.notExists(path)) { - Files.createDirectories(path) - } - return path.toString() -} - -fun migrate(id: String, callback: () -> Unit) { - val migrationsPath = getMigrationsFolderPath() - val migrationPath = Paths.get(migrationsPath, id).toString() - val migrationFile = File(migrationPath) - if (!migrationFile.exists()) { - migrationFile.writeText("") - callback() - } -} \ No newline at end of file diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 8bb6aa229..6d948deff 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.9.217", + "version": "0.9.218", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "0.9.217", + "version": "0.9.218", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index bd74f59fc..73b204dd9 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -2,7 +2,7 @@ "name": "continue", "icon": "media/icon.png", "author": "Continue Dev, Inc", - "version": "0.9.217", + "version": "0.9.218", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" From 03cc9ad8338cfcae350ea87bee60b69e1f99b670 Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 17 Oct 2024 13:40:14 -0700 Subject: [PATCH 2/6] update llm-info --- packages/llm-info/package-lock.json | 29 +++++++++++++++++++++++++++ packages/llm-info/package.json | 2 +- packages/llm-info/src/providers/os.ts | 1 - 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 packages/llm-info/package-lock.json diff --git a/packages/llm-info/package-lock.json b/packages/llm-info/package-lock.json new file mode 100644 index 000000000..80db35a66 --- /dev/null +++ b/packages/llm-info/package-lock.json @@ -0,0 +1,29 @@ +{ + "name": "@continuedev/llm-info", + "version": "1.0.6", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@continuedev/llm-info", + "version": "1.0.6", + "license": "Apache-2.0", + "devDependencies": { + "typescript": "^5.5.2" + } + }, + "node_modules/typescript": { + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + } + } +} diff --git a/packages/llm-info/package.json b/packages/llm-info/package.json index 6045d089c..4ba97f6b8 100644 --- a/packages/llm-info/package.json +++ b/packages/llm-info/package.json @@ -1,6 +1,6 @@ { "name": "@continuedev/llm-info", - "version": "1.0.5", + "version": "1.0.6", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/llm-info/src/providers/os.ts b/packages/llm-info/src/providers/os.ts index 78ee586d3..91ade3237 100644 --- a/packages/llm-info/src/providers/os.ts +++ b/packages/llm-info/src/providers/os.ts @@ -4,6 +4,5 @@ export const OsLlms: Omit[] = [ { model: "starcoder2:3b", displayName: "StarCoder 2 3B", - recommendedFor: ["autocomplete"], }, ]; From d167fef891c1266aed2a689b78a4ddc52686a037 Mon Sep 17 00:00:00 2001 From: Test Date: Thu, 17 Oct 2024 14:23:10 -0700 Subject: [PATCH 3/6] update default config --- .gitignore | 12 +- .idea/.name | 1 + .idea/codeStyles/Project.xml | 57 +++++++ .idea/codeStyles/codeStyleConfig.xml | 5 + .idea/compiler.xml | 6 + .idea/git_toolbox_blame.xml | 6 + .idea/gradle.xml | 17 ++ .idea/jarRepositories.xml | 20 +++ .idea/kotlinc.xml | 6 + .idea/ktfmt.xml | 6 + .idea/misc.xml | 11 ++ .idea/modules.xml | 11 ++ ...nsion.continue-intellij-extension.main.iml | 8 + .idea/prettier.xml | 6 + .idea/vcs.xml | 6 + core/util/paths.ts | 6 +- .../constants/ServerConstants.kt | 148 ++++++++++++++++++ 17 files changed, 323 insertions(+), 9 deletions(-) create mode 100644 .idea/.name create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/compiler.xml create mode 100644 .idea/git_toolbox_blame.xml create mode 100644 .idea/gradle.xml create mode 100644 .idea/jarRepositories.xml create mode 100644 .idea/kotlinc.xml create mode 100644 .idea/ktfmt.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/modules/com.github.continuedev.continueintellijextension.continue-intellij-extension.main.iml create mode 100644 .idea/prettier.xml create mode 100644 .idea/vcs.xml create mode 100644 extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/ServerConstants.kt diff --git a/.gitignore b/.gitignore index 03db26b8e..78880810a 100644 --- a/.gitignore +++ b/.gitignore @@ -147,20 +147,20 @@ codeql **/**/.qodana **/**/build -**/.idea/**/* -core/.idea - continue_server.build continue_server.dist Icon Icon? -.continue - .prompts/ .aider* notes.md -manual-testing-sandbox/Continue/.idea/** \ No newline at end of file +manual-testing-sandbox/.idea/** +extensions/intellij/.idea/** + +**/.idea/workspace.xml +**/.idea/usage.statistics.xml +**/.idea/shelf/ diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 000000000..c0d78d1d5 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +Continue IntelliJ Extension \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 000000000..49630cce2 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 000000000..79ee123c2 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 000000000..b589d56e9 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/git_toolbox_blame.xml b/.idea/git_toolbox_blame.xml new file mode 100644 index 000000000..7dc124965 --- /dev/null +++ b/.idea/git_toolbox_blame.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 000000000..6733405f9 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,17 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 000000000..fdc392fe8 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml new file mode 100644 index 000000000..fdf8d994a --- /dev/null +++ b/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/ktfmt.xml b/.idea/ktfmt.xml new file mode 100644 index 000000000..bfb71662f --- /dev/null +++ b/.idea/ktfmt.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 000000000..efa79f7df --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 000000000..5b1c3f963 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/com.github.continuedev.continueintellijextension.continue-intellij-extension.main.iml b/.idea/modules/com.github.continuedev.continueintellijextension.continue-intellij-extension.main.iml new file mode 100644 index 000000000..d2841a905 --- /dev/null +++ b/.idea/modules/com.github.continuedev.continueintellijextension.continue-intellij-extension.main.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/prettier.xml b/.idea/prettier.xml new file mode 100644 index 000000000..b0c1c68fb --- /dev/null +++ b/.idea/prettier.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 000000000..35eb1ddfb --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/core/util/paths.ts b/core/util/paths.ts index 864fc2c68..3002892ca 100644 --- a/core/util/paths.ts +++ b/core/util/paths.ts @@ -3,9 +3,9 @@ import dotenv from "dotenv"; import * as fs from "fs"; import * as os from "os"; import * as path from "path"; -import { defaultConfig, defaultConfigJetBrains } from "../config/default.js"; -import Types from "../config/types.js"; -import { IdeType, SerializedContinueConfig } from "../index.js"; +import { defaultConfig, defaultConfigJetBrains } from "../config/default"; +import Types from "../config/types"; +import { IdeType, SerializedContinueConfig } from "../"; dotenv.config(); diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/ServerConstants.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/ServerConstants.kt new file mode 100644 index 000000000..5a1b8af0e --- /dev/null +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/ServerConstants.kt @@ -0,0 +1,148 @@ +/** + * Note: This file is out of sync with the contents of core/util/paths.ts, which we use in VS Code. + * This is potentially causing JetBrains specific bugs. + */ +package com.github.continuedev.continueintellijextension.constants + +import java.nio.file.Files +import java.nio.file.Paths + +// Uncertain if this is being used anywhere since we also attempt to write a default config in +// core/util/paths.ts +const val DEFAULT_CONFIG = + """ +{ + "models": [ + { + "model": "claude-3-5-sonnet-20240620", + "provider": "anthropic", + "apiKey": "", + "title": "Claude 3.5 Sonnet" + } + ], + "tabAutocompleteModel": { + "title": "Codestral", + "provider": "mistral", + "model": "codestral-latest", + "apiKey": "" + }, + "customCommands": [ + { + "name": "test", + "prompt": "{{{ input }}}\n\nWrite a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.", + "description": "Write unit tests for highlighted code" + } + ], + "contextProviders": [ + { + "name": "diff", + "params": {} + }, + { + "name": "folder", + "params": {} + }, + { + "name": "codebase", + "params": {} + } + ], + "slashCommands": [ + { + "name": "edit", + "description": "Edit selected code" + }, + { + "name": "comment", + "description": "Write comments for the selected code" + }, + { + "name": "share", + "description": "Export the current chat session to markdown" + }, + { + "name": "commit", + "description": "Generate a git commit message" + } + ], + "docs": [] +} +""" + +const val DEFAULT_CONFIG_JS = + """ +function modifyConfig(config) { + return config; +} +export { + modifyConfig +}; +""" + +fun getContinueGlobalPath(): String { + val continuePath = Paths.get(System.getProperty("user.home"), ".continue") + if (Files.notExists(continuePath)) { + Files.createDirectories(continuePath) + } + return continuePath.toString() +} + +fun getContinueRemoteConfigPath(remoteHostname: String): String { + val path = Paths.get(getContinueGlobalPath(), ".configs") + if (Files.notExists(path)) { + Files.createDirectories(path) + } + return Paths.get(path.toString(), remoteHostname).toString() +} + +fun getConfigJsonPath(remoteHostname: String? = null): String { + val path = + Paths.get( + if (remoteHostname != null) getContinueRemoteConfigPath(remoteHostname) + else getContinueGlobalPath(), + "config.json") + if (Files.notExists(path)) { + Files.createFile(path) + Files.writeString(path, if (remoteHostname == null) DEFAULT_CONFIG else "{}") + } + return path.toString() +} + +fun getConfigJsPath(remoteHostname: String? = null): String { + val path = + Paths.get( + if (remoteHostname != null) getContinueRemoteConfigPath(remoteHostname) + else getContinueGlobalPath(), + "config.js") + if (Files.notExists(path)) { + Files.createFile(path) + Files.writeString(path, DEFAULT_CONFIG_JS) + } + return path.toString() +} + +fun getSessionsDir(): String { + val path = Paths.get(getContinueGlobalPath(), "sessions") + if (Files.notExists(path)) { + Files.createDirectories(path) + } + return path.toString() +} + +fun getSessionsListPath(): String { + val path = Paths.get(getSessionsDir(), "sessions.json") + if (Files.notExists(path)) { + Files.createFile(path) + Files.writeString(path, "[]") + } + return path.toString() +} + +fun getSessionFilePath(sessionId: String): String { + val path = Paths.get(getSessionsDir(), "$sessionId.json") + if (Files.notExists(path)) { + Files.createFile(path) + Files.writeString(path, "{}") + } + return path.toString() +} From a690da1a1e3a4fa5b6fcab7effcb30427c79a2fe Mon Sep 17 00:00:00 2001 From: Test Date: Thu, 17 Oct 2024 14:55:16 -0700 Subject: [PATCH 4/6] chore: open test Kotlin file on start --- .idea/gradle.xml | 1 - extensions/intellij/.run/Run Continue.run.xml | 4 +- extensions/intellij/build.gradle.kts | 207 +++++++++--------- manual-testing-sandbox/test.kt | 35 +++ 4 files changed, 142 insertions(+), 105 deletions(-) create mode 100644 manual-testing-sandbox/test.kt diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 6733405f9..1d937028b 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -5,7 +5,6 @@