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
fix(peek): make sure popup_options are positive #2373
Conversation
656bc93
to
b0f3d91
Compare
Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚀
this entire function might have to be removed/refactored If #2369 is still broken, since it's relying on internal functions that aren't guaranteed to not change.
@abzcoding I edited the file When I'm trying to "peek definition" of a symbol from a library I get the same error, except the line number in the call steck is now 44 (which means the code lines I added took effect).
So I would say no, the changes don't fix the bug. |
@kylo252 I think instead of @otto-gebb can you test this instead? opts = vim.lsp.util.make_floating_popup_options(math.max(width, 30), math.max(height,10) , opts) |
@abzcoding with the latest proposed change (math.max) I get a different error:
|
can you add this after the print(vim.inspect(range))
opts = vim.lsp.util.make_floating_popup_options(math.max(width, 30), math.max(height, 10), opts) |
@abzcoding sure. Had to execute |
@otto-gebb sorry to bother you again, but could you add this one as well and get a screenshot print(vim.inspect(contents)) -- this is the new one
print(vim.inspect(range))
opts = vim.lsp.util.make_floating_popup_options(math.max(width, 30), math.max(height, 10), opts) |
@abzcoding here you go: BTW, using the debug output technique you showed I printed the values of |
yeah it seems like print(vim.inspect(location))
print(bufnr) on top of them |
Yeah, I agree. We should print an error if LSP cannot find the proper content. Thank you for helping through the debugging process |
Description
@otto-gebb can you verify if this fixes your issue or not?
Fixes #2369