Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Support plugins #192

Merged
merged 4 commits into from
Nov 15, 2019
Merged

Support plugins #192

merged 4 commits into from
Nov 15, 2019

Conversation

jinwoo
Copy link
Contributor

@jinwoo jinwoo commented Nov 13, 2019

Call initializePlugins before running typecheck.

Call initializePlugins before running typecheck.
@digitalasset-cla
Copy link

digitalasset-cla commented Nov 13, 2019

CLA assistant check
All committers have signed the CLA.

initializePlugins doesn't exist in older GHC versions.
Copy link
Collaborator

@ndmitchell ndmitchell left a 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?

@jinwoo
Copy link
Contributor Author

jinwoo commented Nov 14, 2019

I was going to ask about tests :) Any pointers to how to test this?

@@ -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)
Copy link
Collaborator

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.

Copy link
Collaborator

@ndmitchell ndmitchell left a 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?)

@jinwoo
Copy link
Contributor Author

jinwoo commented Nov 14, 2019

Thanks, @ndmitchell . I'm working on tests at the moment by adding some 3rd-party plugin. Will update this once it's done.

@jinwoo
Copy link
Contributor Author

jinwoo commented Nov 14, 2019

Added a test. PTAL.

Copy link
Contributor

@aherrmann-da aherrmann-da left a 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!

@aherrmann-da aherrmann-da merged commit 3bec234 into haskell:master Nov 15, 2019
@cocreature
Copy link
Collaborator

Nice work, thank you!

@jinwoo jinwoo deleted the plugins branch November 15, 2019 18:48
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* 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
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* 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
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* 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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants