diff --git a/README.md b/README.md index 6eba72e42..0e785357c 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ -## Task, not tab, auto-complete +## Task and tab autocomplete ### Answer coding questions @@ -52,6 +52,12 @@ Open a blank file and let Continue start new Python scripts, React components, e - “/edit implement a c++ shortest path algo in a concise way” - “/edit create a docker compose file with php and mysql server" +### And much more! + +- Try out [experimental support for local tab autocomplete](https://continue.dev/docs/walkthroughs/tab-autocomplete) in VS Code +- Use [built-in context providers](https://continue.dev/docs/customization/context-providers#built-in-context-providers) or create your own [custom context providers](https://continue.dev/docs/customization/context-providers#building-your-own-context-provider) +- Use [built-in slash commands](https://arc.net/l/quote/zbhwfjmp) or create your own [custom slash commands](https://continue.dev/docs/customization/slash-commands#custom-slash-commands) + ## Getting Started #### Download for [VS Code](https://marketplace.visualstudio.com/items?itemName=Continue.continue) and [JetBrains](https://plugins.jetbrains.com/plugin/22707-continue-extension) diff --git a/core/autocomplete/languages.ts b/core/autocomplete/languages.ts index f54e7f77d..0571aec3b 100644 --- a/core/autocomplete/languages.ts +++ b/core/autocomplete/languages.ts @@ -4,24 +4,146 @@ export interface AutocompleteLanguageInfo { endOfLine: string[]; } +// TypeScript export const Typescript = { - stopWords: ["function", "class", "module", "export "], + stopWords: ["function", "class", "module", "export"], comment: "//", endOfLine: [";"], }; +// Python export const Python = { stopWords: ["def", "class"], comment: "#", endOfLine: [], }; +// Java export const Java = { stopWords: ["class", "function"], comment: "//", endOfLine: [";"], }; +// C++ +export const Cpp = { + stopWords: ["class", "namespace", "template"], + comment: "//", + endOfLine: [";"], +}; + +// C# +export const CSharp = { + stopWords: ["class", "namespace", "void"], + comment: "//", + endOfLine: [";"], +}; + +// C +export const C = { + stopWords: ["if", "else", "while", "for", "switch", "case"], + comment: "//", + endOfLine: [";"], +}; + +// Scala +export const Scala = { + stopWords: ["def", "val", "var", "class", "object", "trait"], + comment: "//", + endOfLine: [";"], +}; + +// Go +export const Go = { + stopWords: ["func", "package", "import", "type"], + comment: "//", + endOfLine: [""], +}; + +// Rust +export const Rust = { + stopWords: ["fn", "mod", "pub", "struct", "enum", "trait"], + comment: "//", + endOfLine: [";"], +}; + +// Haskell +export const Haskell = { + stopWords: ["data", "type", "newtype", "class", "instance", "let", "in", "where"], + comment: "--", + endOfLine: [""], +}; + +// PHP +export const PHP = { + stopWords: ["function", "class", "namespace", "use"], + comment: "//", + endOfLine: [";"], +}; + +// Ruby on Rails +export const RubyOnRails = { + stopWords: ["def", "class", "module"], + comment: "#", + endOfLine: [""], +}; + +// Swift +export const Swift = { + stopWords: ["func", "class", "struct", "import"], + comment: "//", + endOfLine: [";"], +}; + +// Kotlin +export const Kotlin = { + stopWords: ["fun", "class", "package", "import"], + comment: "//", + endOfLine: [";"], +}; + +// Ruby +export const Ruby = { + stopWords: ["class", "module", "def"], + comment: "#", + endOfLine: [""], +}; + +// Clojure +export const Clojure = { + stopWords: ["def", "fn", "let", "do", "if", "defn", "ns", "defmacro"], + comment: ";", + endOfLine: [""], +}; + +// Julia +export const Julia = { + stopWords: ["function", "macro", "if", "else", "elseif", "while", "for", "begin", "end", "module"], + comment: "#", + endOfLine: [";"], +}; + +// F# +export const FSharp = { + stopWords: ["let", "type", "module", "namespace", "open", "if", "then", "else", "match", "with"], + comment: "//", + endOfLine: [""], +}; + +// R +export const R = { + stopWords: ["function", "if", "else", "for", "while", "repeat", "library", "require"], + comment: "#", + endOfLine: [""], +}; + +// Dart +export const Dart = { + stopWords: ["class", "import", "void", "enum"], + comment: "//", + endOfLine: [";"], +}; + export const LANGUAGES: { [extension: string]: AutocompleteLanguageInfo } = { ts: Typescript, js: Typescript, @@ -30,4 +152,31 @@ export const LANGUAGES: { [extension: string]: AutocompleteLanguageInfo } = { py: Python, pyi: Python, java: Java, -}; + cpp: Cpp, + cxx: Cpp, + h: Cpp, + hpp: Cpp, + cs: CSharp, + c: C, + scala: Scala, + sc: Scala, + go: Go, + rs: Rust, + hs: Haskell, + php: PHP, + rb: Ruby, + rails: RubyOnRails, + swift: Swift, + kt: Kotlin, + clj: Clojure, + cljs: Clojure, + cljc: Clojure, + jl: Julia, + fs: FSharp, + fsi: FSharp, + fsx: FSharp, + fsscript: FSharp, + r: R, + R: R, + dart: Dart, +}; \ No newline at end of file diff --git a/core/llm/llms/Gemini.ts b/core/llm/llms/Gemini.ts index eb503f7a4..126f94a01 100644 --- a/core/llm/llms/Gemini.ts +++ b/core/llm/llms/Gemini.ts @@ -31,7 +31,7 @@ class Gemini extends BaseLLM { messages: ChatMessage[], options: CompletionOptions ): AsyncGenerator { - const apiUrl = `https://${this.region}-aiplatform.googleapis.com/v1/projects/${this.projectId}/locations/us-central1/publishers/google/models/gemini-pro:streamGenerateContent`; + const apiUrl = `https://${this.region}-aiplatform.googleapis.com/v1/projects/${this.projectId}/locations/${this.region}/publishers/google/models/gemini-pro:streamGenerateContent`; const body = { contents: messages.map((msg) => { return { @@ -60,8 +60,12 @@ class Gemini extends BaseLLM { if (data[0]?.error) { throw new Error(data[0].error.message); } - yield data[0]?.candidates?.[0]?.content?.parts?.[0]?.text || ""; - } + let combinedText = ''; + for (const entry of data || []) { + combinedText += entry?.candidates?.[0]?.content?.parts?.[0]?.text || ''; + } + + yield { role: "assistant", content: combinedText.trim() }; } } export default Gemini; diff --git a/docs/docs/model-setup/overview.md b/docs/docs/model-setup/overview.md index 20800f418..88ac00c1a 100644 --- a/docs/docs/model-setup/overview.md +++ b/docs/docs/model-setup/overview.md @@ -6,15 +6,14 @@ When you first install Continue, you can try it out for free using a proxy serve Once you're ready to use your own API key or a different model / provider, press the `+` button in the bottom left to add a new model to your `config.json`. -If you are unsure what model or provider to use, here is a rule of thumb: +If you are unsure what model or provider to use, here is our current rule of thumb: -- Use GPT-4 via OpenAI if you want the best possible model overall right now -- Use Phind CodeLlama or Mixtral 8x7B via Together if you want the best open-source model right now -- Use CodeLlama via Ollama if you want to run a model locally on Mac or Linux -- Use CodeLlama via LM Studio if you want to run a model locally on Windows +- Use GPT-4 via OpenAI if you want the best possible model overall +- Use DeepSeek Coder 33B via the Together API if you want the best open-source model +- Use DeepSeek Coder 6.7B with Ollama if you want to run a model locally Learn more: - [Select a provider](select-provider.md) - [Select a model](select-model.md) -- [Configuration](configuration.md) \ No newline at end of file +- [Configuration](configuration.md) diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 700164bfc..9ae5d8255 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -8,9 +8,6 @@ "name": "continue", "version": "0.9.70", "license": "Apache-2.0", - "dependencies": { - "@electron/rebuild": "^3.2.10", - "@reduxjs/toolkit": "^1.9.3", "@types/jest": "^29.5.11", "@types/node-fetch": "^2.6.11", "@vscode/ripgrep": "^1.15.9",