Merge branch 'dev' into tomasz/validate-config-backup

This commit is contained in:
Patrick Erichsen 2024-10-17 11:27:42 -07:00 • committed by GitHub
commit 847fdc84c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 243 additions and 260 deletions

9
.gitignore vendored
View file

@ -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
@ -171,4 +164,4 @@ Icon?
notes.md
manual-testing-sandbox/Continue/.idea/vcs.xml
manual-testing-sandbox/Continue/.idea/**

1
.idea/.name generated
View file

@ -1 +0,0 @@
continue-intellij-extension

6
.idea/compiler.xml generated
View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="17" />
</component>
</project>

16
.idea/gradle.xml generated
View file

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$/extensions/intellij" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$/extensions/intellij" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>

View file

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenRepo" />
<option name="name" value="MavenRepo" />
<option name="url" value="https://repo.maven.apache.org/maven2/" />
</remote-repository>
</component>
</project>

6
.idea/kotlinc.xml generated
View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="1.9.0" />
</component>
</project>

11
.idea/misc.xml generated
View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$/extensions/intellij" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="19" project-jdk-type="JavaSDK" />
<component name="SuppressKotlinCodeStyleNotification">
<option name="disableForAll" value="true" />
</component>
</project>

6
.idea/vcs.xml generated
View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View file

@ -19,7 +19,7 @@
- [VS Code](#vs-code)
- [Debugging](#debugging)
- [JetBrains](#jetbrains)
- [Debugging](#debugging-1)
- [Our Git Workflow](#our-git-workflow)
- [Formatting](#formatting)
- [Writing Slash Commands](#writing-slash-commands)
- [Writing Context Providers](#writing-context-providers)
@ -68,7 +68,7 @@ You can run the documentation server locally using either of the following metho
#### Method 1: NPM Script
1. Open your terminal and navigate to the `docs` subdirectory of the project. The `docusaurus.config.js` file you'll see there is a sign you're in the right place.
1. Open your terminal and navigate to the `docs` subdirectory of the project. The `docusaurus.config.js` file you'll see there is a sign you're in the right place.
2. Run the following command to install the necessary dependencies for the documentation server:
@ -141,33 +141,7 @@ Similarly, any changes to `core` or `extensions/vscode` will be automatically in
#### JetBrains
Pre-requisite: You should use the Intellij IDE, which can be downloaded [here](https://www.jetbrains.com/idea/download). Either Ultimate or Community (free) will work. Continue is built with JDK version 17, as specified in `extensions/intellij/build.gradle.kts`. You should also ensure that you have the Gradle plugin installed.
1. Clone the repository
2. Run `scripts/install-dependencies.sh` or `scripts/install-dependencies.ps1` on Windows. This will install and build all of the necessary dependencies.
3. To test the plugin, select the "Run Plugin" Gradle configuration and click the "Run" or "Debug" button as shown in this screenshot:
![img](./media/IntelliJRunPluginScreenshot.png)
4. To package the extension, run `./gradlew build` (or `./gradlew.bat build` on Windows) from the `extensions/intellij` directory. This will generate a .zip file in `extensions/intellij/build/distributions` with the version defined in `extensions/intellij/gradle.properties`.
5. If you make changes, you may need to re-build before running the "Build Plugin" configuration
a. If you change code from the `core` or `binary` directories, make sure to run `npm run build` from the `binary` directory to create a new binary.
b. If you change code from the `gui` directory, make sure to run `npm run build` from the `gui` directory to create a new bundle.
c. Any changes to the Kotlin coded in the `extensions/intellij` directory will be automatically included when you run "Build Plugin"
##### Debugging
Continue's JetBrains 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. The JetBrains extension (written in Kotlin) is then able to communicate over stdin/stdout in the [CoreMessenger.kt](./extensions/intellij/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".
See the [`CONTRIBUTING.md`](./extensions/intellij/CONTRIBUTING.md) for the JetBrains extension.
### Our Git Workflow

View file

@ -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",

View file

@ -22,20 +22,13 @@ We recommend configuring **GPT-4o** as your chat model.
## Autocomplete model
We recommend configuring **Codestral** as your autocomplete model. There are not currently any other models in Azure that are capable of autocomplete.
Azure OpenAI currently does not offer any autocomplete models.
```json title="config.json"
"tabAutocompleteModel": [{
"title": "Codestral",
"provider": "azure",
"model": "codestral-latest",
"apiBase": "<YOUR_DEPLOYMENT_BASE>",
"engine": "<YOUR_ENGINE>",
"apiVersion": "<YOUR_API_VERSION>",
"apiType": "azure",
"apiKey": "<MY_API_KEY>"
}]
```
[Click here](../../model-types/autocomplete.md) to see a list of autocomplete models.
:::info
**Codestral** will be available on Azure in the near future.
:::
## Embeddings model

View file

@ -1 +0,0 @@
Continue IntelliJ Extension

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="17" />
</component>
</project>

View file

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>

View file

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenRepo" />
<option name="name" value="MavenRepo" />
<option name="url" value="https://repo.maven.apache.org/maven2/" />
</remote-repository>
</component>
</project>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="1.9.0" />
</component>
</project>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="17" project-jdk-type="JavaSDK" />
</project>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>

View file

@ -0,0 +1,30 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Continue (TCP)" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="env">
<map>
<entry key="ORG_GRADLE_PROJECT_platformVersion" value="2024.1" />
<entry key="USE_TCP" value="true" />
</map>
</option>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/extensions/intellij" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="runIde" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>

View file

@ -1,11 +1,16 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Plugin" type="GradleRunConfiguration" factoryName="Gradle">
<configuration default="false" name="Run Continue" type="GradleRunConfiguration" factoryName="Gradle">
<log_file alias="idea.log" path="$PROJECT_DIR$/extensions/intellij/build/idea-sandbox/system/log/idea.log" />
<ExternalSystemSettings>
<option name="env">
<map>
<entry key="ORG_GRADLE_PROJECT_platformVersion" value="2024.1" />
</map>
</option>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/extensions/intellij" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
@ -19,6 +24,7 @@
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>

View file

@ -1,25 +1,25 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run IDE for UI Tests" type="GradleRunConfiguration" factoryName="Gradle">
<log_file alias="idea.log" path="$PROJECT_DIR$/build/idea-sandbox/system/log/idea.log" />
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="runIdeForUiTests" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
<!--<component name="ProjectRunConfigurationManager">-->
<!-- <configuration default="false" name="Run IDE for UI Tests" type="GradleRunConfiguration" factoryName="Gradle">-->
<!-- <log_file alias="idea.log" path="$PROJECT_DIR$/build/idea-sandbox/system/log/idea.log" />-->
<!-- <ExternalSystemSettings>-->
<!-- <option name="executionName" />-->
<!-- <option name="externalProjectPath" value="$PROJECT_DIR$" />-->
<!-- <option name="externalSystemIdString" value="GRADLE" />-->
<!-- <option name="scriptParameters" value="" />-->
<!-- <option name="taskDescriptions">-->
<!-- <list />-->
<!-- </option>-->
<!-- <option name="taskNames">-->
<!-- <list>-->
<!-- <option value="runIdeForUiTests" />-->
<!-- </list>-->
<!-- </option>-->
<!-- <option name="vmOptions" />-->
<!-- </ExternalSystemSettings>-->
<!-- <ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>-->
<!-- <ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>-->
<!-- <DebugAllEnabled>false</DebugAllEnabled>-->
<!-- <RunAsTest>false</RunAsTest>-->
<!-- <method v="2" />-->
<!-- </configuration>-->
<!--</component>-->

View file

@ -1,30 +1,30 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Qodana" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="env">
<map>
<entry key="QODANA_SHOW_REPORT" value="true" />
</map>
</option>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="cleanInspections" />
<option value="runInspections" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
<!--<component name="ProjectRunConfigurationManager">-->
<!-- <configuration default="false" name="Run Qodana" type="GradleRunConfiguration" factoryName="Gradle">-->
<!-- <ExternalSystemSettings>-->
<!-- <option name="env">-->
<!-- <map>-->
<!-- <entry key="QODANA_SHOW_REPORT" value="true" />-->
<!-- </map>-->
<!-- </option>-->
<!-- <option name="executionName" />-->
<!-- <option name="externalProjectPath" value="$PROJECT_DIR$" />-->
<!-- <option name="externalSystemIdString" value="GRADLE" />-->
<!-- <option name="scriptParameters" value="" />-->
<!-- <option name="taskDescriptions">-->
<!-- <list />-->
<!-- </option>-->
<!-- <option name="taskNames">-->
<!-- <list>-->
<!-- <option value="cleanInspections" />-->
<!-- <option value="runInspections" />-->
<!-- </list>-->
<!-- </option>-->
<!-- <option name="vmOptions" />-->
<!-- </ExternalSystemSettings>-->
<!-- <ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>-->
<!-- <ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>-->
<!-- <DebugAllEnabled>false</DebugAllEnabled>-->
<!-- <RunAsTest>false</RunAsTest>-->
<!-- <method v="2" />-->
<!-- </configuration>-->
<!--</component>-->

View file

@ -1,3 +1,112 @@
### Commands
# Contributing to Continue (JetBrains extension) <!-- omit in toc -->
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 <!-- omit in toc -->
- [Architecture Overview](#architecture-overview)
- [Environment Setup](#environment-setup)
- [IDE Installation](#ide-installation)
- [IDE configuration](#ide-configuration)
- [Node.js Requirements](#nodejs-requirements)
- [Install all dependencies](#install-all-dependencies)
- [Misc](#misc)
- [Development Workflow](#development-workflow)
- [Running the extension](#running-the-extension)
- [Available Gradle tasks](#available-gradle-tasks)
- [Debugging](#debugging)
- [Reloading changes](#reloading-changes)
- [Setting breakpoints](#setting-breakpoints)
- [Packaging](#packaging)
## 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).
### IDE configuration
- Enable code formatting on save: `Settings | Tools | Actions on Save | Reformat code`
### 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 by the `platformVersion` property in [`./run/Run Continue.run.xml`](./.run/Run%20Continue.run.xml). This will take a moment as the installation size can be close to 1GB.
![run-extension-screenshot](../../media/run-intellij-extension.png)
### Available Gradle tasks
To see the list of Gradle tasks available, you can run the following:
```shell
./gradlew tasks
```
A handful of the most relevant tasks are outlined below:
```shell
build - Assembles and tests this project.
clean - Deletes the build directory.
dependencies - Displays all dependencies declared in root project 'continue-intellij-extension'
runIde - Runs the IDE instance with the developed plugin installed.
verifyPluginConfiguration - Checks if Java and Kotlin compilers configuration meet IntelliJ SDK requirements
```
## Debugging
### Reloading changes
- `extensions/intellij`: Attempt to reload changed classes by selecting
`Run | Debugging Actions | Reload Changed Classes`
- This will often fail on new imports, schema changes etc. In that case, you need to stop and restart the extension
- `gui`: Run `npm run build` from the `gui` directory
- `core`: Run `npm run build` from the `binary` directory
### Setting breakpoints
- `extensions/intellij`: Run the extension in debug mode
- `gui`: You'll need to set explicit `debugger` statements in the source code, or through the browser dev tools
- `core`: To set breakpoints in `core`, we need to start `binary` in a debug configuration
- Select the "Run Continue (TCP)" task in the top right corner
- Open the project in a VS Code window (we recommend this for a preconfigured Typescript debugging experience)
- Select the "Core Binary" task from the Run and Debug panel
- You can now set breakpoints in `core`. Note that if you make changes, you'll need to restart the "Core Binary"
task and reload changes classes in Intellij.
## Packaging
- Unix: `./gradlew build`
- Windows: `./gradlew.bat build`
This will generate a .zip file in `./build/distributions` with the version defined in [`./gradle.properties`](./gradle.properties)

View file

@ -1,26 +1,40 @@
# IntelliJ Platform Artifacts Repositories -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html
pluginGroup=com.github.continuedev.continueintellijextension
pluginName=continue-intellij-extension
pluginRepositoryUrl=https://github.com/continuedev/continue
# SemVer format -> https://semver.org
pluginVersion=0.0.76
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild=223
#pluginUntilBuild = 232.*
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
platformType=IC
platformVersion=2022.3.3
#platformVersion = LATEST-EAP-SNAPSHOT
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
platformPlugins=org.jetbrains.plugins.terminal
# Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion=8.3
# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
kotlin.stdlib.default.dependency=false
# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html
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
systemProp.org.gradle.unsafe.kotlin.assignment=true

6
extensions/intellij/package-lock.json generated Normal file
View file

@ -0,0 +1,6 @@
{
"name": "intellij",
"lockfileVersion": 3,
"requires": true,
"packages": {}
}

View file

@ -19,16 +19,16 @@ class CoreMessenger(
private val project: Project,
esbuildPath: String,
continueCorePath: String,
ideProtocolClient: IdeProtocolClient,
private val coroutineScope: CoroutineScope
private val ideProtocolClient: IdeProtocolClient,
coroutineScope: CoroutineScope
) {
private var writer: Writer? = null
private var reader: BufferedReader? = null
private var process: Process? = null
private val gson = Gson()
private val responseListeners = mutableMapOf<String, (Any?) -> Unit>()
private val ideProtocolClient = ideProtocolClient
private val useTcp: Boolean = false
private val useTcp: Boolean = System.getenv("USE_TCP")?.toBoolean() ?: false
private fun write(message: String) {
try {
writer?.write(message + "\r\n")
@ -38,13 +38,6 @@ class CoreMessenger(
}
}
private fun close() {
writer?.close()
reader?.close()
val exitCode = process?.waitFor()
println("Subprocess exited with code: $exitCode")
}
fun request(messageType: String, data: Any?, messageId: String?, onResponse: (Any?) -> Unit) {
val id = messageId ?: uuid()
val message = gson.toJson(

View file

@ -9,8 +9,6 @@ import com.github.continuedev.continueintellijextension.services.ContinuePluginS
import com.google.gson.Gson
import com.google.gson.JsonObject
import com.google.gson.JsonParser
import com.intellij.ide.plugins.PluginManager
import com.intellij.ide.plugins.PluginManagerCore
import com.intellij.openapi.components.ServiceManager
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.Disposer
@ -20,16 +18,13 @@ import org.cef.CefApp
import org.cef.browser.CefBrowser
import org.cef.handler.CefLoadHandlerAdapter
import com.intellij.openapi.application.ApplicationInfo
import com.intellij.openapi.extensions.PluginId
class ContinueBrowser(val project: Project, url: String, useOsr: Boolean = false) {
class ContinueBrowser(val project: Project, url: String) {
private val coroutineScope = CoroutineScope(
SupervisorJob() + Dispatchers.Default
)
private val heightChangeListeners = mutableListOf<(Int) -> Unit>()
fun onHeightChange(listener: (Int) -> Unit) {
heightChangeListeners.add(listener)
}
private val PASS_THROUGH_TO_CORE = listOf(
"update/modelChange",
@ -290,13 +285,11 @@ class ContinueBrowser(val project: Project, url: String, useOsr: Boolean = false
* References:
* 1. https://youtrack.jetbrains.com/issue/IDEA-347828/JCEF-white-flash-when-tool-window-show#focus=Comments-27-9334070.0-0
* This issue mentions that white screen flash problems were resolved in platformVersion 2023.3.4.
* 2. https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html#earlier-versions
* 2. https://www.jetbrains.com/idea/download/other.html
* This documentation shows mappings from platformVersion to branchNumber.
*
* 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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB