Skip to content

Modify cms format for ocaml-index#2886

Merged
liam923 merged 12 commits intomainfrom
liam-ocaml-index-cms
Aug 13, 2024
Merged

Modify cms format for ocaml-index#2886
liam923 merged 12 commits intomainfrom
liam-ocaml-index-cms

Conversation

@liam923
Copy link
Copy Markdown
Contributor

@liam923 liam923 commented Aug 2, 2024

To support project wide occurrences, in the short term, cms files need to contain the loadpath and initial environment, along with the text of an identifier. This is information that can likely be removed in the future, but this will get us to a working initial version faster.

Also, this PR updates the cms_uid_to_loc field to carry a location that is more desirable. Merlin uses this field to tie a uid to a definition location: https://github.com/janestreet/merlin-jst/blob/main/src/analysis/locate.ml#L224. When using cmts, Merlin returns the location of the name in the definition, via a utility function loc_of_decl. When using cms files, it uses the location stored in cms_uid_to_loc. But currently, the location stored in cms_uid_to_loc is the location of the entire definition. This PR copies Merlin's loc_of_decl (with some slight modifications) and uses the location returned by it for cms_uid_to_loc. This will make Merlin's behavior consistent between cms and cmt files.

@liam923 liam923 requested a review from goldfirere August 2, 2024 14:55
@liam923 liam923 force-pushed the liam-ocaml-index-cms branch from c69f6d2 to 4ccb2ae Compare August 12, 2024 20:33
@liam923 liam923 merged commit 3f0c26a into main Aug 13, 2024
@liam923 liam923 deleted the liam-ocaml-index-cms branch August 13, 2024 16:13
ITO444 pushed a commit to ITO444/flambda-backend that referenced this pull request Aug 14, 2024
* Modify cms format

* Convert cms_uid_to_loc to be an array

* Add crs

* Add comment to need_to_clear_env

* Remove debugging type annotation

* Convert directly to array

* Remove loadpath from cms

* Guard initial_env behind -bin-annot-occurrences

* Revert "Convert directly to array"

This reverts commit fc1857f.

* Directly use array

* Revert "Directly use array"

This reverts commit 4ccb2ae.

* Revert "Convert cms_uid_to_loc to be an array"

This reverts commit 808b35b.
lukemaurer pushed a commit to lukemaurer/flambda-backend that referenced this pull request Oct 23, 2024
* Modify cms format

* Convert cms_uid_to_loc to be an array

* Add crs

* Add comment to need_to_clear_env

* Remove debugging type annotation

* Convert directly to array

* Remove loadpath from cms

* Guard initial_env behind -bin-annot-occurrences

* Revert "Convert directly to array"

This reverts commit fc1857f.

* Directly use array

* Revert "Directly use array"

This reverts commit 4ccb2ae.

* Revert "Convert cms_uid_to_loc to be an array"

This reverts commit 808b35b.
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