From a818905c7ead44361c86857304554247fadcf065 Mon Sep 17 00:00:00 2001 From: Zhiming Ma Date: Thu, 1 Feb 2024 13:39:31 +0800 Subject: [PATCH] fix(agent): Hotfix 1.3.2: disable syntax-based replace range calculation by default. (#1345) * fix(agent): Hotfix 1.3.2: disable syntax-based replace range calculation by default. * test(agent): update test description. --- clients/tabby-agent/CHANGELOG.md | 6 ++++ clients/tabby-agent/package.json | 2 +- clients/tabby-agent/src/AgentConfig.ts | 2 +- .../experimental_syntax_javascript_01.toml | 2 +- .../experimental_syntax_rust_01.toml | 30 +++++++++++++++++++ .../experimental_syntax_rust_01_ref.toml | 29 ++++++++++++++++++ .../experimental_syntax_typescript_01.toml | 23 ++++++++++++++ 7 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 clients/tabby-agent/src/postprocess/golden/replace_range/experimental_syntax_rust_01.toml create mode 100644 clients/tabby-agent/src/postprocess/golden/replace_range/experimental_syntax_rust_01_ref.toml create mode 100644 clients/tabby-agent/src/postprocess/golden/replace_range/experimental_syntax_typescript_01.toml diff --git a/clients/tabby-agent/CHANGELOG.md b/clients/tabby-agent/CHANGELOG.md index 070f11ddd..e3ecf0638 100644 --- a/clients/tabby-agent/CHANGELOG.md +++ b/clients/tabby-agent/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.3.2 + +### Features + +- Disabled experimental feature of syntax-based replace range calculation by default. + ## 1.3.1 ### Features diff --git a/clients/tabby-agent/package.json b/clients/tabby-agent/package.json index 43037d78e..58f2d86a8 100644 --- a/clients/tabby-agent/package.json +++ b/clients/tabby-agent/package.json @@ -1,6 +1,6 @@ { "name": "tabby-agent", - "version": "1.3.1", + "version": "1.3.2", "description": "Generic client agent for Tabby AI coding assistant IDE extensions.", "homepage": "https://tabby.tabbyml.com/", "repository": "https://github.com/TabbyML/tabby", diff --git a/clients/tabby-agent/src/AgentConfig.ts b/clients/tabby-agent/src/AgentConfig.ts index cc97b7d48..26af82833 100644 --- a/clients/tabby-agent/src/AgentConfig.ts +++ b/clients/tabby-agent/src/AgentConfig.ts @@ -84,7 +84,7 @@ export const defaultAgentConfig: AgentConfig = { }, }, calculateReplaceRange: { - experimentalSyntax: true, + experimentalSyntax: false, }, }, logs: { diff --git a/clients/tabby-agent/src/postprocess/golden/replace_range/experimental_syntax_javascript_01.toml b/clients/tabby-agent/src/postprocess/golden/replace_range/experimental_syntax_javascript_01.toml index 14f28cc76..c681b8f65 100644 --- a/clients/tabby-agent/src/postprocess/golden/replace_range/experimental_syntax_javascript_01.toml +++ b/clients/tabby-agent/src/postprocess/golden/replace_range/experimental_syntax_javascript_01.toml @@ -1,4 +1,4 @@ -description = 'Replace range experimental: syntax javascript: bad case 01' +description = 'Replace range experimental: syntax javascript: case 01' [config.limitScope] experimentalSyntax = true diff --git a/clients/tabby-agent/src/postprocess/golden/replace_range/experimental_syntax_rust_01.toml b/clients/tabby-agent/src/postprocess/golden/replace_range/experimental_syntax_rust_01.toml new file mode 100644 index 000000000..3987255aa --- /dev/null +++ b/clients/tabby-agent/src/postprocess/golden/replace_range/experimental_syntax_rust_01.toml @@ -0,0 +1,30 @@ +description = 'Replace range experimental: syntax rust: bad case 01' + +[config.limitScope] +experimentalSyntax = true +[config.calculateReplaceRange] +experimentalSyntax = true + +[context] +filepath = 'myTest.rs' +language = 'rust' +# indentation = ' ' # not specified +text = ''' +pub fun myTest(&self, text: String) { + let mut body = HashMap::new(); + body.insert("├text".to_string(), text);┤") + let mut headers = HashMap::new(); + headers.insert("Content-Type".to_string(), "application/json".to_string()); +} +''' + +[expected] +text = ''' +pub fun myTest(&self, text: String) { + let mut body = HashMap::new(); + body.insert("├text".to_string(), text);┤")╣ + let mut headers = HashMap::new(); + headers.insert("Content-Type".to_string(), "application/json".to_string()); +} +''' +notEqual = true diff --git a/clients/tabby-agent/src/postprocess/golden/replace_range/experimental_syntax_rust_01_ref.toml b/clients/tabby-agent/src/postprocess/golden/replace_range/experimental_syntax_rust_01_ref.toml new file mode 100644 index 000000000..7c649604d --- /dev/null +++ b/clients/tabby-agent/src/postprocess/golden/replace_range/experimental_syntax_rust_01_ref.toml @@ -0,0 +1,29 @@ +description = 'Replace range experimental: syntax rust: case 01 (ref)' + +[config.limitScope] +experimentalSyntax = true +[config.calculateReplaceRange] +experimentalSyntax = false + +[context] +filepath = 'myTest.rs' +language = 'rust' +# indentation = ' ' # not specified +text = ''' +pub fun myTest(&self, text: String) { + let mut body = HashMap::new(); + body.insert("├text".to_string(), text);┤") + let mut headers = HashMap::new(); + headers.insert("Content-Type".to_string(), "application/json".to_string()); +} +''' + +[expected] +text = ''' +pub fun myTest(&self, text: String) { + let mut body = HashMap::new(); + body.insert("├text".to_string(), text);┤")╣ + let mut headers = HashMap::new(); + headers.insert("Content-Type".to_string(), "application/json".to_string()); +} +''' diff --git a/clients/tabby-agent/src/postprocess/golden/replace_range/experimental_syntax_typescript_01.toml b/clients/tabby-agent/src/postprocess/golden/replace_range/experimental_syntax_typescript_01.toml new file mode 100644 index 000000000..dd0abc95e --- /dev/null +++ b/clients/tabby-agent/src/postprocess/golden/replace_range/experimental_syntax_typescript_01.toml @@ -0,0 +1,23 @@ +description = 'Replace range experimental: syntax typescript: case 01' + +[config.limitScope] +experimentalSyntax = true +[config.calculateReplaceRange] +experimentalSyntax = true + +[context] +filepath = 'print.ts' +language = 'typescript' +# indentation = ' ' # not specified +text = ''' +function print(obj: any) { + console.log("Obj: ├", obj);┤") +} +''' + +[expected] +text = ''' +function print(obj: any) { + console.log("Obj: ├", obj);┤")╣ +} +'''