Skip to content

leptos_dx: rust-analyzer support in Kate #103

@s-mayrh

Description

@s-mayrh

Kate's LSP client configuration is its own science. Therefore I want to share my configuration that includes ssr and leptosfmt override:

{
    "servers": {
        "rust": {
            "initializationOptions": {
                "procMacro": {
                    "ignored": {
                        "leptos_macro": [
                            "server"
                        ]
                    }
                },
                "cargo": {
                    "features": ["ssr"]
                },
                "rustfmt": {
                    "overrideCommand": [
                        "leptosfmt", "--stdin", "--rustfmt"
                    ]
                }
            }
        }
    }
}

I did not include the comments

// optional:
// "component",
…
// if code that is cfg-gated for the `ssr` feature is shown as inactive,
// you may want to tell rust-analyzer to enable the `ssr` feature by default
//
// you can also use `rust-analyzer.cargo.allFeatures` to enable all features

because a warning appears that the JSON was invalid if comments are in them. Maybe someone can incorporate this in the book or find another good place where Kate users can find it and @bram209 might find this useful as well for rustfmt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions