这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@maxmwang
Copy link
Contributor

Builds upon features written in our internal codebase.

  • Parses [@@@merlin.document] attribute
  • Finds corresponding document entry by location

Testing

Adds unit tests for .ml and .mli files

Copy link
Contributor

@liam923 liam923 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good! I think the main things are just adding more tests and moving some more of the logic into ppx_document.ml.

@maxmwang maxmwang marked this pull request as ready for review July 22, 2025 06:36
@maxmwang maxmwang requested a review from liam923 July 22, 2025 07:32
@maxmwang maxmwang requested a review from liam923 July 23, 2025 09:34
Copy link
Contributor

@liam923 liam923 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, pretty much just one nit left.

Copy link
Contributor

@liam923 liam923 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for these changes! Feel free to merge (I think you have permission to hit the merge button?). Sidenote: in oxcaml/merlin we tend to prefer "Squash and merge" over "Create a merge commit". I think this makes the git history a lot more managable. The exception to this is when we're merging changes from upstream, in which case this can confuse git and create future merges harder.

@liam923 liam923 merged commit bc74d72 into oxcaml:ppx-improvements Jul 25, 2025
liam923 pushed a commit that referenced this pull request Jul 30, 2025
* initial working with tests

* temp update

* temp

* major refactors, add support for .mli files

* refactoring and cleanup

* move all logic into override_document.ml; cleanup code; add logging

* add many more tests; handle edge cases

* revert std.ml changes

* improve comments

* update more comments

* suggested changes

* test nested ppx

* document payload test

* some more tests

* resolve final comments

* add test on floating attribute

* add test for attribute in an extension's payload
liam923 added a commit that referenced this pull request Aug 7, 2025
* merlin document support for PPXs (#167)

* initial working with tests

* temp update

* temp

* major refactors, add support for .mli files

* refactoring and cleanup

* move all logic into override_document.ml; cleanup code; add logging

* add many more tests; handle edge cases

* revert std.ml changes

* improve comments

* update more comments

* suggested changes

* test nested ppx

* document payload test

* some more tests

* resolve final comments

* add test on floating attribute

* add test for attribute in an extension's payload

* Fix function syntax

* working parsing of new merlin.document structure

* fix document tests with new merlin.document structure

* replicate merlin.document tests for merlin.locate

* generalize comments, code for all overrides

* delete duplicate files from merge conflict

* add test overriding locate of a non-PPX

* add test on overriding default behavior of document

* format

* combine document and locate tests into single file

* adjust for new attribute structure

* update comment documenting expected attribute structure

* fix typo

* remove named parameter

* merlin locate outputs absolute paths using source_root

---------

Co-authored-by: Liam Stevenson <lstevenson@janestreet.com>
liam923 added a commit that referenced this pull request Aug 15, 2025
* merlin document support for PPXs (#167)

* initial working with tests

* temp update

* temp

* major refactors, add support for .mli files

* refactoring and cleanup

* move all logic into override_document.ml; cleanup code; add logging

* add many more tests; handle edge cases

* revert std.ml changes

* improve comments

* update more comments

* suggested changes

* test nested ppx

* document payload test

* some more tests

* resolve final comments

* add test on floating attribute

* add test for attribute in an extension's payload

* Fix function syntax

* merlin overrides: merlin locate support for PPXs (#171)

* merlin document support for PPXs (#167)

* initial working with tests

* temp update

* temp

* major refactors, add support for .mli files

* refactoring and cleanup

* move all logic into override_document.ml; cleanup code; add logging

* add many more tests; handle edge cases

* revert std.ml changes

* improve comments

* update more comments

* suggested changes

* test nested ppx

* document payload test

* some more tests

* resolve final comments

* add test on floating attribute

* add test for attribute in an extension's payload

* Fix function syntax

* working parsing of new merlin.document structure

* fix document tests with new merlin.document structure

* replicate merlin.document tests for merlin.locate

* generalize comments, code for all overrides

* delete duplicate files from merge conflict

* add test overriding locate of a non-PPX

* add test on overriding default behavior of document

* format

* combine document and locate tests into single file

* adjust for new attribute structure

* update comment documenting expected attribute structure

* fix typo

* remove named parameter

* merlin locate outputs absolute paths using source_root

---------

Co-authored-by: Liam Stevenson <lstevenson@janestreet.com>

* merlin overrides use interval tree instead of list (#173)

* interval tree interface

* interval tree implementation and basic test

* use array for construction, add more tests

* add and update comments

* fix error messages, validate inputs

* use list instead of array, add tests, add comments

* integrate into overrides.ml

* add test for empty tree

* resolve requested changes

* add test for zero-width interval

* undo test reformat

* update outdated comment

* update another oudated comment

* update comment

* Cache overrides interval trees using Phase_cache (#176)

* implementation but failing tests

* working overrides caching with tests

* add USE_PPX_CACHE, add all cache entries to tests

* update comments

* use Option.map

* move comment

* fix overrides caching mechanism, functorize caches, add cache invalidation test

* add comments, rename

* cleanup test output, and resolve other comments

* remove unnecessary sed commands from tests

* add commentsg

---------

Co-authored-by: Max Wang <orangemax888@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants