htmx-lsp
htmx-lsp copied to clipboard
Breaks vim.lsp.buf.hover for all other LSP clients
Reproduction repo:
https://github.com/catgoose/templ_issue_repro/tree/bug/lsp_hover_and_codeaction
run:
nvim --clean -u templ.lua views/index.templ
To reproduce:
Do K over htmx attributes:
Now do K over html or templ symbols, observe that no hover occurs
Disable htmx lsp in templ.lua:
local templ_opts = {
cmd = {
"templ",
"lsp",
"-http=localhost:7474",
string.format("-log=%s/templ.log", vim.fn.expand("~")),
},
filetypes = filetypes,
root_dir = lspconfig.util.root_pattern("go.mod", ".git"),
settings = {},
}
lspconfig.html.setup({
filetypes = filetypes,
})
lspconfig.templ.setup(templ_opts)
-- lspconfig.htmx.setup({
-- filetypes = filetypes,
-- })
Now do K over HTML and Templ symbols:
I think I hit the same issue with my setup, couldn't work out what the issue was!
It looks like the issue is that in cases where htmx-lsp doesn't have any hover results to return, it simply ignores the requests rather than returning an empty response. I'm not sure if this is a bug in Neovim's client, but I believe this is somehow blocking templ's response from being correctly processed and/or displayed.
I have a fix working locally and should be able to open up a PR soon.
@MNThomson @ThePrimeagen Can we get a release created so Mason will pick up this fix?
bump ^ 🤕
Unfortunately only @ThePrimeagen has the ability to release a new version...
Unfortunately only @ThePrimeagen has the ability to release a new version...
Nice so never?