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 | |
HasLocation DiagnosticRelatedInformation Location | |
HasLocation SymbolInformation Location | |
Defined in Language.Haskell.LSP.Types.Lens | |
HasUri Location Uri | |
HasRange Location Range | |
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.23.0.0-50bxmorGfTOFkgENnf5Jgw" '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
showPosition :: Position -> String Source #
Instances
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 | |
HasUri PublishDiagnosticsParams Uri | |
Defined in Language.Haskell.LSP.Types.Lens | |
HasUri FileEvent Uri | |
HasUri VersionedTextDocumentIdentifier Uri | |
Defined in Language.Haskell.LSP.Types.Lens | |
HasUri TextDocumentItem Uri | |
Defined in Language.Haskell.LSP.Types.Lens uri :: Lens' TextDocumentItem Uri # | |
HasUri TextDocumentIdentifier Uri | |
Defined in Language.Haskell.LSP.Types.Lens | |
HasUri Location Uri | |
HasChanges WorkspaceEdit (Maybe WorkspaceEditMap) | |
Defined in Language.Haskell.LSP.Types.Lens | |
HasRootUri InitializeParams (Maybe Uri) | |
Defined in Language.Haskell.LSP.Types.Lens | |
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