From 106feaaae37eb8dba596617a27f7c3de53d4feda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20J=C3=B8rgensen?= Date: Tue, 13 Feb 2024 19:30:56 +0100 Subject: [PATCH 1/7] Add autocomplete support for more languages (#850) * add support for more lang * add some more * add dart --- core/autocomplete/languages.ts | 153 ++++++++++++++++++++++++++++++++- 1 file changed, 151 insertions(+), 2 deletions(-) diff --git a/core/autocomplete/languages.ts b/core/autocomplete/languages.ts index 671ee23f0..5bdc94da3 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 From 1562694f265755705b19afb9d177bd8f3b6e0dee Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 14 Feb 2024 09:05:04 -0800 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=94=96=20update=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extensions/vscode/package-lock.json | 4 ++-- extensions/vscode/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index d28e20af7..f33b81e3d 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.9.63", + "version": "0.8.12", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "0.9.63", + "version": "0.8.12", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index 16971cc67..258f80e33 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -1,7 +1,7 @@ { "name": "continue", "icon": "media/icon.png", - "version": "0.9.63", + "version": "0.8.12", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" From 7dc1ad3ff704fc08c7da3ae98560d200af311908 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 14 Feb 2024 17:14:36 +0000 Subject: [PATCH 3/7] =?UTF-8?q?=F0=9F=92=9A=20Update=20package.json=20vers?= =?UTF-8?q?ion=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extensions/vscode/package-lock.json | 4 ++-- extensions/vscode/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index f33b81e3d..bbf07f092 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.8.12", + "version": "0.8.13", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "0.8.12", + "version": "0.8.13", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index 258f80e33..daf4b09e1 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -1,7 +1,7 @@ { "name": "continue", "icon": "media/icon.png", - "version": "0.8.12", + "version": "0.8.13", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" From 68474d41c34fe2c848207e6437049aceef53e8dc Mon Sep 17 00:00:00 2001 From: Ty Dunn Date: Mon, 19 Feb 2024 15:08:43 -0800 Subject: [PATCH 4/7] no tab -> tab --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) From 9fce7eb606fad5392801ee11ea8fa51e6f2e8950 Mon Sep 17 00:00:00 2001 From: Ty Dunn Date: Mon, 19 Feb 2024 15:18:41 -0800 Subject: [PATCH 5/7] update recommendation --- docs/docs/model-setup/overview.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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) From 66a4e76c2ed0a892e17fa2b60e4a4612ed83f612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konrad=20Pocz=C4=85tek?= <114927967+konrad-poczatek@users.noreply.github.com> Date: Wed, 21 Feb 2024 22:52:16 +0100 Subject: [PATCH 6/7] Fix Gemini response (#885) # Fixed Gemini llm response # use region variables in url 2 times --- core/llm/llms/Gemini.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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; From cc9937a022c1ed2e25c5747822085c7e8dfca3b4 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 21 Feb 2024 13:53:11 -0800 Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=94=A5=20gitignore=20pkg/bin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 pkg/.gitignore diff --git a/pkg/.gitignore b/pkg/.gitignore new file mode 100644 index 000000000..c5e82d745 --- /dev/null +++ b/pkg/.gitignore @@ -0,0 +1 @@ +bin \ No newline at end of file