diff --git a/.gitignore b/.gitignore index 113c07c43..03db26b8e 100644 --- a/.gitignore +++ b/.gitignore @@ -148,13 +148,6 @@ codeql **/**/build **/.idea/**/* -!**/.idea/.name -!**/.idea/compiler.xml -!**/.idea/gradle.xml -!**/.idea/kotlinc.xml -!**/.idea/misc.xml -!**/.idea/vcs.xml -!**/.idea/jarRepositories.xml core/.idea continue_server.build @@ -165,10 +158,9 @@ Icon? .continue - .prompts/ .aider* notes.md -manual-testing-sandbox/Continue/.idea/vcs.xml \ No newline at end of file +manual-testing-sandbox/Continue/.idea/** \ No newline at end of file diff --git a/binary/package-lock.json b/binary/package-lock.json index 010492e82..932419aa6 100644 --- a/binary/package-lock.json +++ b/binary/package-lock.json @@ -93,6 +93,7 @@ "sqlite": "^5.1.1", "sqlite3": "^5.1.7", "system-ca": "^1.0.3", + "tar": "^7.4.3", "tree-sitter-wasms": "^0.1.11", "uuid": "^9.0.1", "vectordb": "^0.4.20", diff --git a/extensions/intellij/.idea/.name b/extensions/intellij/.idea/.name deleted file mode 100644 index c0d78d1d5..000000000 --- a/extensions/intellij/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -Continue IntelliJ Extension \ No newline at end of file diff --git a/extensions/intellij/.idea/compiler.xml b/extensions/intellij/.idea/compiler.xml deleted file mode 100644 index b589d56e9..000000000 --- a/extensions/intellij/.idea/compiler.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/extensions/intellij/.idea/gradle.xml b/extensions/intellij/.idea/gradle.xml deleted file mode 100644 index ce1c62c7c..000000000 --- a/extensions/intellij/.idea/gradle.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/extensions/intellij/.idea/jarRepositories.xml b/extensions/intellij/.idea/jarRepositories.xml deleted file mode 100644 index fdc392fe8..000000000 --- a/extensions/intellij/.idea/jarRepositories.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/extensions/intellij/.idea/kotlinc.xml b/extensions/intellij/.idea/kotlinc.xml deleted file mode 100644 index fdf8d994a..000000000 --- a/extensions/intellij/.idea/kotlinc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/extensions/intellij/.idea/misc.xml b/extensions/intellij/.idea/misc.xml deleted file mode 100644 index 9676474e1..000000000 --- a/extensions/intellij/.idea/misc.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/extensions/intellij/.idea/vcs.xml b/extensions/intellij/.idea/vcs.xml deleted file mode 100644 index b2bdec2d7..000000000 --- a/extensions/intellij/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/extensions/intellij/.run/Run Continue (TCP).run.xml b/extensions/intellij/.run/Run Continue (TCP).run.xml new file mode 100644 index 000000000..9962129cd --- /dev/null +++ b/extensions/intellij/.run/Run Continue (TCP).run.xml @@ -0,0 +1,31 @@ + + + + + + + + true + true + false + false + + + + \ No newline at end of file diff --git a/extensions/intellij/.run/Run Plugin.run.xml b/extensions/intellij/.run/Run Continue.run.xml similarity index 75% rename from extensions/intellij/.run/Run Plugin.run.xml rename to extensions/intellij/.run/Run Continue.run.xml index 93a586e03..da0937488 100644 --- a/extensions/intellij/.run/Run Plugin.run.xml +++ b/extensions/intellij/.run/Run Continue.run.xml @@ -1,7 +1,12 @@ - + + \ No newline at end of file diff --git a/extensions/intellij/CONTRIBUTING.md b/extensions/intellij/CONTRIBUTING.md index 9e6057b80..c4ecaa4ab 100644 --- a/extensions/intellij/CONTRIBUTING.md +++ b/extensions/intellij/CONTRIBUTING.md @@ -1,3 +1,88 @@ -### Commands +# Contributing to Continue (JetBrains) -Verify plugin compatibility: `./gradlew verifyPlugin` +This file is for contribution guidelines specific to the JetBrains extension. See the root [`CONTRIBUTING.md`](../../CONTRIBUTING.md) for general contribution guidelines. + +## Table of Contents + +- [Architecture Overview](#architecture-overview) +- [Environment Setup](#environment-setup) + - [IDE Installation](#ide-installation) + - [Node.js Requirements](#nodejs-requirements) + - [Install all dependencies](#install-all-dependencies) + - [Misc](#misc) +- [Development Workflow](#development-workflow) + - [Running the extension](#running-the-extension) + - [Packaging](#packaging) +- [Debugging](#debugging) +- [Editor config](#editor-config) + +## Architecture Overview + +This extension shares much of the code with the VS Code extension by utilizing shared code in the `core` directory and packaging it in a binary in the `binary` directory. Communication occurs over stdin/stdout. + +## Environment Setup + +### IDE Installation + +We recommend using IntelliJ IDEA, which you can download from the [JetBrains website](https://www.jetbrains.com/idea/download). + +Both Ultimate and Community (free) editions are suitable for this project. Continue is built with JDK version 17, as specified in [`./build.gradle.kts`](./build.gradle.kts). + +### Node.js Requirements + +This project requires Node.js version 20.11.0 (LTS) or higher. You have two options for installation: + +1. Download and install directly from [nodejs.org](https://nodejs.org/en/download). +2. If you're using NVM (Node Version Manager), set the correct Node.js version for this project by running `nvm use` in the project root. + +### Install all dependencies + +- Unix: `./scripts/install-dependencies.sh` +- Windows: `.\scripts\install-dependencies.ps1` + +### Misc + +- Ensure that you have the Gradle plugin installed + +## Development Workflow + +### Running the extension + +- Select the "Run Continue" Gradle configuration in the top-right corner of the IDE +- Click the "Run" or "Debug" button + - The first time running this will install the IDE version specified in [`./run/Run Continue.run.xml`](./.run/Run%20Continue.run.xml) (`platformVersion` property). This will take a moment as the install size can be close to 1GB. + +![run-extension-screenshot](../../media/run-intellij-extension.png) + +### Packaging + +This will generate a .zip file in [`extensions/intellij/build/distributions`](extensions/intellij/build/distributions) with the version defined in [`extensions/intellij/gradle.properties`](extensions/intellij/gradle.properties) + +- Unix: `./gradlew build` +- Windows: `./gradlew.bat build` + +1. If you make changes: + - You may need to re-build before running the "Build Plugin" configuration. + - If you change code from the `core` or `binary` directories, run `npm run build` from the `binary` directory to create a new binary. + - If you change code from the `gui` directory, run `npm run build` from the `gui` directory to create a new bundle. + - Any changes to the Kotlin code in the `extensions/intellij` directory will be automatically included when you run "Build Plugin". + +## Debugging + +[CoreMessenger.kt](./src/main/kotlin/com/github/continuedev/continueintellijextension/continue/CoreMessenger.kt) file. + +For the sake of rapid development, it is also possible to configure this communication to happen over local TCP sockets: + +1. In [CoreMessenger.kt](./extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/CoreMessenger.kt), change the `useTcp` variable to `true`. +2. Open a VS Code window (we recommend this for a preconfigured Typescript debugging experience) with the `continue` repository. Select the "Core Binary" debug configuration and press play. +3. Run the "Run Plugin" Gradle configuration. +4. You can now set breakpoints in any of the TypeScript files in VS Code. If you make changes to the code, restart the "Core Binary" debug configuration and reload the _Host IntelliJ_ window. + +If you make changes to Kotlin code, they can often be hot-reloaded with "Run -> Debugging Actions -> Reload Changed Classes". +You're right. The organization could be improved to make it more coherent and logical. Here's a suggestion for reorganizing the content: + +## Editor config + +Install the following two IntelliJ plugins to format Java and Kotlin on file save + + diff --git a/extensions/intellij/gradle.properties b/extensions/intellij/gradle.properties index a892cf145..f7318314b 100644 --- a/extensions/intellij/gradle.properties +++ b/extensions/intellij/gradle.properties @@ -23,4 +23,4 @@ org.gradle.configuration-cache=true # Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html org.gradle.caching=true # Enable Gradle Kotlin DSL Lazy Property Assignment -> https://docs.gradle.org/current/userguide/kotlin_dsl.html#kotdsl:assignment -systemProp.org.gradle.unsafe.kotlin.assignment=true \ No newline at end of file +systemProp.org.gradle.unsafe.kotlin.assignment=true diff --git a/extensions/intellij/package-lock.json b/extensions/intellij/package-lock.json new file mode 100644 index 000000000..ff588d4a5 --- /dev/null +++ b/extensions/intellij/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "intellij", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt index d0a7afa3d..a37b456d4 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt @@ -295,8 +295,6 @@ class ContinueBrowser(val project: Project, url: String, useOsr: Boolean = false * * We use the branchNumber (e.g., 233) instead of the full version number (e.g., 2023.3.4) because * it's a simple integer without dot notation, making it easier to compare. - * - * @return Boolean True if off-screen rendering should be used, false otherwise. */ private fun shouldRenderOffScreen(): Boolean { val minBuildNumber = 233 diff --git a/gui/package-lock.json b/gui/package-lock.json index 9c10b7f68..a632bd2ef 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -137,6 +137,7 @@ "sqlite": "^5.1.1", "sqlite3": "^5.1.7", "system-ca": "^1.0.3", + "tar": "^7.4.3", "tree-sitter-wasms": "^0.1.11", "uuid": "^9.0.1", "vectordb": "^0.4.20", diff --git a/media/IntelliJRunPluginScreenshot.png b/media/IntelliJRunPluginScreenshot.png deleted file mode 100644 index 5348eb1ba..000000000 Binary files a/media/IntelliJRunPluginScreenshot.png and /dev/null differ diff --git a/media/run-intellij-extension.png b/media/run-intellij-extension.png new file mode 100644 index 000000000..6f76f57bc Binary files /dev/null and b/media/run-intellij-extension.png differ