Replace custom "holes" AST nodes by extensions to restore binary compatibility#1503
Merged
voodoos merged 4 commits intoocaml:masterfrom Sep 5, 2022
Merged
Replace custom "holes" AST nodes by extensions to restore binary compatibility#1503voodoos merged 4 commits intoocaml:masterfrom
voodoos merged 4 commits intoocaml:masterfrom
Conversation
antalsz
suggested changes
Aug 31, 2022
Contributor
antalsz
left a comment
There was a problem hiding this comment.
Thanks for making this change, it looks great! I went ahead and gave it some review, since we're excited to roll it out internally; I just had a couple small comments.
src/ocaml/typing/untypeast.ml
Outdated
Comment on lines
+521
to
+522
| let id = Location.mkloc "merlin.hole" loc in | ||
| Pexp_extension (id, PStr []) |
Contributor
There was a problem hiding this comment.
We've imported Ast_helpers, so this can just be Exp.hole (), I believe
Collaborator
Author
There was a problem hiding this comment.
Exp.hole () has type expression but expression_desc is expected here so we cannot use it. It is probably enough to only factor the merlin.hole name out.
src/ocaml/typing/untypeast.ml
Outdated
Comment on lines
+685
to
+686
| let id = Location.mkloc "merlin.hole" loc in | ||
| Pmod_extension (id, PStr []) |
Contributor
There was a problem hiding this comment.
We've imported Ast_helpers, so this can just be Mod.hole (), I believe
d8d9744 to
6131b74
Compare
- silence the "relocation in read-only section `.text'" warning happening on wome x86_32 systems
This restores binary compatibility with external tools like PPX.
35a41e5 to
576f3bf
Compare
Collaborator
Author
|
@antalsz merged :-) |
antalsz
added a commit
to oxcaml/merlin
that referenced
this pull request
Sep 29, 2022
…inary compatibility" (ocaml/merlin#1503) by @voodoos
antalsz
added a commit
to oxcaml/merlin
that referenced
this pull request
Sep 29, 2022
…inary compatibility" (ocaml/merlin#1503) by @voodoos
voodoos
added a commit
to voodoos/merlin
that referenced
this pull request
Nov 23, 2022
from voodoos/holes-in-ppx Replace custom "holes" AST nodes by extensions to restore binary compatibility
voodoos
added a commit
that referenced
this pull request
Nov 24, 2022
from voodoos/holes-in-ppx Replace custom "holes" AST nodes by extensions to restore binary compatibility
voodoos
added a commit
to voodoos/opam-repository
that referenced
this pull request
Nov 24, 2022
CHANGES:
Thu Nov 24 13:31:42 CEST 2022
+ merlin binary
- Replace custom "holes" AST nodes by extensions. This restores binary
compatibility and fixes issues with PPXs when using typed-holes.
(ocaml/merlin#1503)
- Do not change temporarily Merlin's cwd when starting a PPX (ocaml/merlin#1521,
fixes ocaml/merlin#1420)
- Fix a parsing issue when declaring the `(??)` custom prefix operator.
(ocaml/merlin#1507, fixes ocaml/merlin#1506)
- Fix variant constructors' comments grouping (ocaml/merlin#1516, @mheiber, fixes ocaml/merlin#1513)
- Filter-out duplicates from the `enclosing` command result (ocaml/merlin#1512)
- Add a new `verbosity=smart` mode for type enclosing that only expand
modules' types (ocaml/merlin#1374, @ulugbekna)
- Improve locate for labels' declarations in the current buffer.
(ocaml/merlin#1505, fixes ocaml/merlin#1524)
- Fix locate on module without implementation (ocaml/merlin#1522, fixes ocaml/merlin#1519)
- Allow program name customization when merlin is used as a library. (ocaml/merlin#1532)
+ editor modes
- vim: load the plugin when necessary if it wasn't loaded before (ocaml/merlin#1511)
- emacs: update CI for newer releases and fix some warnings (ocaml/merlin#1454,
@mattiase)
+ test suite
- Add tests for constructors' documentation (ocaml/merlin#1511)
- Add test cases for label comment documentation (ocaml/merlin#1526, @mheiber)
- Add a test for the `enclosing` command (ocaml/merlin#1512)
- Add tests for interactions between locate and record labels (ocaml/merlin#1505)
- Add test showing an issue with locate and implicit transitive deps
voodoos
added a commit
to voodoos/opam-repository
that referenced
this pull request
Nov 24, 2022
CHANGES:
Thu Nov 24 13:31:42 CEST 2022
+ merlin binary
- Replace custom "holes" AST nodes by extensions. This restores binary
compatibility and fixes issues with PPXs when using typed-holes.
(ocaml/merlin#1503)
- Fix a parsing issue when declaring the `(??)` custom prefix operator.
(ocaml/merlin#1507, fixes ocaml/merlin#1506)
- Fix variant constructors' comments grouping (ocaml/merlin#1516, @mheiber, fixes ocaml/merlin#1513)
- Filter-out duplicates from the `enclosing` command result (ocaml/merlin#1512)
+ editor modes
- vim: load the plugin when necessary if it wasn't loaded before (ocaml/merlin#1511)
+ test suite
- Add tests for constructors' documentation (ocaml/merlin#1511)
- Add test cases for label comments documentation (ocaml/merlin#1526, @mheiber)
- Add a test for the `enclosing` command (ocaml/merlin#1512)
voodoos
added a commit
to voodoos/opam-repository
that referenced
this pull request
Nov 24, 2022
CHANGES:
Thu Nov 24 13:31:42 CEST 2022
+ merlin binary
- Replace custom "holes" AST nodes by extensions. This restores binary
compatibility and fixes issues with PPXs when using typed-holes.
(ocaml/merlin#1503)
- Fix a parsing issue when declaring the `(??)` custom prefix operator.
(ocaml/merlin#1507, fixes ocaml/merlin#1506)
- Fix variant constructors' comments grouping (ocaml/merlin#1516, @mheiber, fixes ocaml/merlin#1513)
- Filter-out duplicates from the `enclosing` command result (ocaml/merlin#1512)
+ editor modes
- vim: load the plugin when necessary if it wasn't loaded before (ocaml/merlin#1511)
+ test suite
- Add tests for constructors' documentation (ocaml/merlin#1511)
- Add test cases for label comment documentation (ocaml/merlin#1526, @mheiber)
- Add a test for the `enclosing` command (ocaml/merlin#1512)
voodoos
added a commit
to voodoos/opam-repository
that referenced
this pull request
Nov 24, 2022
CHANGES:
+ merlin binary
- Replace custom "holes" AST nodes by extensions. This restores binary
compatibility and fixes issues with PPXs when using typed-holes.
(ocaml/merlin#1503)
- Do not change temporarily Merlin's cwd when starting a PPX (ocaml/merlin#1521,
fixes ocaml/merlin#1420)
- Fix a parsing issue when declaring the `(??)` custom prefix operator.
(ocaml/merlin#1507, fixes ocaml/merlin#1506)
- Fix variant constructors' comments grouping (ocaml/merlin#1516, @mheiber, fixes ocaml/merlin#1513)
- Filter-out duplicates from the `enclosing` command result (ocaml/merlin#1512)
- Add a new `verbosity=smart` mode for type enclosing that only expand
modules' types (ocaml/merlin#1374, @ulugbekna)
- Improve locate for labels' declarations in the current buffer.
(ocaml/merlin#1505, fixes ocaml/merlin#1524)
- Fix locate on module without implementation (ocaml/merlin#1522, fixes ocaml/merlin#1519)
- Allow program name customization when merlin is used as a library. (ocaml/merlin#1532)
+ editor modes
- vim: load the plugin when necessary if it wasn't loaded before (ocaml/merlin#1511)
- emacs: update CI for newer releases and fix some warnings (ocaml/merlin#1454,
@mattiase)
+ test suite
- Add tests for constructors' documentation (ocaml/merlin#1511)
- Add test cases for label comment documentation (ocaml/merlin#1526, @mheiber)
- Add a test for the `enclosing` command (ocaml/merlin#1512)
- Add tests for interactions between locate and record labels (ocaml/merlin#1505)
- Add test showing an issue with locate and implicit transitive deps
[new release] merlin (4.7-413)
CHANGES:
+ merlin binary
- Replace custom "holes" AST nodes by extensions. This restores binary
compatibility and fixes issues with PPXs when using typed-holes.
(ocaml/merlin#1503)
- Fix a parsing issue when declaring the `(??)` custom prefix operator.
(ocaml/merlin#1507, fixes ocaml/merlin#1506)
- Fix variant constructors' comments grouping (ocaml/merlin#1516, @mheiber, fixes ocaml/merlin#1513)
- Filter-out duplicates from the `enclosing` command result (ocaml/merlin#1512)
+ editor modes
- vim: load the plugin when necessary if it wasn't loaded before (ocaml/merlin#1511)
+ test suite
- Add tests for constructors' documentation (ocaml/merlin#1511)
- Add test cases for label comments documentation (ocaml/merlin#1526, @mheiber)
- Add a test for the `enclosing` command (ocaml/merlin#1512)
[new release] merlin (4.7-412)
CHANGES:
+ merlin binary
- Replace custom "holes" AST nodes by extensions. This restores binary
compatibility and fixes issues with PPXs when using typed-holes.
(ocaml/merlin#1503)
- Fix a parsing issue when declaring the `(??)` custom prefix operator.
(ocaml/merlin#1507, fixes ocaml/merlin#1506)
- Fix variant constructors' comments grouping (ocaml/merlin#1516, @mheiber, fixes ocaml/merlin#1513)
- Filter-out duplicates from the `enclosing` command result (ocaml/merlin#1512)
+ editor modes
- vim: load the plugin when necessary if it wasn't loaded before (ocaml/merlin#1511)
+ test suite
- Add tests for constructors' documentation (ocaml/merlin#1511)
- Add test cases for label comment documentation (ocaml/merlin#1526, @mheiber)
- Add a test for the `enclosing` command (ocaml/merlin#1512)
voodoos
added a commit
to voodoos/opam-repository
that referenced
this pull request
Nov 24, 2022
CHANGES:
Thu Nov 24 17:49:42 CEST 2022
+ merlin binary
- Replace custom "holes" AST nodes by extensions. This restores binary
compatibility and fixes issues with PPXs when using typed-holes.
(ocaml/merlin#1503)
- Do not change temporarily Merlin's cwd when starting a PPX (ocaml/merlin#1521,
fixes ocaml/merlin#1420)
- Fix a parsing issue when declaring the `(??)` custom prefix operator.
(ocaml/merlin#1507, fixes ocaml/merlin#1506)
- Fix variant constructors' comments grouping (ocaml/merlin#1516, @mheiber, fixes ocaml/merlin#1513)
- Filter-out duplicates from the `enclosing` command result (ocaml/merlin#1512)
- Add a new `verbosity=smart` mode for type enclosing that only expand
modules' types (ocaml/merlin#1374, @ulugbekna)
- Improve locate for labels' declarations in the current buffer.
(ocaml/merlin#1505, fixes ocaml/merlin#1524)
- Fix locate on module without implementation (ocaml/merlin#1522, fixes ocaml/merlin#1519)
- Allow program name customization when merlin is used as a library. (ocaml/merlin#1532)
+ editor modes
- vim: load the plugin when necessary if it wasn't loaded before (ocaml/merlin#1511)
- emacs: update CI for newer releases and fix some warnings (ocaml/merlin#1454,
@mattiase)
+ test suite
- Add tests for constructors' documentation (ocaml/merlin#1511)
- Add test cases for label comment documentation (ocaml/merlin#1526, @mheiber)
- Add a test for the `enclosing` command (ocaml/merlin#1512)
- Add tests for interactions between locate and record labels (ocaml/merlin#1505)
- Add test showing an issue with locate and implicit transitive deps
voodoos
added a commit
to voodoos/opam-repository
that referenced
this pull request
Nov 24, 2022
CHANGES:
+ merlin binary
- Replace custom "holes" AST nodes by extensions. This restores binary
compatibility and fixes issues with PPXs when using typed-holes.
(ocaml/merlin#1503)
- Do not change temporarily Merlin's cwd when starting a PPX (ocaml/merlin#1521,
fixes ocaml/merlin#1420)
- Fix a parsing issue when declaring the `(??)` custom prefix operator.
(ocaml/merlin#1507, fixes ocaml/merlin#1506)
- Fix variant constructors' comments grouping (ocaml/merlin#1516, @mheiber, fixes ocaml/merlin#1513)
- Filter-out duplicates from the `enclosing` command result (ocaml/merlin#1512)
- Add a new `verbosity=smart` mode for type enclosing that only expand
modules' types (ocaml/merlin#1374, @ulugbekna)
- Improve locate for labels' declarations in the current buffer.
(ocaml/merlin#1505, fixes ocaml/merlin#1524)
- Fix locate on module without implementation (ocaml/merlin#1522, fixes ocaml/merlin#1519)
- Allow program name customization when merlin is used as a library. (ocaml/merlin#1532)
+ editor modes
- vim: load the plugin when necessary if it wasn't loaded before (ocaml/merlin#1511)
- emacs: update CI for newer releases and fix some warnings (ocaml/merlin#1454,
@mattiase)
+ test suite
- Add tests for constructors' documentation (ocaml/merlin#1511)
- Add test cases for label comment documentation (ocaml/merlin#1526, @mheiber)
- Add a test for the `enclosing` command (ocaml/merlin#1512)
- Add tests for interactions between locate and record labels (ocaml/merlin#1505)
- Add test showing an issue with locate and implicit transitive deps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is currently an issue with Merlin's new typed holes and ppxes.
Since these holes were added as new AST node ppxes crash in there presence.
This PR removes these new parsetree nodes and restore the old extension-based ones.
We still keep the typedtree nodes that improve the typing if these holes.
I added a test with a custom ppx that shows the error. However this requires to have
ppxlibas a test-only dependency for themerlinpackage. @trefis I know you were wary about doing that, but it really looks like the easiest way to test ppxes in the the testsuite, do you see another option ?cc @lpw25