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

Bump up ghcide submodule to version 0.5.0 #568

Merged
merged 4 commits into from
Nov 8, 2020

Conversation

jneira
Copy link
Member

@jneira jneira commented Nov 4, 2020

  • To get support for CPP/LHS preprocessing in the Eval plugin.

@@ -65,7 +65,7 @@ instance Show Var where
instance Show TCvSubst where
show = unsafeRender

instance Show (LHsExpr GhcPs) where
instance {-# OVERLAPPING #-} Show (LHsExpr GhcPs) where
Copy link
Member Author

@jneira jneira Nov 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid

src\Ide\Plugin\Tactic.hs:310:15: error:
    • Overlapping instances for Show
                                  (GenLocated SrcSpan (HsExpr GhcPs))
        arising from a use of ‘traceMX’
      Matching instances:
        instance Outputable.Outputable a => Show (GenLocated SrcSpan a)
          -- Defined in ‘ghcide-0.4.0:Development.IDE.GHC.Orphans’
        instance Show (LHsExpr GhcPs)
          -- Defined at src\Ide\Plugin\Tactic\Types.hs:68:10
    • In the expression: traceMX "solns"
      In a stmt of a 'do' block: traceMX "solns" $ rtr_other_solns rtr
      In the expression:
        do traceMX "solns" $ rtr_other_solns rtr
           let g = graft (RealSrcSpan span) $ rtr_extract rtr
               response = transform dflags (clientCapabilities lf) uri g pm
           pure
             $ case response of
                 Right res -> (Right Null, Just ...)
                 Left err
                   -> (Left $ ResponseError InternalError (T.pack err) Nothing,
                       Nothing)
    |
310 |               traceMX "solns" $ rtr_other_solns rtr
    |               ^^^^^^^^^^^^^^^

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can just delete this?

Copy link
Member Author

@jneira jneira Nov 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to delete the ghcide instance and it throwed an error, will doublechek
or do you mean the tactic instance?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean the HLS instance.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing it it throws:

src\Ide\Plugin\Tactic\Types.hs:368:14: error:
    • No instance for (Show (LHsExpr GhcPs))
        arising from the second field of ‘RunTacticResults’
          (type ‘LHsExpr GhcPs’)
      Possible fix:
        use a standalone 'deriving instance' declaration,
          so you can specify the instance context yourself
    • When deriving the instance for (Show RunTacticResults)
    |
368 |   } deriving Show
    |              ^^^^

It uses the instance in other context.


I dont fullt understand why they overlap

For
Show (GenLocated SrcSpan (HsExpr GhcPs))

instance Outputable.Outputable a => Show (GenLocated SrcSpan a)
and
instance Show (LHsExpr GhcPs)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pr opened (with the branch in the main repo just in case): haskell/ghcide#894

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure the instances are exported through some other module? You just have to import that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok will check what module reexports them

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out that several modules export those instances, as @wz1000 anticipated.
Of all of them i have chose Development.IDE (), the more generic, cause import a specific module (for example Development.Ide.Core.Sahe) only for instances does not look sensible.

However i would use Development.IDE.GHC.Orphans if it is visible cause the intent of the import is clearer, so i would keep the pr exporting it opened. We will can use it here afterwards in hls.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed - importing Orphans is much clearer.

@jneira jneira changed the title Bump up ghcide submodule to e922a1 Bump up ghcide submodule to version 0.5.0 Nov 7, 2020
@jneira
Copy link
Member Author

jneira commented Nov 7, 2020

Updated ghcide to version 0.5.0 and use the now public Development.IDE.GHC.Orphans

@jneira jneira requested a review from ndmitchell November 8, 2020 17:01
@jneira
Copy link
Member Author

jneira commented Nov 8, 2020

@wz1000 could it be merged as is?

@wz1000
Copy link
Collaborator

wz1000 commented Nov 8, 2020

Yeah, looks good

@jneira jneira merged commit 16aceaf into haskell:master Nov 8, 2020
@jneira jneira deleted the ghcide-master branch December 3, 2020 20:37
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.

3 participants