-
Notifications
You must be signed in to change notification settings - Fork 97
Conversation
Call initializePlugins before running typecheck.
initializePlugins doesn't exist in older GHC versions.
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! Any chance of a test so we don't accidentally regress it?
I was going to ask about tests :) Any pointers to how to test this? |
src/Development/IDE/Core/Compile.hs
Outdated
@@ -95,8 +99,17 @@ typecheckModule (IdeDefer defer) packageState deps pm = | |||
runGhcEnv packageState $ | |||
catchSrcErrors "typecheck" $ do | |||
setupEnv deps | |||
#if MIN_GHC_API_VERSION(8,6,0) |
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.
Any way to abstract the key steps out into a function with a single signature that is the same on all versions (merely a noop on one version), then have this code just call that? Would make managing the CPP a bit easier.
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.
Very nice! Tests would go in https://github.com/digital-asset/ghcide/blob/master/test/exe/Main.hs - we probably need to depend on some simple plugin to get it working, which I don't know how to do (@cocreature?)
Thanks, @ndmitchell . I'm working on tests at the moment by adding some 3rd-party plugin. Will update this once it's done. |
Added a test. PTAL. |
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.
That looks great, thank you!
Nice work, thank you! |
* Support plugins Call initializePlugins before running typecheck. * call initializePlugins only for GHC >= 8.6 initializePlugins doesn't exist in older GHC versions. * A separate function for initializing plugins * Add a test for plugins
* Support plugins Call initializePlugins before running typecheck. * call initializePlugins only for GHC >= 8.6 initializePlugins doesn't exist in older GHC versions. * A separate function for initializing plugins * Add a test for plugins
* Support plugins Call initializePlugins before running typecheck. * call initializePlugins only for GHC >= 8.6 initializePlugins doesn't exist in older GHC versions. * A separate function for initializing plugins * Add a test for plugins
Call initializePlugins before running typecheck.