Safe Haskell | None |
---|---|
Language | Haskell2010 |
Types and functions for working with source code locations.
Synopsis
- data Location = Location {}
- noFilePath :: FilePath
- noRange :: Range
- data Position = Position {
- _line :: Int
- _character :: Int
- showPosition :: Position -> String
- data Range = Range {}
- newtype Uri = Uri {}
- data NormalizedUri
- toNormalizedUri :: Uri -> NormalizedUri
- fromNormalizedUri :: NormalizedUri -> Uri
- data NormalizedFilePath
- fromUri :: NormalizedUri -> NormalizedFilePath
- emptyFilePath :: NormalizedFilePath
- emptyPathUri :: NormalizedUri
- toNormalizedFilePath' :: FilePath -> NormalizedFilePath
- fromNormalizedFilePath :: NormalizedFilePath -> FilePath
- filePathToUri' :: NormalizedFilePath -> NormalizedUri
- uriToFilePath' :: Uri -> Maybe FilePath
- readSrcSpan :: ReadS RealSrcSpan
Documentation
Instances
Eq Location | |
Ord Location | |
Defined in Language.Haskell.LSP.Types.Location | |
Read Location | |
Show Location | |
Generic Location | |
ToJSON Location | |
Defined in Language.Haskell.LSP.Types.Location | |
FromJSON Location | |
NFData Location | |
Defined in Language.Haskell.LSP.Types.Location | |
type Rep Location | |
Defined in Language.Haskell.LSP.Types.Location type Rep Location = D1 ('MetaData "Location" "Language.Haskell.LSP.Types.Location" "haskell-lsp-types-0.22.0.0-3vYMHr1NKLe1fX3kUHhyB1" 'False) (C1 ('MetaCons "Location" 'PrefixI 'True) (S1 ('MetaSel ('Just "_uri") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Uri) :*: S1 ('MetaSel ('Just "_range") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Range))) |
Position | |
|
Instances
Eq Position | |
Ord Position | |
Defined in Language.Haskell.LSP.Types.Location | |
Read Position | |
Show Position | |
Generic Position | |
ToJSON Position | |
Defined in Language.Haskell.LSP.Types.Location | |
FromJSON Position | |
NFData Position | |
Defined in Language.Haskell.LSP.Types.Location | |
type Rep Position | |
Defined in Language.Haskell.LSP.Types.Location type Rep Position = D1 ('MetaData "Position" "Language.Haskell.LSP.Types.Location" "haskell-lsp-types-0.22.0.0-3vYMHr1NKLe1fX3kUHhyB1" 'False) (C1 ('MetaCons "Position" 'PrefixI 'True) (S1 ('MetaSel ('Just "_line") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "_character") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) |
showPosition :: Position -> String Source #
Instances
Eq Range | |
Ord Range | |
Read Range | |
Show Range | |
Generic Range | |
ToJSON Range | |
Defined in Language.Haskell.LSP.Types.Location | |
FromJSON Range | |
NFData Range | |
Defined in Language.Haskell.LSP.Types.Location | |
type Rep Range | |
Defined in Language.Haskell.LSP.Types.Location type Rep Range = D1 ('MetaData "Range" "Language.Haskell.LSP.Types.Location" "haskell-lsp-types-0.22.0.0-3vYMHr1NKLe1fX3kUHhyB1" 'False) (C1 ('MetaCons "Range" 'PrefixI 'True) (S1 ('MetaSel ('Just "_start") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Position) :*: S1 ('MetaSel ('Just "_end") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Position))) |
Instances
Eq Uri | |
Ord Uri | |
Read Uri | |
Show Uri | |
Generic Uri | |
Hashable Uri | |
Defined in Language.Haskell.LSP.Types.Uri | |
ToJSON Uri | |
Defined in Language.Haskell.LSP.Types.Uri | |
ToJSONKey Uri | |
Defined in Language.Haskell.LSP.Types.Uri | |
FromJSON Uri | |
FromJSONKey Uri | |
Defined in Language.Haskell.LSP.Types.Uri | |
NFData Uri | |
Defined in Language.Haskell.LSP.Types.Uri | |
type Rep Uri | |
Defined in Language.Haskell.LSP.Types.Uri |
data NormalizedUri #
Instances
toNormalizedUri :: Uri -> NormalizedUri #
fromNormalizedUri :: NormalizedUri -> Uri #
data NormalizedFilePath #
Newtype wrapper around FilePath that always has normalized slashes. The NormalizedUri and hash of the FilePath are cached to avoided repeated normalisation when we need to compute them (which is a lot).
This is one of the most performance critical parts of ghcide, do not modify it without profiling.
Instances
uriToFilePath' :: Uri -> Maybe FilePath Source #
We use an empty string as a filepath when we don’t have a file. However, haskell-lsp doesn’t support that in uriToFilePath and given that it is not a valid filepath it does not make sense to upstream a fix. So we have our own wrapper here that supports empty filepaths.
readSrcSpan :: ReadS RealSrcSpan Source #
Parser for the GHC output format