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
- toNormalizedFilePath :: FilePath -> NormalizedFilePath
- fromNormalizedFilePath :: NormalizedFilePath -> FilePath
- filePathToUri :: FilePath -> Uri
- filePathToUri' :: NormalizedFilePath -> NormalizedUri
- uriToFilePath' :: Uri -> Maybe FilePath
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.16.0.0-CA46dpmGC4cKajDaCP3EOC" 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.16.0.0-CA46dpmGC4cKajDaCP3EOC" 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.16.0.0-CA46dpmGC4cKajDaCP3EOC" 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 #
When URIs are supposed to be used as keys, it is important to normalize the percent encoding in the URI since URIs that only differ when it comes to the percent-encoding should be treated as equivalent.
Instances
toNormalizedUri :: Uri -> NormalizedUri #
fromNormalizedUri :: NormalizedUri -> Uri #
data NormalizedFilePath Source #
Newtype wrapper around FilePath that always has normalized slashes.
Instances
filePathToUri :: FilePath -> Uri #
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.