-
Notifications
You must be signed in to change notification settings - Fork 147
Fix hover on method calls #1553
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
Conversation
Fixes ocaml#1552 Now object method types are correctly shown
Pull Request Test Coverage Report for Build 4929Details
💛 - Coveralls |
trefis
left a comment
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.
Perhaps the "filtering" match could be made non-fragile to avoid such issues in the future (and so every situation is properly considered)?
Side note: I feel like this code kind of duplicates what the browse tree is used for in merlin...
My feeling is that the goal of that code is distinct from the one of mbrowse. Merlin was designed around a protocol and a set of editors that require a deliberate action from users to call the type-enclosing command: thus, if the user asked, she probably expects an answer. In visual LSP-based editors, such as vscode, type-enclosing is called continuously, everywhere around the code, as soon as the cursor moves. The best effort strategy of Merlin can result in a lot of clutter, and I think it makes sense to rely on stricter filtering before answering. (I do agree that it could be worth investigating how to re-conciliate both usages with the same code paths internally.) It's also true that the opt-in nature of the current implementation make it sensible to syntax changes, additions (and omissions such as this one). However it is not a trivial task to reverse this behavior, and outside the scope of this PR. Meanwhile, we might want to check that other parsetree constructions where an ident is not actually represented by a For reference, the PR that introduced this filtering is #1245 |
xvw
left a comment
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.
I agree with the fix
(Even, I think that, in a future, providing hover as part of the Merlin protocol make sense).
|
(I guess that just running |
…rmat-mlx * 'master' of github.com:/ocaml/ocaml-lsp: Avoid NeoVim error when opening .mll files (ocaml#1557) Fix hover on method calls (ocaml#1553)
CHANGES: ## Fixes - Fix hover on method calls not showing the type. (ocaml/ocaml-lsp#1553, fixes ocaml/ocaml-lsp#1552) - Fix error on opening `.mll` files (ocaml/ocaml-lsp#1557) - Ensure compatibility with both yojson 2.0 and 3.0. (ocaml/ocaml-lsp#1534)
CHANGES: ## Fixes - Fix hover on method calls not showing the type. (ocaml/ocaml-lsp#1553, fixes ocaml/ocaml-lsp#1552) - Fix error on opening `.mll` files (ocaml/ocaml-lsp#1557) - Ensure compatibility with both yojson 2.0 and 3.0. (ocaml/ocaml-lsp#1534)
* Reproduce issue ocaml#1552 * Add missing Pexp_send case in hover filtering Fixes ocaml#1552 Now object method types are correctly shown * Add changelog entry
* Reproduce issue ocaml#1552 * Add missing Pexp_send case in hover filtering Fixes ocaml#1552 Now object method types are correctly shown * Add changelog entry
Fixes #1552
Now object method types are correctly shown.
The issue was due to a missing case in the hover filtering logic (cc @awilliambauer).