Skip to content

Document unstable project based rust analyzer config to override rustfmt #126

@lukashermansson

Description

@lukashermansson

This pr: rust-lang/rust-analyzer#17058 adds support for project based rust-analyzer configuration file.

Adding the below section to rust-analyzer.toml in any leptos project you want to format with leptosfmt:

[rustfmt] 
overrideCommand = ["leptosfmt", "--stdin", "--rustfmt"]

does in my experience make rust-analyzer use leptosfmt for formatting my specific setup is based on neovim, so not sure if it integrates with other editors.

Not sure if its stable enough to document it as a way to have our editors run leptosfmt. As can be noted in the referenced pr:

We don't promise any stability with this feature yet, any configs exposed may be removed again, the grouping may change etc.

If you feel like its a worthwhile addition to the readme regardless of its stability I could attempt a pr with documentation. For this I suppose I would have to find out under what setups this works with, (calling out to any readers, if you can figure out if this feature is available under your setup it would be awesome)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions