-
Notifications
You must be signed in to change notification settings - Fork 94
Conversation
- extract getModSummaryFromImports and fix diagnostics - replace GetParsedModule by GetModSummary where possible There is only one usage of GetParsedModule left, and that is in GetSpanInfos for documentation. This the wrong approach, docs should be loaded from interface files and not from sources. TODO
Progress notifications are not being sent anymore
Instead, embed haddocks in interface files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments but overall looks good.
50240fb
to
f3d397b
Compare
An annoying problem I immediately ran into, if a module fails to parse because of the |
I am also getting a lot of traces which I assume should be removed.
|
Ah, my bad, those traces were not intended for this PR. Will fix UPDATE: fixed |
Yup, that’s going to be annoying. First workaround that comes to mind is parse again without |
If Opt_Haddock is not enabled we parse twice to capture Haddock parse errors
I have gone with a different solution: parse files of interest twice, with and without |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you so much! Sorry for taking ages to review this.
* Create rule to get ModSummary without parsing entire source file * Load file source from disk if not available in memory * Fix build after cherry pick * Couple of fixes - extract getModSummaryFromImports and fix diagnostics - replace GetParsedModule by GetModSummary where possible There is only one usage of GetParsedModule left, and that is in GetSpanInfos for documentation. This the wrong approach, docs should be loaded from interface files and not from sources. TODO * Fix watched file tests Progress notifications are not being sent anymore * Compat with GHC 8.6 * Avoid parsing source files for completions and documentation Instead, embed haddocks in interface files * Allow CPP in module * Force things after parsing in order to release buffers * avoid holding on to stringbuffer unnecessarily * Skip unnecessary file contents read * Drop HscEnv requirement * Add comments on forcing things * Add comments on GHC_LIB restriction * Parse files of interest twice to capture Haddock errors If Opt_Haddock is not enabled we parse twice to capture Haddock parse errors * Parallelize two-pass parsing * Update src/Development/IDE/Core/Compile.hs Co-authored-by: Marcelo Lazaroni <lazaronijunior@gmail.com> Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* Create rule to get ModSummary without parsing entire source file * Load file source from disk if not available in memory * Fix build after cherry pick * Couple of fixes - extract getModSummaryFromImports and fix diagnostics - replace GetParsedModule by GetModSummary where possible There is only one usage of GetParsedModule left, and that is in GetSpanInfos for documentation. This the wrong approach, docs should be loaded from interface files and not from sources. TODO * Fix watched file tests Progress notifications are not being sent anymore * Compat with GHC 8.6 * Avoid parsing source files for completions and documentation Instead, embed haddocks in interface files * Allow CPP in module * Force things after parsing in order to release buffers * avoid holding on to stringbuffer unnecessarily * Skip unnecessary file contents read * Drop HscEnv requirement * Add comments on forcing things * Add comments on GHC_LIB restriction * Parse files of interest twice to capture Haddock errors If Opt_Haddock is not enabled we parse twice to capture Haddock parse errors * Parallelize two-pass parsing * Update src/Development/IDE/Core/Compile.hs Co-authored-by: Marcelo Lazaroni <lazaronijunior@gmail.com> Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* Create rule to get ModSummary without parsing entire source file * Load file source from disk if not available in memory * Fix build after cherry pick * Couple of fixes - extract getModSummaryFromImports and fix diagnostics - replace GetParsedModule by GetModSummary where possible There is only one usage of GetParsedModule left, and that is in GetSpanInfos for documentation. This the wrong approach, docs should be loaded from interface files and not from sources. TODO * Fix watched file tests Progress notifications are not being sent anymore * Compat with GHC 8.6 * Avoid parsing source files for completions and documentation Instead, embed haddocks in interface files * Allow CPP in module * Force things after parsing in order to release buffers * avoid holding on to stringbuffer unnecessarily * Skip unnecessary file contents read * Drop HscEnv requirement * Add comments on forcing things * Add comments on GHC_LIB restriction * Parse files of interest twice to capture Haddock errors If Opt_Haddock is not enabled we parse twice to capture Haddock parse errors * Parallelize two-pass parsing * Update src/Development/IDE/Core/Compile.hs Co-authored-by: Marcelo Lazaroni <lazaronijunior@gmail.com> Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Instead of full modules, ghcide now parses only the module headers and avoids storing unnecessary ASTs in the Shake graph where possible. This happens in a couple of places:
ModSummary
instead of aParsedModule
ModIface
instead, i.e. a.hi
file.ghc-lib
. Otherwise,ModIface
is used instead.Altogether, ghcide only parses full modules for files of interest now, or for dependencies when an up-to-date
.hi
file is not available. The main benefits areJoint work with @lazamar.
Fixes #505