Skip to content

Commit

Permalink
fix(agent): Hotfix 1.3.2: disable syntax-based replace range calculat…
Browse files Browse the repository at this point in the history
…ion by default. (#1345)

* fix(agent): Hotfix 1.3.2: disable syntax-based replace range calculation by default.

* test(agent): update test description.
  • Loading branch information
icycodes authored Feb 1, 2024
1 parent 81f365a commit a818905
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 3 deletions.
6 changes: 6 additions & 0 deletions clients/tabby-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.3.2

### Features

- Disabled experimental feature of syntax-based replace range calculation by default.

## 1.3.1

### Features
Expand Down
2 changes: 1 addition & 1 deletion clients/tabby-agent/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion clients/tabby-agent/src/AgentConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const defaultAgentConfig: AgentConfig = {
},
},
calculateReplaceRange: {
experimentalSyntax: true,
experimentalSyntax: false,
},
},
logs: {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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());
}
'''
Original file line number Diff line number Diff line change
@@ -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);┤")╣
}
'''

0 comments on commit a818905

Please sign in to comment.