mirror of
https://github.com/haskell/ghcide.git
synced 2024-12-04 15:52:08 +03:00
Cleaner Show instance for SpanInfo (#244)
* Cleaner Show instance for SpanInfo This helped with debugging #237, so maybe it's worth keeping. * Stylistic fixes
This commit is contained in:
parent
cef3097b7f
commit
069e8ee8c7
@ -13,9 +13,8 @@ module Development.IDE.Spans.Type(
|
||||
|
||||
import GHC
|
||||
import Control.DeepSeq
|
||||
import Data.Maybe
|
||||
import OccName
|
||||
|
||||
import Development.IDE.GHC.Util
|
||||
|
||||
-- | Type of some span of source code. Most of these fields are
|
||||
-- unboxed but Haddock doesn't show that.
|
||||
@ -29,7 +28,7 @@ data SpanInfo =
|
||||
,spaninfoEndCol :: {-# UNPACK #-} !Int
|
||||
-- ^ End column of the span (absolute), zero-based.
|
||||
,spaninfoType :: !(Maybe Type)
|
||||
-- ^ A pretty-printed representation fo the type.
|
||||
-- ^ A pretty-printed representation for the type.
|
||||
,spaninfoSource :: !SpanSource
|
||||
-- ^ The actutal 'Name' associated with the span, if
|
||||
-- any. This can be useful for accessing a variety of
|
||||
@ -37,7 +36,9 @@ data SpanInfo =
|
||||
-- locality, definition location, etc.
|
||||
}
|
||||
instance Show SpanInfo where
|
||||
show (SpanInfo sl sc el ec t n) = show [show sl, show sc, show el, show ec, show $ isJust t, show n]
|
||||
show (SpanInfo sl sc el ec t n) =
|
||||
unwords ["(SpanInfo", show sl, show sc, show el, show ec
|
||||
, show $ maybe "NoType" prettyPrint t, "(" <> show n <> "))"]
|
||||
|
||||
instance NFData SpanInfo where
|
||||
rnf = rwhnf
|
||||
|
Loading…
Reference in New Issue
Block a user