Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-indentation for JSX is incorrect #3820

Closed
DoctorRyner opened this issue Sep 12, 2022 · 3 comments
Closed

Auto-indentation for JSX is incorrect #3820

DoctorRyner opened this issue Sep 12, 2022 · 3 comments
Labels
A-tree-sitter Area: Tree-sitter C-bug Category: This is a bug

Comments

@DoctorRyner
Copy link

Summary

Going to the next line places your pointer in the wrong place
Bildschirmfoto 2022-09-12 um 19 22 21

Reproduction Steps

  1. Open any {jsx,tsx} file
  2. Insert this:
export const App: FunctionComponent = () => {
  return (
    <div>
      <h1>{greeting}</h1>
      <p>{welcomeMsg}</p>
      <div>
        <p>Test</p>
    
      </div>
    </div>
  )
}
  1. To see that it doesn't leap to the proper spot, try hitting 'o' or pressing enter at the end of a JSX line

Helix log

No response

Platform

macOS

Terminal Emulator

The latest iTerm 2

Helix Version

22.08.1

@DoctorRyner DoctorRyner added the C-bug Category: This is a bug label Sep 12, 2022
@the-mikedavis the-mikedavis changed the title The behaviour of pressing enter at the end of a line in JSX code is incorrect Auto-indentation for JSX is incorrect Sep 13, 2022
@the-mikedavis
Copy link
Member

Currently JSX uses the JavaScript indentation queries: https://github.com/helix-editor/helix/blob/master/runtime/queries/jsx/indents.scm

You can try tuning these so that the JSX tags trigger indents (see https://docs.helix-editor.com/master/guides/indent.html)

@mbenja
Copy link
Contributor

mbenja commented Sep 14, 2022

@DoctorRyner I can take a look at this and report back within a day or so

@DoctorRyner
Copy link
Author

Can confirm that it works. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tree-sitter Area: Tree-sitter C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

4 participants