Merge branch 'tomasz/validate-config-backup' of https://github.com/continuedev/continue into tomasz/validate-config-backup

This commit is contained in:
Nate 2024-10-17 21:20:36 -07:00
commit db45db74ba
41 changed files with 543 additions and 366 deletions

11
.gitignore vendored
View file

@ -147,9 +147,6 @@ codeql
**/**/.qodana
**/**/build
**/.idea/**/*
core/.idea
continue_server.build
continue_server.dist
@ -158,10 +155,14 @@ Icon?
.continue
.continuerc.json
.prompts/
.aider*
notes.md
manual-testing-sandbox/Continue/.idea/**
manual-testing-sandbox/.idea/**
extensions/intellij/.idea/**
**/.idea/workspace.xml
**/.idea/usage.statistics.xml
**/.idea/shelf/

1
.idea/.name generated Normal file
View file

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

57
.idea/codeStyles/Project.xml generated Normal file
View file

@ -0,0 +1,57 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<HTMLCodeStyleSettings>
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
</HTMLCodeStyleSettings>
<JSCodeStyleSettings version="0">
<option name="FORCE_SEMICOLON_STYLE" value="true" />
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
<option name="FORCE_QUOTE_STYlE" value="true" />
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
<option name="SPACES_WITHIN_IMPORTS" value="true" />
</JSCodeStyleSettings>
<TypeScriptCodeStyleSettings version="0">
<option name="FORCE_SEMICOLON_STYLE" value="true" />
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
<option name="FORCE_QUOTE_STYlE" value="true" />
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
<option name="SPACES_WITHIN_IMPORTS" value="true" />
</TypeScriptCodeStyleSettings>
<VueCodeStyleSettings>
<option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
<option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
</VueCodeStyleSettings>
<codeStyleSettings language="HTML">
<option name="SOFT_MARGINS" value="80" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="SOFT_MARGINS" value="80" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="TypeScript">
<option name="SOFT_MARGINS" value="80" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="Vue">
<option name="SOFT_MARGINS" value="80" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
</component>

5
.idea/codeStyles/codeStyleConfig.xml generated Normal file
View file

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

6
.idea/compiler.xml generated Normal file
View file

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

6
.idea/git_toolbox_blame.xml generated Normal file
View file

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

16
.idea/gradle.xml generated Normal file
View file

@ -0,0 +1,16 @@
<?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>

20
.idea/jarRepositories.xml generated Normal file
View file

@ -0,0 +1,20 @@
<?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 Normal file
View file

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

6
.idea/ktfmt.xml generated Normal file
View file

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

11
.idea/misc.xml generated Normal file
View file

@ -0,0 +1,11 @@
<?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>

10
.idea/modules.xml generated Normal file
View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/modules/com.github.continuedev.continueintellijextension.continue-intellij-extension.iml" filepath="$PROJECT_DIR$/.idea/modules/com.github.continuedev.continueintellijextension.continue-intellij-extension.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/com.github.continuedev.continueintellijextension.continue-intellij-extension.main.iml" filepath="$PROJECT_DIR$/.idea/modules/com.github.continuedev.continueintellijextension.continue-intellij-extension.main.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/com.github.continuedev.continueintellijextension.continue-intellij-extension.test.iml" filepath="$PROJECT_DIR$/.idea/modules/com.github.continuedev.continueintellijextension.continue-intellij-extension.test.iml" />
</modules>
</component>
</project>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="AdditionalModuleElements">
<content url="file://$MODULE_DIR$/../..">
<sourceFolder url="file://$MODULE_DIR$/../../extensions/intellij/.gradle/8.3/dependencies-accessors/5ff144de810dd952e050983bda2040fa7aa351f8/sources" isTestSource="false" />
</content>
</component>
</module>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="AdditionalModuleElements">
<content url="file://$MODULE_DIR$/../../extensions/intellij/src/main" dumb="true">
<sourceFolder url="file://$MODULE_DIR$/../../extensions/intellij/src/main" isTestSource="false" />
</content>
</component>
</module>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="AdditionalModuleElements">
<content url="file://$MODULE_DIR$/../../extensions/intellij/src/test" dumb="true">
<sourceFolder url="file://$MODULE_DIR$/../../extensions/intellij/src/test" isTestSource="true" />
</content>
</component>
</module>

6
.idea/prettier.xml generated Normal file
View file

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

View file

@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Continue" type="CompoundRunConfigurationType">
<toRun name="Run Extension" type="GradleRunConfiguration" />
<toRun name="GUI: Start dev server" type="js.build_tools.npm" />
<method v="2" />
</configuration>
</component>

3
.idea/scopes/Continue.xml generated Normal file
View file

@ -0,0 +1,3 @@
<component name="DependencyValidationManager">
<scope name="Continue" pattern="!file[com.github.continuedev.continueintellijextension.continue-intellij-extension]:gui/dist//*&amp;&amp;!file[com.github.continuedev.continueintellijextension.continue-intellij-extension]:extensions/vscode/gui//*&amp;&amp;!file[com.github.continuedev.continueintellijextension.continue-intellij-extension]:core/vendor//*" />
</component>

View file

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

View file

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

View file

@ -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();

View file

@ -1,30 +0,0 @@
<component name="ProjectRunConfigurationManager">
<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" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="runIde" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>

View file

@ -1,8 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Continue (TCP)" type="GradleRunConfiguration" factoryName="Gradle">
<configuration default="false" name="Run Extension" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="env">
<map>
<entry key="GUI_URL" value="http://localhost:5173/jetbrains_index.html" />
<entry key="ORG_GRADLE_PROJECT_platformVersion" value="2024.1" />
<entry key="USE_TCP" value="true" />
</map>

View file

@ -1,144 +1,147 @@
import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.markdownToHTML
fun properties(key: String) = providers.gradleProperty(key)
fun environment(key: String) = providers.environmentVariable(key)
plugins {
id("java") // Java support
alias(libs.plugins.kotlin) // Kotlin support
alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
alias(libs.plugins.changelog) // Gradle Changelog Plugin
alias(libs.plugins.qodana) // Gradle Qodana Plugin
alias(libs.plugins.kover) // Gradle Kover Plugin
kotlin("plugin.serialization") version "1.8.0"
id("java") // Java support
alias(libs.plugins.kotlin) // Kotlin support
alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
alias(libs.plugins.changelog) // Gradle Changelog Plugin
alias(libs.plugins.qodana) // Gradle Qodana Plugin
alias(libs.plugins.kover) // Gradle Kover Plugin
kotlin("plugin.serialization") version "1.8.0"
}
group = properties("pluginGroup").get()
version = properties("pluginVersion").get()
// Configure project's dependencies
repositories {
mavenCentral()
}
repositories { mavenCentral() }
// Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog
// Dependencies are managed with Gradle version catalog - read more:
// https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog
dependencies {
// implementation(libs.annotations)
implementation("com.squareup.okhttp3:okhttp:4.9.1") {
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib")
}
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.4.32")
implementation("io.ktor:ktor-server-core:2.3.7") {
exclude(group = "org.slf4j", module = "slf4j-api")
}
implementation("io.ktor:ktor-server-netty:2.3.7") {
exclude(group = "org.slf4j", module = "slf4j-api")
}
implementation("io.ktor:ktor-server-cors:2.3.7") {
exclude(group = "org.slf4j", module = "slf4j-api")
}
implementation("com.posthog.java:posthog:1.+")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0")
// implementation("com.jetbrains.jsonSchema")
// implementation(libs.annotations)
implementation("com.squareup.okhttp3:okhttp:4.9.1") {
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib")
}
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.4.32")
implementation("io.ktor:ktor-server-core:2.3.7") {
exclude(group = "org.slf4j", module = "slf4j-api")
}
implementation("io.ktor:ktor-server-netty:2.3.7") {
exclude(group = "org.slf4j", module = "slf4j-api")
}
implementation("io.ktor:ktor-server-cors:2.3.7") {
exclude(group = "org.slf4j", module = "slf4j-api")
}
implementation("com.posthog.java:posthog:1.+")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0")
// implementation("com.jetbrains.jsonSchema")
}
// Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for
// 2022.2+.
kotlin { jvmToolchain(17) }
// Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+.
kotlin {
jvmToolchain(17)
}
// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
// Configure Gradle IntelliJ Plugin - read more:
// https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
intellij {
pluginName = properties("pluginName")
version = properties("platformVersion")
type = properties("platformType")
pluginName = properties("pluginName")
version = properties("platformVersion")
type = properties("platformType")
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
plugins = properties("platformPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) }
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
plugins =
properties("platformPlugins").map {
it.split(',').map(String::trim).filter(String::isNotEmpty)
}
}
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
// Configure Gradle Changelog Plugin - read more:
// https://github.com/JetBrains/gradle-changelog-plugin
changelog {
groups.empty()
repositoryUrl = properties("pluginRepositoryUrl")
groups.empty()
repositoryUrl = properties("pluginRepositoryUrl")
}
// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
qodana {
cachePath = provider { file(".qodana").canonicalPath }
reportPath = provider { file("build/reports/inspections").canonicalPath }
saveReport = true
showReport = environment("QODANA_SHOW_REPORT").map { it.toBoolean() }.getOrElse(false)
cachePath = provider { file(".qodana").canonicalPath }
reportPath = provider { file("build/reports/inspections").canonicalPath }
saveReport = true
showReport = environment("QODANA_SHOW_REPORT").map { it.toBoolean() }.getOrElse(false)
}
// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
koverReport {
defaults {
xml {
onCheck = true
}
}
}
koverReport { defaults { xml { onCheck = true } } }
tasks {
prepareSandbox {
from("../../binary/bin") {
into("${intellij.pluginName.get()}/core/")
}
from("../vscode/node_modules/@vscode/ripgrep") {
into("${intellij.pluginName.get()}/ripgrep/")
}
}
prepareSandbox {
from("../../binary/bin") { into("${intellij.pluginName.get()}/core/") }
from("../vscode/node_modules/@vscode/ripgrep") { into("${intellij.pluginName.get()}/ripgrep/") }
}
wrapper {
gradleVersion = properties("gradleVersion").get()
}
wrapper { gradleVersion = properties("gradleVersion").get() }
patchPluginXml {
version = properties("pluginVersion")
sinceBuild = properties("pluginSinceBuild")
untilBuild = properties("pluginUntilBuild")
patchPluginXml {
version = properties("pluginVersion")
sinceBuild = properties("pluginSinceBuild")
untilBuild = properties("pluginUntilBuild")
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
pluginDescription = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
val start = "<!-- Plugin description -->"
val end = "<!-- Plugin description end -->"
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's
// manifest
pluginDescription =
providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
val start = "<!-- Plugin description -->"
val end = "<!-- Plugin description end -->"
with(it.lines()) {
if (!containsAll(listOf(start, end))) {
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
}
subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
with(it.lines()) {
if (!containsAll(listOf(start, end))) {
throw GradleException(
"Plugin description section not found in README.md:\n$start ... $end")
}
subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
}
}
}
}
// Configure UI tests plugin
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
runIdeForUiTests {
systemProperty("robot-server.port", "8082")
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
systemProperty("jb.consents.confirmation.enabled", "false")
}
// Configure UI tests plugin
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
runIdeForUiTests {
systemProperty("robot-server.port", "8082")
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
systemProperty("jb.consents.confirmation.enabled", "false")
}
signPlugin {
certificateChain = environment("CERTIFICATE_CHAIN")
privateKey = environment("PRIVATE_KEY")
password = environment("PRIVATE_KEY_PASSWORD")
}
signPlugin {
certificateChain = environment("CERTIFICATE_CHAIN")
privateKey = environment("PRIVATE_KEY")
password = environment("PRIVATE_KEY_PASSWORD")
}
publishPlugin {
// dependsOn("patchChangelog")
token = environment("PUBLISH_TOKEN")
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
channels.set(listOf(environment("RELEASE_CHANNEL").getOrElse("eap")))
publishPlugin {
// dependsOn("patchChangelog")
token = environment("PUBLISH_TOKEN")
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release
// labels, like 2.1.7-alpha.3
// Specify pre-release label to publish the plugin in a custom Release Channel automatically.
// Read more:
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
channels.set(listOf(environment("RELEASE_CHANNEL").getOrElse("eap")))
// We always hide the stable releases until a few days of EAP have proven them stable
// hidden = environment("RELEASE_CHANNEL").map { it == "stable" }.getOrElse(false)
}
// We always hide the stable releases until a few days of EAP have proven them stable
// hidden = environment("RELEASE_CHANNEL").map { it == "stable" }.getOrElse(false)
}
runIde {
// Open the `manual-testing-sandbox` on start
args =
listOf("${rootProject.projectDir.parentFile.parentFile}/manual-testing-sandbox/test.kt")
.map { file(it).absolutePath }
}
}

View file

@ -1,40 +1,25 @@
# 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

View file

@ -1,51 +1,31 @@
/**
* 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.io.File
import java.nio.file.Files
import java.nio.file.Paths
const val DEFAULT_CONFIG = """
// 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": [
{
"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"
"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",
@ -54,17 +34,43 @@ const val DEFAULT_CONFIG = """
}
],
"contextProviders": [
{ "name": "diff", "params": {} },
{
"name": "open",
"name": "diff",
"params": {}
},
{ "name": "terminal", "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 = """
const val DEFAULT_CONFIG_JS =
"""
function modifyConfig(config) {
return config;
}
@ -74,102 +80,69 @@ export {
"""
fun getContinueGlobalPath(): String {
val continuePath = Paths.get(System.getProperty("user.home"), ".continue")
if (Files.notExists(continuePath)) {
Files.createDirectories(continuePath)
}
return continuePath.toString()
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()
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()
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()
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()
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()
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()
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()
}
}

View file

@ -1,7 +1,6 @@
package com.github.continuedev.continueintellijextension.toolWindow
import com.github.continuedev.continueintellijextension.services.ContinuePluginService
import com.intellij.collaboration.async.disposingScope
import com.intellij.openapi.actionSystem.ActionManager
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.components.ServiceManager
@ -15,54 +14,51 @@ import javax.swing.*
const val JS_QUERY_POOL_SIZE = "200"
class ContinuePluginToolWindowFactory : ToolWindowFactory, DumbAware {
override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {
val continueToolWindow = ContinuePluginWindow(toolWindow, project)
val content = ContentFactory.getInstance().createContent(continueToolWindow.content, null, false)
toolWindow.contentManager.addContent(content)
val titleActions = mutableListOf<AnAction>()
createTitleActions(titleActions)
override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {
val continueToolWindow = ContinuePluginWindow(project)
val content =
ContentFactory.getInstance().createContent(continueToolWindow.content, null, false)
toolWindow.contentManager.addContent(content)
val titleActions = mutableListOf<AnAction>()
createTitleActions(titleActions)
// Add MaximizeToolWindow action
val action = ActionManager.getInstance().getAction("MaximizeToolWindow")
if (action != null) {
titleActions.add(action)
}
toolWindow.setTitleActions(titleActions)
// Add MaximizeToolWindow action
val action = ActionManager.getInstance().getAction("MaximizeToolWindow")
if (action != null) {
titleActions.add(action)
}
private fun createTitleActions(titleActions: MutableList<in AnAction>) {
val action = ActionManager.getInstance().getAction("ContinueSidebarActionsGroup")
if (action != null) {
titleActions.add(action)
}
toolWindow.setTitleActions(titleActions)
}
private fun createTitleActions(titleActions: MutableList<in AnAction>) {
val action = ActionManager.getInstance().getAction("ContinueSidebarActionsGroup")
if (action != null) {
titleActions.add(action)
}
}
override fun shouldBeAvailable(project: Project) = true
class ContinuePluginWindow(project: Project) {
private val defaultGUIUrl = "http://continue/index.html"
init {
System.setProperty("ide.browser.jcef.jsQueryPoolSize", JS_QUERY_POOL_SIZE)
System.setProperty("ide.browser.jcef.contextMenu.devTools.enabled", "true")
}
override fun shouldBeAvailable(project: Project) = true
val browser: ContinueBrowser by lazy {
val url = System.getenv("GUI_URL")?.toString() ?: defaultGUIUrl
class ContinuePluginWindow(toolWindow: ToolWindow, project: Project) {
init {
System.setProperty("ide.browser.jcef.jsQueryPoolSize", JS_QUERY_POOL_SIZE)
System.setProperty("ide.browser.jcef.contextMenu.devTools.enabled", "true")
}
val browser: ContinueBrowser by lazy {
val url = "http://continue/index.html";
// Use to get hot-reloading in local development
// val url = "http://localhost:5173/jetbrains_index.html";
val browser = ContinueBrowser(project, url)
val continuePluginService = ServiceManager.getService(
project,
ContinuePluginService::class.java
)
continuePluginService.continuePluginWindow = this
browser
}
val content: JComponent
get() = browser.browser.component
val browser = ContinueBrowser(project, url)
val continuePluginService =
ServiceManager.getService(project, ContinuePluginService::class.java)
continuePluginService.continuePluginWindow = this
browser
}
}
val content: JComponent
get() = browser.browser.component
}
}

View file

@ -1,12 +1,12 @@
{
"name": "continue",
"version": "0.9.217",
"version": "0.9.219",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "continue",
"version": "0.9.217",
"version": "0.9.219",
"license": "Apache-2.0",
"dependencies": {
"@electron/rebuild": "^3.2.10",

View file

@ -2,7 +2,7 @@
"name": "continue",
"icon": "media/icon.png",
"author": "Continue Dev, Inc",
"version": "0.9.217",
"version": "0.9.219",
"repository": {
"type": "git",
"url": "https://github.com/continuedev/continue"

View file

@ -77,21 +77,21 @@ function BestExperienceConfigForm({
<form onSubmit={handleSubmit}>
<div className="flex flex-col gap-3">
<div>
<div className="text-lg font-bold mb-1 flex flex-row justify-between gap-4">
<div className="mb-1 flex flex-row justify-between gap-4 text-lg font-bold">
<label className="text-lg font-bold">Chat model</label>
<div
className="flex items-center text-xs font-semibold justify-end hidden sm:flex"
className="flex hidden items-center justify-end text-xs font-semibold sm:flex"
style={{ color: lightGray }}
>
<CubeIcon className="w-4 h-4 mr-1 flex-shrink-0" />
<span className="italic text-right inline">
<CubeIcon className="mr-1 h-4 w-4 flex-shrink-0" />
<span className="inline text-right italic">
{chatModel.title}{" "}
<span className="hidden md:inline">by Anthropic</span>
</span>
</div>
</div>
<div className="flex flex-col pb-4 w-full">
<div className="flex w-full flex-col pb-4">
<Input
placeholder="Enter your Anthropic API Key"
value={chatApiKey}
@ -101,7 +101,7 @@ function BestExperienceConfigForm({
<a
href={chatProvider.apiKeyUrl}
target="_blank"
className="text-inherit underline cursor-pointer hover:text-inherit"
className="cursor-pointer text-inherit underline hover:text-inherit"
>
Click here
</a>{" "}
@ -111,23 +111,23 @@ function BestExperienceConfigForm({
</div>
<div>
<div className="text-lg font-bold mb-1 flex flex-row justify-between gap-4">
<div className="mb-1 flex flex-row justify-between gap-4 text-lg font-bold">
<label className="text-lg font-bold">Autocomplete model</label>
<div
className="flex items-center text-xs font-semibold hidden sm:flex"
className="flex hidden items-center text-xs font-semibold sm:flex"
style={{ color: lightGray }}
>
<CubeIcon className="w-4 h-4 mr-1 flex-shrink-0 inline" />
<span className="italic text-right">
<CubeIcon className="mr-1 inline h-4 w-4 flex-shrink-0" />
<span className="text-right italic">
{autocompleteModel.title}{" "}
<span className="hidden md:inline">by Mistral</span>
</span>
</div>
</div>
<div className="flex flex-col pb-4 w-full">
<div className="flex w-full flex-col pb-4">
<Input
placeholder="Enter your Codestral API Key"
placeholder="Enter your Mistral API Key"
value={autocompleteApiKey}
onChange={(e) => setAutocompleteApiKey(e.target.value)}
/>
@ -135,11 +135,11 @@ function BestExperienceConfigForm({
<a
href={autocompleteProvider.apiKeyUrl}
target="_blank"
className="text-inherit underline cursor-pointer hover:text-inherit"
className="cursor-pointer text-inherit underline hover:text-inherit"
>
Click here
</a>{" "}
to create a Codestral API key
to create a Mistral API key
</InputSubtext>
</div>
</div>
@ -154,4 +154,5 @@ function BestExperienceConfigForm({
</form>
);
}
export default BestExperienceConfigForm;

View file

@ -34,7 +34,7 @@ function JetBrainsFetchGitHubTokenDialog({
}
return (
<div className="p-8 flex flex-col gap-3">
<div className="flex flex-col gap-3 p-8">
<div className="text-center">
<h1 className="my-0">Sign in with GitHub</h1>
<p>
@ -66,7 +66,7 @@ function JetBrainsFetchGitHubTokenDialog({
<Button
onClick={submitJetBrainsToken}
disabled={!jbGhAuthToken}
className="grid grid-flow-col items-center gap-2 w-full mt-2"
className="mt-2 grid w-full grid-flow-col items-center gap-2"
>
Get started using our API keys
</Button>

View file

@ -21,19 +21,19 @@ function OllamaModelDownload({
const id = `info-hover-${encodeURIComponent(command)}`;
function onClick() {
ideMessenger.ide.runCommand(command);
void ideMessenger.ide.runCommand(command);
ideMessenger.post("copyText", { text: command });
}
return (
<div className="flex flex-col">
<p className="text-lg font-bold leading-tight mb-2">{title}</p>
<p className="mb-2 text-lg font-bold leading-tight">{title}</p>
{hasDownloaded ? (
<OllamaCompletedStep text={command} />
) : (
<>
<StyledActionButton data-tooltip-id={id} onClick={onClick}>
<p className="font-mono truncate">{command}</p>
<p className="truncate font-mono text-sm">{command}</p>
<CommandLineIcon width={24} height={24} />
</StyledActionButton>

View file

@ -35,17 +35,17 @@ export function OllamaStatus({ isOllamaConnected }: OllamaStatusProps) {
case OllamaConnectionStatuses.WaitingToDownload:
return (
<StyledActionButton onClick={onClickDownload}>
<p className="underline text-sm truncate mr-1">{downloadUrl}</p>
<p className="mr-1 text-sm underline">{downloadUrl}</p>
<ArrowTopRightOnSquareIcon width={24} height={24} />
</StyledActionButton>
);
case OllamaConnectionStatuses.Downloading:
return (
<div className="flex justify-between items-center">
<p className="text-sm w-3/4 font-mono truncate mr-1">
<div className="flex items-center justify-between">
<p className="mr-1 w-3/4 font-mono text-sm">
Checking for connection to Ollama at http://localhost:11434
</p>
<ArrowPathIcon className="h-4 w-4 animate-spin-slow mr-1" />
<ArrowPathIcon className="animate-spin-slow mr-1 h-4 w-4" />
</div>
);
case OllamaConnectionStatuses.Connected:

View file

@ -19,12 +19,12 @@ function ProviderAlert() {
return (
<div className="w-full">
<Alert type="info">
<p className="font-semibold text-sm m-0">
<p className="m-0 text-sm font-semibold">
Prefer to use a different provider like OpenAI?
</p>
<p className="m-0 mt-1">
<p className="m-0 mt-1 text-xs">
<a
className="text-inherit underline cursor-pointer hover:text-inherit"
className="cursor-pointer text-inherit underline hover:text-inherit"
onClick={onClick}
>
Click here

View file

@ -63,7 +63,7 @@ function QuickstartSubmitButton() {
<div className="mt-4 w-full">
<Button
onClick={onClick}
className="grid grid-flow-col items-center gap-2 w-full"
className="grid w-full grid-flow-col items-center gap-2"
>
Get started using our API keys
</Button>

View file

@ -78,7 +78,7 @@ function OnboardingLocalTab() {
OLLAMA_CHECK_INTERVAL_MS,
);
fetchDownloadedModels();
void fetchDownloadedModels();
return () => clearInterval(intervalId);
}, []);
@ -86,7 +86,7 @@ function OnboardingLocalTab() {
return (
<div className="flex flex-col gap-2">
<div className="flex flex-col">
<p className="text-lg font-bold leading-tight mb-2">Install Ollama</p>
<p className="mb-2 text-lg font-bold leading-tight">Install Ollama</p>
<OllamaStatus isOllamaConnected={isOllamaConnected} />
</div>

View file

@ -172,6 +172,7 @@ export const ButtonSubtext = styled.span`
margin-top: 0;
text-align: center;
color: ${lightGray};
font-size: 0.75rem;
`;
export const CustomScrollbarDiv = styled.div`
@ -304,12 +305,12 @@ export const Label = styled.label<{ fontSize?: number }>`
`;
const spin = keyframes`
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
`;
export const Loader = styled.div`
@ -362,9 +363,10 @@ export const HeaderButton = styled.button<{
&:hover {
background-color: ${({ inverted, hoverBackgroundColor }) =>
typeof inverted === "undefined" || inverted
? hoverBackgroundColor ?? vscInputBackground
? (hoverBackgroundColor ?? vscInputBackground)
: "transparent"};
}
display: flex;
align-items: center;
justify-content: center;

View file

@ -0,0 +1,32 @@
class Test {
private var result: Double = 0.0
fun add(number: Double): Test {
result += number
return this
}
fun subtract(number: Double): Test {
result -= number
return this
}
fun multiply(number: Double): Test {
result *= number
return this
}
fun divide(number: Double): Test {
result /= number
return this
}
fun getResult(): Double {
return result
}
fun reset(): Test {
result = 0.0
return this
}
}

29
packages/llm-info/package-lock.json generated Normal file
View file

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

View file

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

View file

@ -4,6 +4,5 @@ export const OsLlms: Omit<LlmInfo, "provider">[] = [
{
model: "starcoder2:3b",
displayName: "StarCoder 2 3B",
recommendedFor: ["autocomplete"],
},
];