1-- Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
2-- SPDX-License-Identifier: Apache-2.0
4-- ORIGINALLY COPIED FROM https://github.com/commercialhaskell/intero
6-- | Types used separate to GHCi vanilla.
8module Development.IDE.Types.SpanInfo(
20-- | Type of some span of source code. Most of these fields are
21-- unboxed but Haddock doesn't show that.
23 SpanInfo {spaninfoStartLine :: {-# UNPACK #-} !Int
24 -- ^ Start line of the span.
25 ,spaninfoStartCol :: {-# UNPACK #-} !Int
26 -- ^ Start column of the span.
27 ,spaninfoEndLine :: {-# UNPACK #-} !Int
28 -- ^ End line of the span (absolute).
29 ,spaninfoEndCol :: {-# UNPACK #-} !Int
30 -- ^ End column of the span (absolute).
31 ,spaninfoType :: !(Maybe Type)
32 -- ^ A pretty-printed representation fo the type.
33 ,spaninfoSource :: !SpanSource
34 -- ^ The actutal 'Name' associated with the span, if
35 -- any. This can be useful for accessing a variety of
36 -- information about the identifier such as module,
37 -- locality, definition location, etc.
39instance Show SpanInfo where
40 show (SpanInfo sl sc el ec t n) = show [show sl, show sc, show el, show ec, show $ isJust t, show n]
42-- we don't always get a name out so sometimes manually annotating source is more appropriate
43data SpanSource = Named Name
48instance Show SpanSource where
50 Named n -> "Named " ++ occNameString (occName n)
51 Span sp -> "Span " ++ show sp
52 NoSource -> "NoSource"
54getNameM :: SpanSource -> Maybe Name
56 Named name -> Just name
59getSrcSpan :: SpanSource -> Maybe SrcSpan
63 Named name -> Just $ nameSrcSpan name
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list