-
Notifications
You must be signed in to change notification settings - Fork 18
Can't get extension to work #20
Comments
Having the same problem here. Inlay hints are not showing no matter what. |
Hi, can you try updating neovim and rust-analyzer? I tried reproducing the issue and it seems to work for me calling the lua function directly as well as using the autocommand. Something else that could be happening is that if you are expecting the inlay hints to appear immidiately upon opening the file, your lsp server may not be connected yet. However, given the autocommand you linked, as soon as you move your cursor the request will be made and you should see the hints. Hopefully that works for you. |
I'm also having this issue, unfortunately. I'm using the latest version of neovim and rust-analyzer (the latest commits from github as of this writing). I should also have the latest I'm testing this by loading up the following file in neovim: struct Foo {
a: u8,
b: bool
}
pub fn foo() {
let b = true;
let _ = Foo {
a: 0
};
} I have the following autocmd: autocmd CursorHold,CursorHoldI *.rs :lua require'lsp_extensions'.inlay_hints{ only_current_line = true } I know that rust-analyzer is connected because I see the error line 8 (about the missing field |
Where are you expecting there to be hints with this sample? My language server doesn't return any hints for this at all. Are you sure that you want to use |
I was expecting type hints on line 7 (which is But maybe let's flip this around -- Can you give me a small sample that will provide hints? I'll test with your sample and can compare your output to what I see Thanks! |
Ah okay. Neovim doesn't support virtual text in between text so by default the only hint type that is shown is "ChainingHint". You can enable "TypeHint" and "ParameterHint" by passing in an Here is a related issue #14 I was testing in rust-analyzer by the way. |
Ah ha! I'm so sorry for the noise, then (I could have sworn that nvim used to supposed this, but clearly I am mis-remembering). Using a better test, I am indeed seeing the ChainingHints, as expected. Thank you! |
No problem! This is probably something that could be made more obvious with documentation. Maybe I'll put up a PR tonight. Hopefully this is @marcoths 's issue as well. |
@PatOConnor43 Yeah your suggestion also worked for me, many thanks! Didn't know those hints were not enabled by default |
Neovim version
NVIM v0.5.0-dev+950-g5ce328df4
Loaded the plugin in
~/.local/share/nvim/site/pack/*/start/lsp_extensions.nvim
This is the folder structure
and in my init.nvim looks like this:
But the type hints are not showing for Rust files - I have setup Rust analyzer as well, the build-in LSP features are working properly. Any idea on what else to look?
Many thanks
The text was updated successfully, but these errors were encountered: