dmmulroy / ts-error-translator.nvim

MIT License
264 stars 5 forks source link

What should i do to see the error "window" #29

Closed danyalutsevich closed 1 month ago

danyalutsevich commented 1 month ago

When Im draggin my cursor over the line with error the "window" with error do not show up what am I doin wrong?

Screenshot 2024-10-05 at 23 47 43
pmwals09 commented 1 month ago

If I had to guess, you aren't triggering the "hover" function. See here: https://neovim.io/doc/user/lsp.html#vim.lsp.buf.hover()

Not sure how experienced you are w/ neovim - a "hover" with the terminal cursor isn't like a "hover" with the mouse cursor in VSCode. You need to trigger a "hover" action, which vim.lsp.buf.hover() does. I think the default keybind is "K" in insert mode. You can also type :lua vim.lsp.buf.hover() to trigger it manually.

danyalutsevich commented 1 month ago

forgot to try "K" but still dont work if that helps there is my config https://github.com/danyalutsevich/nvim/blob/base/lua/plugins/ts-error-translator.lua

danyalutsevich commented 1 month ago

it it shows only type description

Screenshot 2024-10-06 at 01 36 21
danyalutsevich commented 1 month ago

@pmwals09 any ideas? thank you in advice

bren-do commented 1 month ago

I seem to have the same issue. In my setup, based very heavily on kickstart.nvim, vim.lsp.buf.hover() returns type information instead of the error translation. I have included the plugin without overriding any defaults, and am using vtsls as my LSP. Is there anything we need to do to manage which of these behaviours is triggered by K?

bren-do commented 1 month ago

@danyalutsevich I figured it out. It's not triggered by hover(), it's triggered by :lua vim.diagnostic.open_float()

danyalutsevich commented 1 month ago

@bren-do oh thanks man. It works

danyalutsevich commented 1 month ago

i think this issue can be closed