Skip to content
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

Global typechecking or Merlin vs Dune watch mode #1895

Open
nojb opened this issue Feb 12, 2025 · 0 comments
Open

Global typechecking or Merlin vs Dune watch mode #1895

nojb opened this issue Feb 12, 2025 · 0 comments

Comments

@nojb
Copy link
Contributor

nojb commented Feb 12, 2025

Hello,

I have been wondering for some time how difficult it would be to have Merlin perform whole-project typechecking instead of doing it one file at a time, as today. This is in my view the main difference between Dune watch mode and Merlin, but if Merlin could do whole-project analysis, there would be less of a need to use Dune watch mode (which is much, much slower than typechecking via Merlin in large projects). This is the way Rust analyzer https://rust-analyzer.github.io/ works and it is pretty great.

I don't know how much sense it makes in Merlin's present architecture, but, naïvely, I see Merlin maintaining a mapping from .cmi files to signatures. Whenever Merlin typechecks a file it would update the mapping with the new signature. And whenever it needs to load a persistent signature it would use the one present in the mapping, if any, rather than the one on disk.

Anyway, I thought I would bring up the question in case it triggers any interesting discussion. Thank you for your work on Merlin!

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

No branches or pull requests

1 participant