Skip to content

fix: merlin and private_modules - #6405

Closed
rgrinberg wants to merge 1 commit into
mainfrom
ps/rr/fix__merlin_and_private_modules
Closed

rgrinberg wants to merge 1 commit into
mainfrom
ps/rr/fix__merlin_and_private_modules

Conversation

@rgrinberg

Copy link
Copy Markdown
Member

When private modules are enabled, only the public cmi directory was
passed to merlin. The end result is that all .cmt and .cmti files were
hidden causing a degraded experience. We fix this by providing the
private dir to merlin.

Signed-off-by: Rudi Grinberg [email protected]

ps-id: dc5a051b-ca65-48cf-a63f-8a61128b2cf2

When private modules are enabled, only the public cmi directory was
passed to merlin. The end result is that all .cmt and .cmti files were
hidden causing a degraded experience. We fix this by providing the
private dir to merlin.

Signed-off-by: Rudi Grinberg <[email protected]>

ps-id: dc5a051b-ca65-48cf-a63f-8a61128b2cf2
@rgrinberg
rgrinberg requested a review from voodoos November 8, 2022 03:47
@rgrinberg rgrinberg added this to the 3.6.0 milestone Nov 8, 2022
@rgrinberg rgrinberg added the merlin Merlin editor support and its interface with dune label Nov 8, 2022
@rgrinberg rgrinberg linked an issue Nov 8, 2022 that may be closed by this pull request
@voodoos

voodoos commented Nov 8, 2022

Copy link
Copy Markdown
Collaborator

Won't doing this "desynchronize" Merlin and the compiler ? If Merlin has access to the cmis of the private modules it will suggest private values during autocompletion and not report errors when using them.

@rgrinberg rgrinberg modified the milestones: 3.6.0, 3.7.0 Nov 8, 2022
@rgrinberg

Copy link
Copy Markdown
Member Author

Ah that's annoying. I guess we'll need to copy the .cmt and .cmtis to a separate folder after all.

Removed the 3.6.0 milestone as this is a bit harder.

@emillon

emillon commented Jan 30, 2023

Copy link
Copy Markdown
Collaborator

@rgrinberg do you have a fix for 3.7 or should we clear the milestone?

@rgrinberg rgrinberg modified the milestones: 3.7.0, 3.8.0 Feb 1, 2023
@rgrinberg
rgrinberg marked this pull request as draft February 28, 2023 18:31
@emillon

emillon commented Apr 19, 2023

Copy link
Copy Markdown
Collaborator

I'll clear the milestone this is is unlikely to get in 3.8.

@emillon emillon removed this from the 3.8.0 milestone Apr 19, 2023
@rgrinberg rgrinberg closed this Nov 30, 2025
anmonteiro added a commit that referenced this pull request Aug 18, 2026
…odules (#15977)

Expose dependency object directories to Merlin as annotation-only CMT
paths. CMT paths have no bearing on auto-completion, but will still
allow locate to work.

Fixes #4892. Follows #15972.


This is an alternative to these:

- #4905
- #6405

---------

Signed-off-by: Antonio Nuno Monteiro <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merlin Merlin editor support and its interface with dune

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Private modules cause missing build path (in the ocaml-merlin dump)

3 participants