forked from TabbyML/tabby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(agent): fix support for html/jsx auto closing chars. (TabbyML#1265)
* fix(agent): fix support for html/jsx auto closing chars. * test(agent): add test for jsx tags.
- Loading branch information
Showing
8 changed files
with
299 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
clients/tabby-agent/src/postprocess/golden/replace_range/jsx_tags_01.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
description = 'Replace range: jsx tags: case 01' | ||
|
||
[config] | ||
# use default config | ||
|
||
[context] | ||
filepath = 'app.jsx' | ||
language = 'javascriptreact' | ||
# indentation = ' ' # not specified | ||
text = ''' | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom/client'; | ||
import './index.css'; | ||
import App from './App'; | ||
const root = ReactDOM.createRoot(document.getElementById('root')); | ||
const message = <div>Hello world!</div> | ||
root.render( | ||
<React.StrictMode> | ||
<App ├message={message} />┤/> | ||
</React.StrictMode> | ||
); | ||
''' | ||
|
||
[expected] | ||
text = ''' | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom/client'; | ||
import './index.css'; | ||
import App from './App'; | ||
const root = ReactDOM.createRoot(document.getElementById('root')); | ||
const message = <div>Hello world!</div> | ||
root.render( | ||
<React.StrictMode> | ||
<App ├message={message} />┤/>╣ | ||
</React.StrictMode> | ||
); | ||
''' |
41 changes: 41 additions & 0 deletions
41
clients/tabby-agent/src/postprocess/golden/replace_range/jsx_tags_02.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
description = 'Replace range: jsx tags: case 02' | ||
|
||
[config] | ||
# use default config | ||
|
||
[context] | ||
filepath = 'app.jsx' | ||
language = 'javascriptreact' | ||
# indentation = ' ' # not specified | ||
text = ''' | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom/client'; | ||
import './index.css'; | ||
import App from './App'; | ||
const root = ReactDOM.createRoot(document.getElementById('root')); | ||
const message = <div>Hello world!</div> | ||
root.render( | ||
<React.StrictMode> | ||
<App message={message} /> | ||
</├React.StrictMode>┤> | ||
); | ||
''' | ||
|
||
[expected] | ||
text = ''' | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom/client'; | ||
import './index.css'; | ||
import App from './App'; | ||
const root = ReactDOM.createRoot(document.getElementById('root')); | ||
const message = <div>Hello world!</div> | ||
root.render( | ||
<React.StrictMode> | ||
<App message={message} /> | ||
</├React.StrictMode>┤>╣ | ||
); | ||
''' |
Oops, something went wrong.