update default config
This commit is contained in:
parent
954283381c
commit
d167fef891
17 changed files with 323 additions and 9 deletions
12
.gitignore
vendored
12
.gitignore
vendored
|
|
@ -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/**
|
||||
manual-testing-sandbox/.idea/**
|
||||
extensions/intellij/.idea/**
|
||||
|
||||
**/.idea/workspace.xml
|
||||
**/.idea/usage.statistics.xml
|
||||
**/.idea/shelf/
|
||||
|
|
|
|||
1
.idea/.name
generated
Normal file
1
.idea/.name
generated
Normal file
|
|
@ -0,0 +1 @@
|
|||
Continue IntelliJ Extension
|
||||
57
.idea/codeStyles/Project.xml
generated
Normal file
57
.idea/codeStyles/Project.xml
generated
Normal 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
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal 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
6
.idea/compiler.xml
generated
Normal 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
6
.idea/git_toolbox_blame.xml
generated
Normal 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>
|
||||
17
.idea/gradle.xml
generated
Normal file
17
.idea/gradle.xml
generated
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?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="gradleJvm" value="corretto-17" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$/extensions/intellij" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
20
.idea/jarRepositories.xml
generated
Normal file
20
.idea/jarRepositories.xml
generated
Normal 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
6
.idea/kotlinc.xml
generated
Normal 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
6
.idea/ktfmt.xml
generated
Normal 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
11
.idea/misc.xml
generated
Normal 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>
|
||||
11
.idea/modules.xml
generated
Normal file
11
.idea/modules.xml
generated
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?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.main.iml" filepath="$PROJECT_DIR$/.idea/modules/com.github.continuedev.continueintellijextension.continue-intellij-extension.main.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/continue-intellij-extension.iml" filepath="$PROJECT_DIR$/.idea/modules/continue-intellij-extension.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/continue-intellij-extension.main.iml" filepath="$PROJECT_DIR$/.idea/modules/continue-intellij-extension.main.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/continue-intellij-extension.test.iml" filepath="$PROJECT_DIR$/.idea/modules/continue-intellij-extension.test.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -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>
|
||||
6
.idea/prettier.xml
generated
Normal file
6
.idea/prettier.xml
generated
Normal 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>
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue