Skip to content
Discussion options

You must be logged in to vote

Yeah, helix runs the formatter with its working directory set to the file's own folder, not your cwd or workspace root. That's the whole reason --search-parent-directories fixes it, so it's not really a hack.

It's right there in format() in helix-view/src/document.rs: it calls process.current_dir(doc_dir) where doc_dir is the parent of the file being formatted. stylua then starts its config search from that folder, and by default it won't climb any higher, so it never reaches the stylua.toml at your project root unless the file happens to sit directly in it.

neovim felt different because there the formatter usually runs from the project root, so the search starts right where your config a…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mantzu132
Comment options

Answer selected by mantzu132
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants