Fewer orphan instances in hie-core (#1984)

* Get rid of orphan usage in Convert

* Get rid of orphan usage in AtPoint

* Delete one entirely unused orphan

* Remove a comment that is no longer true
This commit is contained in:
Neil Mitchell 2019-07-03 12:01:26 +01:00 committed by Gary Verhaegen
parent 4a9010ba10
commit 9308740773
2 changed files with 1 additions and 2 deletions

View File

@ -33,7 +33,6 @@ instance Show Module where
show = moduleNameString . moduleName
instance Show (GenLocated SrcSpan ModuleName) where show = prettyPrint
instance Show Name where show = prettyPrint
instance NFData (GenLocated SrcSpan ModuleName) where
rnf = rwhnf

View File

@ -86,7 +86,7 @@ atPoint IdeOptions{..} tcs srcSpans pos = do
isTypeclassDeclSpan :: SpanInfo -> Bool
isTypeclassDeclSpan spanInfo =
case getNameM (spaninfoSource spanInfo) of
Just name -> any (`isInfixOf` show name) ["==", "showsPrec"]
Just name -> any (`isInfixOf` getOccString name) ["==", "showsPrec"]
Nothing -> False
locationsAtPoint :: forall m . MonadIO m => (FilePath -> m (Maybe HieFile)) -> IdeOptions -> HscEnv -> Position -> [SpanInfo] -> m [Location]