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

Fix ImportLens plugin to work with GHC 8.10 #356

Merged
merged 1 commit into from
Aug 27, 2020

Conversation

Ailrun
Copy link
Member

@Ailrun Ailrun commented Aug 27, 2020

Fixes #355.

@mouse07410

This comment has been minimized.

@Ailrun
Copy link
Member Author

Ailrun commented Aug 27, 2020

@mouse07410 Now it's fixed.

@mouse07410
Copy link

Sorry, it still fails to compile:

[14 of 20] Compiling Ide.Plugin.ImportLens ( src/Ide/Plugin/ImportLens.hs, dist/build/Ide/Plugin/ImportLens.o, dist/build/Ide/Plugin/ImportLens.dyn_o )

src/Ide/Plugin/ImportLens.hs:181:47: error:
    Not in scope: data constructor ‘GHC.NotQualified’
    No module named ‘GHC’ is imported.
    |
181 | isQualifiedImport ImportDecl{ideclQualified = GHC.NotQualified} = False
    |                                               ^^^^^^^^^^^^^^^^

src/Ide/Plugin/ImportLens.hs:182:47: error:
    Not in scope: data constructor ‘GHC.NotQualified’
    No module named ‘GHC’ is imported.
    |
182 | isQualifiedImport ImportDecl{ideclQualified = GHC.NotQualified} = True
    |                                               ^^^^^^^^^^^^^^^^
cabal: Failed to build haskell-language-server-0.3.0.0 (which is required by
exe:haskell-language-server from haskell-language-server-0.3.0.0 and
exe:haskell-language-server-wrapper from haskell-language-server-0.3.0.0). See
the build log above for details.

@mouse07410
Copy link

It looks like this PR is missing this:

diff --git a/src/Ide/Plugin/ImportLens.hs b/src/Ide/Plugin/ImportLens.hs
index 48110bc..86d38fe 100644
--- a/src/Ide/Plugin/ImportLens.hs
+++ b/src/Ide/Plugin/ImportLens.hs
@@ -31,6 +31,7 @@ import           Development.IDE.Core.Shake     (use, IdeState (..))
 import           Development.IDE.GHC.Compat
 import           Development.IDE.GHC.Error      (realSpan, realSrcSpanToRange)
 import           Development.IDE.GHC.Util       (HscEnvEq, hscEnv, prettyPrint)
+import           GHC
 import           GHC.Generics                   (Generic)
 import           Ide.Plugin
 import           Ide.Types

That patch seems to fix it.

@Ailrun
Copy link
Member Author

Ailrun commented Aug 27, 2020

@mouse07410 Thanks, I will fix that and merge after CI succeed.

@Ailrun Ailrun force-pushed the fix-import-code-lens branch from a7fdeee to 32450e3 Compare August 27, 2020 18:30
@pepeiborra
Copy link
Collaborator

Sorry for all the pain, I merged a previous PR that broke this

@pepeiborra pepeiborra merged commit baabffd into haskell:master Aug 27, 2020
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Sep 6, 2020
@Ailrun Ailrun deleted the fix-import-code-lens branch December 17, 2020 18:01
pepeiborra pushed a commit that referenced this pull request Dec 27, 2020
* #346, don't use nameModule, which raises errors

* #346, ban nameModule, as its dangerous
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

Successfully merging this pull request may close these issues.

Current master does not build with GHC-8.10.1
3 participants