leptos-rs / leptos

Build fast web applications with Rust.
https://leptos.dev
MIT License
15.26k stars 597 forks source link

Helix setup not working #2634

Open gitmalong opened 2 weeks ago

gitmalong commented 2 weeks ago

Describe the bug I followed Leptos DX https://book.leptos.dev/getting_started/leptos_dx.html to configure my Helix editor to make it work with Rust + Leptos + Tailwind.

2024-06-16T22:22:47.280 helix_lsp::transport [ERROR] tailwindcss-ls err: <- StreamClosed
2024-06-16T22:23:24.562 helix_term::application [ERROR] Ignoring unknown notification from Language Server: protocol error: InvalidParams: Invalid params: missing field `message`.
2024-06-16T22:23:24.562 helix_term::application [ERROR] Ignoring unknown notification from Language Server: protocol error: InvalidParams: Invalid params: missing field `message`.
2024-06-16T22:23:40.556 helix_lsp::transport [ERROR] tailwindcss-ls err: <- StreamClosed
2024-06-16T22:29:44.481 helix_term::application [ERROR] Ignoring unknown notification from Language Server: protocol error: InvalidParams: Invalid params: missing field `message`.
2024-06-16T22:29:44.481 helix_term::application [ERROR] Ignoring unknown notification from Language Server: protocol error: InvalidParams: Invalid params: missing field `message`.

Leptos Dependencies

leptos_axum = { version = "0.6.11", optional = true }
leptos = { version = "0.6.11" }
leptos_meta = { version = "0.6.11" }
leptos_router = { version = "0.6.11" }
leptos-use = { version = "0.10.8" }
leptos_sse = { git = "https://github.com/messense/leptos_sse.git", branch = "main" }
hydrate = ["leptos/hydrate", "leptos_meta/hydrate", "leptos_router/hydrate"]
    "dep:leptos_axum",
    "leptos/ssr",
    "leptos_meta/ssr",
    "leptos_router/ssr",
    "leptos_sse/ssr",
    "leptos_sse/axum",

To Reproduce Helix languages.toml

[[language]]
name = "rust"
auto-format = true
language-servers = ["rust-analyzer", "tailwindcss-ls"]
roots = [
  "Cargo.toml",
  "Cargo.lock"
]

[language.auto-pairs]
'(' = ')'
'{' = '}'
'[' = ']'
'"' = '"'
'`' = '`'

[language-server.tailwindcss-ls]
command = "tailwindcss-language-server"
args = ["--stdio"]
config = {userLanguages = { rust = "html", "*.rs" = "html" } }

[language-server.rust-analyzer.config]
inlayHints.bindingModeHints.enable = false
command = "rust-analyzer"
check.command = "clippy"
inlayHints.closingBraceHints.minLines = 10
inlayHints.closureReturnTypeHints.enable = "with_block"
inlayHints.discriminantHints.enable = "fieldless"
inlayHints.lifetimeElisionHints.enable = "skip_trivial"
inlayHints.typeHints.hideClosureInitialization = false
procMacro = { ignored = { leptos_macro = [
    "server", "component"
] } } 

[language.formatter]
command = "rustfmt"

Expected behavior

Additional context

chrisp60 commented 2 days ago

Note that your table for rust analyzer is possibly mixing up the depth for some of the keys

[language-server.rust-analyzer.config] # <-- You are targeting the "config" table
inlayHints.bindingModeHints.enable = false
command = "rust-analyzer" # There is no configuration for just "command"

Definitely see if removing the config.command key fixes anything.

is that a direct copy paste from your Cargo.toml? Or are you just trying to show the relevant parts?

Also are those logs generated from running hx -v? Curious if just Rust-Analyzer or just tailwaind-ls works on its own without the other being configured.