Skip to content

Need help getting leptosfmt to work with rust-analyzer  #283

@Alt-iOS

Description

@Alt-iOS

Neovim version (nvim -v)

NVIM v0.9.5

Operating system/version

macos 14

Output of :checkhealth rustaceanvim

rustaceanvim: require("rustaceanvim.health").check()

Checking for Lua dependencies ~
- OK [mfussenegger/nvim-dap](https://github.com/mfussenegger/nvim-dap) installed.

Checking external dependencies ~
- OK rust-analyzer: found rust-analyzer 0.3.1868-standalone (037924c4d 2024-03-03)
- OK Cargo: found cargo 1.78.0-nightly (f772ec022 2024-03-01)
- OK rustc: found rustc 1.78.0-nightly (b6d2d841b 2024-03-05)
- OK debug adapter: found codelldb 

Checking config ~
- OK No errors found in config.

Checking for conflicting plugins ~
- OK No conflicting plugins detected.

Checking for tree-sitter parser ~
- OK tree-sitter parser for Rust detected.

How to reproduce the issue

- create a new leptos project
- select a file as projectroot
- put the following in the rust-analyzer.json
- {
  "rust-analyzer.rust.analyzerTargetDir": true,
  "rust-analyzer.rustfmt.overrideCommand": ["leptosfmt", "--stdin", "--rustfmt"]
}


### Expected behaviour

It reformats the file back to the original state

### Actual behaviour

Nothing happens

### The minimal config used to reproduce this issue.

```json 
 {
  "rust-analyzer.rust.analyzerTargetDir": true,
  "rust-analyzer.rustfmt.overrideCommand": ["leptosfmt", "--stdin", "--rustfmt"]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions