-
Notifications
You must be signed in to change notification settings - Fork 28
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
nvim-lsp: inlay hints not working? #4
Comments
Found nvim-lua/lsp_extensions.nvim#20, but the suggestion there doesn't seem to do anything for me. |
Actually they do show up, but only after editing the code? https://asciinema.org/a/wBwj7uKmjeSmN4fL8KgBuYddI Right now I have: + autocmd BufEnter,BufWinEnter,TabEnter *.rs :lua require'lsp_extensions'.inlay_hints{ prefix = '', highlight = "Comment", enabled = {"TypeHint", "ChainingHint", "ParameterHint"}} |
It will only start showing once the LSP kicks in (rust-analyzer) which for me seems to be after first write ( |
Hmm, for me LSP features are working even before a |
I can take a look at this later tonight, could you provide your config? |
Sorry, it's a bit messy: https://gist.github.com/lnicola/1276f4c205361960ffd23b1a4c2cea62 Anyway, don't worry, this doesn't seem terribly important. |
I believe it's your autocmds combination. For example, triggering any of those autocmds makes them show properly. I think what's happening is that the LSP isn't started yet when the file opens, so the request for hints fails. Could be possible to call inlay hints when the LSP is started? You could also try adding a more frequent autocmd like Here is my list: |
Let me know if you need anything else! |
I have the same problem, inlay hints stopped working for whatever reason. When I Iook at the lsp.log in
I am using the The |
Did you figure it out? Getting the same issue as well I have the rust analyzer binary installed configured correctly with native lsp and same here :LspInfo shows rust-analyzer is registered |
@Antonio-Bennett Man I have no idea. It worked for me again. But I don't remember why and what changed. No single action I took, brought it back but rather changing everything, re-installing everything out of desperation, etc. |
Lool same! Just started working all of a sudden! |
Any news about how to make this work? :) |
Hey @marcelarie I use the lsp_extensions plugin found here https://github.com/nvim-lua/lsp_extensions.nvim then I add this to my init.lua or init.vim whichever one you have vim.cmd [[ autocmd CursorMoved,InsertLeave,BufEnter,BufWinEnter,TabEnter,BufWritePost * :lua require'lsp_extensions'.inlay_hints{ prefix = '=>', highlight = "Comment", enabled = {"TypeHint", "ChainingHint", "ParameterHint"} } ]] |
@marcelarie I recommend basing off of: https://github.com/sharksforarms/vim-rust/blob/master/neovim-init-lsp-compe-rust-tools.vim This uses https://github.com/simrat39/rust-tools.nvim which supports inlay hints and more |
Ok I tried rust-tools and its really good, I am going to stick with that👌 thanks to both!! |
Ouuu Rust tools looks real nice think im gonna switch over as well 😂 |
I'm using your snippet:
Tested with
nvim 0.5.0+dev+1062+gcc1851c9f-1
.The text was updated successfully, but these errors were encountered: