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

ghcide analyzes the whole project on startup #12

Open
pepeiborra opened this issue May 4, 2020 · 4 comments
Open

ghcide analyzes the whole project on startup #12

pepeiborra opened this issue May 4, 2020 · 4 comments

Comments

@pepeiborra
Copy link

Compare with digital-asset/ghcide which only analyzes the files of interest.

I think this explains the issues that I shared on Friday by email while testing on a codebase with ~5000 modules which takes quite a while to load in this branch

@mpickering
Copy link
Owner

I see but this isn't a bug, it's intentional. It only calls GetModIface on all the targets so the cost should not be too severe if you already have the interface files. I imagine the issue was that this call was never completing because it was getting repeatedly cancelled?

@mpickering
Copy link
Owner

One way to improve this might be to queue all modules in a project individually with low priority rather than one big call which puts them all in the same batch.

@pepeiborra
Copy link
Author

Two questions:

  • Why would the initial call to GetModIface on all the targets would be cancelled? What would cancel it?

  • Does hover wait until this call is completed? IIRC you said that it doesn't go through shakeRun, so presumably it can happen concurrently with this call. Would it find any span infos if this call is not completed?

@mpickering
Copy link
Owner

If you look at the logic in exe/Main.hs what should happen is that first the module you requested is loaded, you get IDE features such as hover and then the other modules are loaded.

The request would be cancelled by typing but not by hovering.

I think on the branch you are using there is a potential bug which is stopping hover display earlier. Check that in the FileStore rules you are using a version where all the delayed actions are using GetSpanInfo rather than TypeCheck.

wz1000 added a commit that referenced this issue Sep 4, 2020
…encies of a file on saving (haskell#688)

* Add new command to GetModuleGraph for a session and propate changes to
modules

Only propagate changes to parent modules when saving

Typecheck files when they are opened, don't TC FOI

Add known files rule

Don't save ifaces for files with defered errors

Co-authored-by: Zubin Duggal <[email protected]>

* Add configuration for parent typechecking

* hlint ignore

* Use targets to filter located imports (#10)

* Use targets to filter located imports

* Remove import paths from the GHC session

Otherwise GHC will prioritize source files found in the import path

* Update session-loader/Development/IDE/Session.hs

Co-authored-by: Pepe Iborra <[email protected]>

* Add session-loader to hie.yaml (haskell#714)

* move known files rule to RuleTypes

* Disable checkParents on open and close document (#12)

* Really disable expensive checkParents

* Add an option to check parents on close

Co-authored-by: Matthew Pickering <[email protected]>
Co-authored-by: Pepe Iborra <[email protected]>
Co-authored-by: Luke Lau <[email protected]>
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

2 participants