-
Notifications
You must be signed in to change notification settings - Fork 233
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
test: test enclosing type for let+ ... and+ ... in expression #1653
test: test enclosing type for let+ ... and+ ... in expression #1653
Conversation
First diagnostic: The issue is due to the typedtree nodes not respecting location inclusion / disjointness rules. Some locations issues by the parser are also very imprecise. |
I have a first improvement: it is now possible to get the type of the patterns ! |
Now the operator's types are shown too. |
74bd57b
to
ae6b50b
Compare
@@ -30,6 +30,10 @@ open Std | |||
|
|||
module Verbosity = Mconfig.Verbosity | |||
|
|||
let protect expr = |
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.
What does protect do?
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.
To get the "generic" type of the operator Merlin needs to parse it and type it. But let++
is not valid syntax so adding parenthesis (let++)
is required for it to parse correctly. The protect function uses a function from compiler libs to determine is the expression requires parenthesizing before parsing.
Signed-off-by: Ali Caglayan <[email protected]>
This should allow Merlin to get the correct node when the cursor is on a pattern or it's rhs. Right now it is not possible to get the type of the operator.
ae6b50b
to
761822b
Compare
Thanks @voodoos! |
test: test enclosing type for let+ ... and+ ... in expression from Alizter/ps/branch/test__test_enclosing_type_for_let______and______in_expression
test: test enclosing type for let+ ... and+ ... in expression from Alizter/ps/branch/test__test_enclosing_type_for_let______and______in_expression
CHANGES: Thu Aug 24 17:17:42 CEST 2023 + merlin binary - Constrain socket path buffer size to avoid build warnings (ocaml/merlin#1631) - Handle concurrent server start (ocaml/merlin#1622) - Omit module prefixes for constructors and record fields in the `construct` command (ocaml/merlin#1618). Prefixes are still produced when warning 42 (disambiguated name) is active. - Correctly invalidate PPX cache when pipeline ran partially (ocaml/merlin#1650, fixes ocaml/merlin#1647) - Prevent `short-path` from looping in some cases related to recursive type definitions (ocaml/merlin#1645) - Support parsing negative numbers in sexps (ocaml/merlin#1655) - Fix construct not working with inline records (ocaml/merlin#1658) - Improve behavior of `type-enclosing` on let/and operators (ocaml/merlin#1653) - Fix occurrences of extension constructors (ocaml/merlin#1662) - Improve node selection when ghosts are present (ocaml/merlin#1664, fixes ocaml/merlin#1660) + editor modes - emacs: call merlin-client-logger with "interrupted" if the merlin binary itself is interrupted, not just the parsing of the result (ocaml/merlin#1626). - emacs: merlin-construct, with a prefix argument, now includes local values in the completion options. Alternatively, this behavior can be enabled permanently by customizing `merlin-construct-with-local-values` (ocaml/merlin#1644) - emacs: add support for opam-switch-mode (ocaml/merlin#1654, fixes ocaml/merlin#1591). See <https://github.com/ProofGeneral/opam-switch-mode>
CHANGES: Thu Aug 24 17:17:42 CEST 2023 + merlin binary - Constrain socket path buffer size to avoid build warnings (ocaml/merlin#1631) - Handle concurrent server start (ocaml/merlin#1622) - Omit module prefixes for constructors and record fields in the `construct` command (ocaml/merlin#1618). Prefixes are still produced when warning 42 (disambiguated name) is active. - Correctly invalidate PPX cache when pipeline ran partially (ocaml/merlin#1650, fixes ocaml/merlin#1647) - Prevent `short-path` from looping in some cases related to recursive type definitions (ocaml/merlin#1645) - Support parsing negative numbers in sexps (ocaml/merlin#1655) - Fix construct not working with inline records (ocaml/merlin#1658) - Improve behavior of `type-enclosing` on let/and operators (ocaml/merlin#1653) - Fix occurrences of extension constructors (ocaml/merlin#1662) - Improve node selection when ghosts are present (ocaml/merlin#1664, fixes ocaml/merlin#1660) + editor modes - emacs: call merlin-client-logger with "interrupted" if the merlin binary itself is interrupted, not just the parsing of the result (ocaml/merlin#1626). - emacs: merlin-construct, with a prefix argument, now includes local values in the completion options. Alternatively, this behavior can be enabled permanently by customizing `merlin-construct-with-local-values` (ocaml/merlin#1644) - emacs: add support for opam-switch-mode (ocaml/merlin#1654, fixes ocaml/merlin#1591). See <https://github.com/ProofGeneral/opam-switch-mode>
CHANGES: Thu Aug 24 17:17:42 CEST 2023 + merlin binary - Constrain socket path buffer size to avoid build warnings (ocaml/merlin#1631) - Handle concurrent server start (ocaml/merlin#1622) - Omit module prefixes for constructors and record fields in the `construct` command (ocaml/merlin#1618). Prefixes are still produced when warning 42 (disambiguated name) is active. - Correctly invalidate PPX cache when pipeline ran partially (ocaml/merlin#1650, fixes ocaml/merlin#1647) - Prevent `short-path` from looping in some cases related to recursive type definitions (ocaml/merlin#1645) - Support parsing negative numbers in sexps (ocaml/merlin#1655) - Fix construct not working with inline records (ocaml/merlin#1658) - Improve behavior of `type-enclosing` on let/and operators (ocaml/merlin#1653) - Fix occurrences of extension constructors (ocaml/merlin#1662) - Improve node selection when ghosts are present (ocaml/merlin#1664, fixes ocaml/merlin#1660) + editor modes - emacs: call merlin-client-logger with "interrupted" if the merlin binary itself is interrupted, not just the parsing of the result (ocaml/merlin#1626). - emacs: merlin-construct, with a prefix argument, now includes local values in the completion options. Alternatively, this behavior can be enabled permanently by customizing `merlin-construct-with-local-values` (ocaml/merlin#1644) - emacs: add support for opam-switch-mode (ocaml/merlin#1654, fixes ocaml/merlin#1591). See <https://github.com/ProofGeneral/opam-switch-mode>
CHANGES: Thu Aug 24 17:17:42 CEST 2023 + merlin binary - Constrain socket path buffer size to avoid build warnings (ocaml/merlin#1631) - Handle concurrent server start (ocaml/merlin#1622) - Omit module prefixes for constructors and record fields in the `construct` command (ocaml/merlin#1618). Prefixes are still produced when warning 42 (disambiguated name) is active. - Correctly invalidate PPX cache when pipeline ran partially (ocaml/merlin#1650, fixes ocaml/merlin#1647) - Prevent `short-path` from looping in some cases related to recursive type definitions (ocaml/merlin#1645) - Support parsing negative numbers in sexps (ocaml/merlin#1655) - Fix construct not working with inline records (ocaml/merlin#1658) - Improve behavior of `type-enclosing` on let/and operators (ocaml/merlin#1653) - Fix occurrences of extension constructors (ocaml/merlin#1662) - Improve node selection when ghosts are present (ocaml/merlin#1664, fixes ocaml/merlin#1660) + editor modes - emacs: call merlin-client-logger with "interrupted" if the merlin binary itself is interrupted, not just the parsing of the result (ocaml/merlin#1626). - emacs: merlin-construct, with a prefix argument, now includes local values in the completion options. Alternatively, this behavior can be enabled permanently by customizing `merlin-construct-with-local-values` (ocaml/merlin#1644) - emacs: add support for opam-switch-mode (ocaml/merlin#1654, fixes ocaml/merlin#1591). See <https://github.com/ProofGeneral/opam-switch-mode>
CHANGES: Thu Aug 24 17:17:42 CEST 2023 + merlin binary - Constrain socket path buffer size to avoid build warnings (ocaml/merlin#1631) - Handle concurrent server start (ocaml/merlin#1622) - Omit module prefixes for constructors and record fields in the `construct` command (ocaml/merlin#1618). Prefixes are still produced when warning 42 (disambiguated name) is active. - Correctly invalidate PPX cache when pipeline ran partially (ocaml/merlin#1650, fixes ocaml/merlin#1647) - Prevent `short-path` from looping in some cases related to recursive type definitions (ocaml/merlin#1645) - Support parsing negative numbers in sexps (ocaml/merlin#1655) - Fix construct not working with inline records (ocaml/merlin#1658) - Improve behavior of `type-enclosing` on let/and operators (ocaml/merlin#1653) - Fix occurrences of extension constructors (ocaml/merlin#1662) - Improve node selection when ghosts are present (ocaml/merlin#1664, fixes ocaml/merlin#1660) + editor modes - emacs: call merlin-client-logger with "interrupted" if the merlin binary itself is interrupted, not just the parsing of the result (ocaml/merlin#1626). - emacs: merlin-construct, with a prefix argument, now includes local values in the completion options. Alternatively, this behavior can be enabled permanently by customizing `merlin-construct-with-local-values` (ocaml/merlin#1644) - emacs: add support for opam-switch-mode (ocaml/merlin#1654, fixes ocaml/merlin#1591). See <https://github.com/ProofGeneral/opam-switch-mode>
CHANGES: Thu Aug 24 17:17:42 CEST 2023 + merlin binary - Constrain socket path buffer size to avoid build warnings (ocaml/merlin#1631) - Handle concurrent server start (ocaml/merlin#1622) - Omit module prefixes for constructors and record fields in the `construct` command (ocaml/merlin#1618). Prefixes are still produced when warning 42 (disambiguated name) is active. - Correctly invalidate PPX cache when pipeline ran partially (ocaml/merlin#1650, fixes ocaml/merlin#1647) - Prevent `short-path` from looping in some cases related to recursive type definitions (ocaml/merlin#1645) - Support parsing negative numbers in sexps (ocaml/merlin#1655) - Fix construct not working with inline records (ocaml/merlin#1658) - Improve behavior of `type-enclosing` on let/and operators (ocaml/merlin#1653) - Fix occurrences of extension constructors (ocaml/merlin#1662) - Improve node selection when ghosts are present (ocaml/merlin#1664, fixes ocaml/merlin#1660) + editor modes - emacs: call merlin-client-logger with "interrupted" if the merlin binary itself is interrupted, not just the parsing of the result (ocaml/merlin#1626). - emacs: merlin-construct, with a prefix argument, now includes local values in the completion options. Alternatively, this behavior can be enabled permanently by customizing `merlin-construct-with-local-values` (ocaml/merlin#1644) - emacs: add support for opam-switch-mode (ocaml/merlin#1654, fixes ocaml/merlin#1591). See <https://github.com/ProofGeneral/opam-switch-mode>
This demonstrates that type enclosing has the incorrect behaviour for letop's with multiple ands.