-
-
Notifications
You must be signed in to change notification settings - Fork 370
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
Conversation
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 |
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.
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
| ^^^^^^^^^^^^^^^
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.
I think you can just delete this?
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.
I tried to delete the ghcide instance and it throwed an error, will doublechek
or do you mean the tactic instance?
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.
I mean the HLS instance.
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.
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)
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.
pr opened (with the branch in the main repo just in case): haskell/ghcide#894
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.
I'm sure the instances are exported through some other module? You just have to import that.
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.
Ok will check what module reexports them
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.
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.
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.
Agreed - importing Orphans is much clearer.
Updated ghcide to version 0.5.0 and use the now public |
@wz1000 could it be merged as is? |
Yeah, looks good |