Fixes random documentation fetched on hover#1339
Fixes random documentation fetched on hover#1339ulugbekna wants to merge 3 commits intoocaml:masterfrom
Conversation
71fe16e to
ac77d79
Compare
|
Firstly, thanks for tackling this. It's quite an annoying issue, and our users would greatly benefit if it is addressed. As for the fix itself, I'm not convinced this fixes the issue in all cases. As far as I understand, the bug is caused by a heuristic returning a false positive. What this PR does is change the heuristic based lookup to look inside a different list of comments - the one provided to the function rather than the one picked up through the search. What is to stop this from picking up false positives in other circumstances? |
Hm, let me explain how I see this all, and you can tell me if I'm missing something. The bug is that when we request documentation for position
To sum up, I think what's happening is when we fail to find documentation for position Something I don't understand is why that code was there in the first place -- maybe there are cases when we do want that behavior. |
ac77d79 to
2c0f66b
Compare
|
@trefis, your input on this PR would also be appreciated :-) This is one of the most frequently reported issues in ocaml-lsp. The most recent report was by craigfe |
Fixes the issue reported in ocaml/ocaml-lsp#344 (the link contains the reported issue and some investigation work 🕵️ ), where documentation for the last hovered or completed file is shown for the current file.
The reported issue:
Re: fix
The fix removes code that looked for documentation in "last visited" file (a "visit" to a file is made by completion or type-enclosing request, for example). Maybe I'm missing where this behavior is necessary, but so far doc-on-hover behavior works well for me, and no tests are failing.