Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup with rust and leptos? #42

Open
brunobmello25 opened this issue Jan 22, 2024 · 2 comments
Open

setup with rust and leptos? #42

brunobmello25 opened this issue Jan 22, 2024 · 2 comments

Comments

@brunobmello25
Copy link

I'm not entirely sure if this is the proper way to ask for it, but I was wondering if there is a way to setup this lsp in a way that recognizes when I'm in a rust file that has leptos templates, and when it occurs, enable htmx lsp?

@MNThomson
Copy link
Collaborator

What I believe youre asking for is Embedded/Injected Languages. It looks like tree-sitter has support but that doesn't look like it extends to language servers.

There seems to be other people wondering the same (albeit for different languages), but the current stance of neovim seems to be "no".

I'm not sure if this is possible at the lsp level (unless htmx-lsp supported every language)

@maroider
Copy link

maroider commented Mar 14, 2024

They way I understand it, the language server protocol would ideally have some built-in way of doing it, but this isn't the world we live in. There were a few issues open on the LSP spec repo requesting embedded language support on the protocol level. They all got closed with a proposed plan, but the PR that apparently was supposed to be the first step towards something better than the status quo has been untouched for 3 years now. (The protocol now has "notebook document" support (for Jupyter, I suppose). It might be the case that a host language server could (a)buse this to support foreign language embedding, but I'm not familiar enough with the inner working of language servers to tell either way.)

The other editor-agnostic way of doing it is having the host language's language server support this kind of embedding by invoking other language servers itself, though I'm not sure there's any language server currently implementing a generic mechanism for this. There is a feature request for something like this in rust-analyzer, but I don't think that's going anywhere any time soon given the "hard" and "unactionable" labels on the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants