-
Notifications
You must be signed in to change notification settings - Fork 41
Error when preview definition #38
Comments
which branch, if main what nvim version are you on? |
I am having the same issue. I am using the
Screenshot of error: |
I would try using the lsp builtin function
This happens when searching a definition for keywords such as the "useless" hover from saga for non-keywords: Maybe lspsaga should print a message when lspconfig wouldn't move at all, something like "you dumb are right on the definition you are asking". @typoon does the error always happen or the behaviour is consistent with what I have just described? |
So, the case where I am having this issue is in a The code I am using is the one below: ret = {};
// Add some stuff to ret here
Object.keys(ret).forEach(domain => {
// Do some stuff using the keys from `ret`
}); Now, if I try to use Here is the cursor position for both cases (on top of the letter There are cases in which the |
I am having exactly the same issue with both |
I added a It's showing me a table that starts with index 2, instead of 1:
Hence the error in my situation. I don't know anything about Lua specifically, but I reckon that's a problem. |
I think I know what's going on. I found this issue in the nvim repo, apparently vim.lsp.buf.formatting_sync uses the So to fix this, we either need to know about the clientId or use the suggestion in that issue which is to use next() to fetch the next result in the table. |
I wrote my own monkey patch using In my case, it's both
I'd say that for case 2 it's easy, just grab the result from the client that's actually worth showing. But for the other I am not sure, I think the cleanest would be just to show all the results that are given? |
Interesting issue. I'd vote for having their contents merged and split with section titled with the lsp server e.g.
and deciding what comes first based on what is most matching what the user expect i.g. valid range |
I'm having the same issue with Rescript language server, doing the same print that @wesselvdv did, I get this: { {
result = {
range = {
end = {
character = 8,
line = 0
},
start = {
character = 4,
line = 0
}
},
uri = "file:///Users/matheus.ashton/dev/pessoal/pet-manager/./src/App/Router.res"
}
} } The problem is that result is not a table of tables, is a single table itself |
try without brackets. |
Description
LspSaga preview_definition() not correct working
Expected Behavior
Actual Behavior
** Neovim version **
v0.6.0-dev
** Branch use **
Main
The text was updated successfully, but these errors were encountered: