ghcide-1.2.0.2: The core of an IDE
Safe HaskellNone
LanguageHaskell2010

Development.IDE.Types.Location

Description

Types and functions for working with source code locations.

Synopsis

Documentation

data Location #

Constructors

Location 

Fields

Instances

Instances details
Eq Location 
Instance details

Defined in Language.LSP.Types.Location

Ord Location 
Instance details

Defined in Language.LSP.Types.Location

Read Location 
Instance details

Defined in Language.LSP.Types.Location

Show Location 
Instance details

Defined in Language.LSP.Types.Location

Generic Location 
Instance details

Defined in Language.LSP.Types.Location

Associated Types

type Rep Location :: Type -> Type #

Methods

from :: Location -> Rep Location x #

to :: Rep Location x -> Location #

ToJSON Location 
Instance details

Defined in Language.LSP.Types.Location

FromJSON Location 
Instance details

Defined in Language.LSP.Types.Location

NFData Location 
Instance details

Defined in Language.LSP.Types.Location

Methods

rnf :: Location -> () #

HasLocation DiagnosticRelatedInformation Location 
Instance details

Defined in Language.LSP.Types.Lens

HasLocation SymbolInformation Location 
Instance details

Defined in Language.LSP.Types.Lens

HasRange Location Range 
Instance details

Defined in Language.LSP.Types.Lens

HasUri Location Uri 
Instance details

Defined in Language.LSP.Types.Lens

Methods

uri :: Lens' Location Uri #

type Rep Location 
Instance details

Defined in Language.LSP.Types.Location

type Rep Location = D1 ('MetaData "Location" "Language.LSP.Types.Location" "lsp-types-1.2.0.0-IvqFnI2S3PjC4T3Mqse1fL" 'False) (C1 ('MetaCons "Location" 'PrefixI 'True) (S1 ('MetaSel ('Just "_uri") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Uri) :*: S1 ('MetaSel ('Just "_range") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Range)))

data Position #

Constructors

Position 

Fields

  • _line :: Int

    Line position in a document (zero-based).

  • _character :: Int

    Character offset on a line in a document (zero-based). Assuming that the line is represented as a string, the character value represents the gap between the character and character + 1.

Instances

Instances details
Eq Position 
Instance details

Defined in Language.LSP.Types.Location

Ord Position 
Instance details

Defined in Language.LSP.Types.Location

Read Position 
Instance details

Defined in Language.LSP.Types.Location

Show Position 
Instance details

Defined in Language.LSP.Types.Location

Generic Position 
Instance details

Defined in Language.LSP.Types.Location

Associated Types

type Rep Position :: Type -> Type #

Methods

from :: Position -> Rep Position x #

to :: Rep Position x -> Position #

ToJSON Position 
Instance details

Defined in Language.LSP.Types.Location

FromJSON Position 
Instance details

Defined in Language.LSP.Types.Location

NFData Position 
Instance details

Defined in Language.LSP.Types.Location

Methods

rnf :: Position -> () #

HasPosition CompletionParams Position 
Instance details

Defined in Language.LSP.Types.Lens

HasPosition DeclarationParams Position 
Instance details

Defined in Language.LSP.Types.Lens

HasPosition DefinitionParams Position 
Instance details

Defined in Language.LSP.Types.Lens

HasPosition DocumentHighlightParams Position 
Instance details

Defined in Language.LSP.Types.Lens

HasPosition DocumentOnTypeFormattingParams Position 
Instance details

Defined in Language.LSP.Types.Lens

HasPosition HoverParams Position 
Instance details

Defined in Language.LSP.Types.Lens

HasPosition ImplementationParams Position 
Instance details

Defined in Language.LSP.Types.Lens

HasPosition ReferenceParams Position 
Instance details

Defined in Language.LSP.Types.Lens

HasPosition PrepareRenameParams Position 
Instance details

Defined in Language.LSP.Types.Lens

HasPosition RenameParams Position 
Instance details

Defined in Language.LSP.Types.Lens

HasPosition TypeDefinitionParams Position 
Instance details

Defined in Language.LSP.Types.Lens

HasPosition TextDocumentPositionParams Position 
Instance details

Defined in Language.LSP.Types.Lens

HasEnd Range Position 
Instance details

Defined in Language.LSP.Types.Lens

HasStart Range Position 
Instance details

Defined in Language.LSP.Types.Lens

HasCharacter Position Int 
Instance details

Defined in Language.LSP.Types.Lens

HasLine Position Int 
Instance details

Defined in Language.LSP.Types.Lens

Methods

line :: Lens' Position Int #

HasPositions SelectionRangeParams (List Position) 
Instance details

Defined in Language.LSP.Types.Lens

type Rep Position 
Instance details

Defined in Language.LSP.Types.Location

type Rep Position = D1 ('MetaData "Position" "Language.LSP.Types.Location" "lsp-types-1.2.0.0-IvqFnI2S3PjC4T3Mqse1fL" 'False) (C1 ('MetaCons "Position" 'PrefixI 'True) (S1 ('MetaSel ('Just "_line") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "_character") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

data Range #

Constructors

Range 

Fields

Instances

Instances details
Eq Range 
Instance details

Defined in Language.LSP.Types.Location

Methods

(==) :: Range -> Range -> Bool #

(/=) :: Range -> Range -> Bool #

Ord Range 
Instance details

Defined in Language.LSP.Types.Location

Methods

compare :: Range -> Range -> Ordering #

(<) :: Range -> Range -> Bool #

(<=) :: Range -> Range -> Bool #

(>) :: Range -> Range -> Bool #

(>=) :: Range -> Range -> Bool #

max :: Range -> Range -> Range #

min :: Range -> Range -> Range #

Read Range 
Instance details

Defined in Language.LSP.Types.Location

Show Range 
Instance details

Defined in Language.LSP.Types.Location

Methods

showsPrec :: Int -> Range -> ShowS #

show :: Range -> String #

showList :: [Range] -> ShowS #

Generic Range 
Instance details

Defined in Language.LSP.Types.Location

Associated Types

type Rep Range :: Type -> Type #

Methods

from :: Range -> Rep Range x #

to :: Rep Range x -> Range #

ToJSON Range 
Instance details

Defined in Language.LSP.Types.Location

FromJSON Range 
Instance details

Defined in Language.LSP.Types.Location

NFData Range 
Instance details

Defined in Language.LSP.Types.Location

Methods

rnf :: Range -> () #

MapAge Range Source # 
Instance details

Defined in Development.IDE.Core.UseStale

Methods

mapAgeFrom :: forall (from :: Age) (to :: Age). PositionMap from to -> Tracked to Range -> Maybe (Tracked from Range) Source #

mapAgeTo :: forall (from :: Age) (to :: Age). PositionMap from to -> Tracked from Range -> Maybe (Tracked to Range) Source #

HasSelectionRange DocumentSymbol Range 
Instance details

Defined in Language.LSP.Types.Lens

HasInsert InsertReplaceEdit Range 
Instance details

Defined in Language.LSP.Types.Lens

HasRepalce InsertReplaceEdit Range 
Instance details

Defined in Language.LSP.Types.Lens

HasTargetRange LocationLink Range 
Instance details

Defined in Language.LSP.Types.Lens

HasTargetSelectionRange LocationLink Range 
Instance details

Defined in Language.LSP.Types.Lens

HasRange CodeActionParams Range 
Instance details

Defined in Language.LSP.Types.Lens

HasRange ColorPresentationParams Range 
Instance details

Defined in Language.LSP.Types.Lens

HasRange ColorInformation Range 
Instance details

Defined in Language.LSP.Types.Lens

HasRange AnnotatedTextEdit Range 
Instance details

Defined in Language.LSP.Types.Lens

HasRange TextEdit Range 
Instance details

Defined in Language.LSP.Types.Lens

HasRange CodeLens Range 
Instance details

Defined in Language.LSP.Types.Lens

HasRange Diagnostic Range 
Instance details

Defined in Language.LSP.Types.Lens

HasRange DocumentHighlight Range 
Instance details

Defined in Language.LSP.Types.Lens

HasRange DocumentLink Range 
Instance details

Defined in Language.LSP.Types.Lens

HasRange DocumentSymbol Range 
Instance details

Defined in Language.LSP.Types.Lens

HasRange DocumentRangeFormattingParams Range 
Instance details

Defined in Language.LSP.Types.Lens

HasRange RangeWithPlaceholder Range 
Instance details

Defined in Language.LSP.Types.Lens

HasRange SelectionRange Range 
Instance details

Defined in Language.LSP.Types.Lens

HasRange Location Range 
Instance details

Defined in Language.LSP.Types.Lens

HasEnd Range Position 
Instance details

Defined in Language.LSP.Types.Lens

HasStart Range Position 
Instance details

Defined in Language.LSP.Types.Lens

HasOriginSelectionRange LocationLink (Maybe Range) 
Instance details

Defined in Language.LSP.Types.Lens

HasRange Hover (Maybe Range) 
Instance details

Defined in Language.LSP.Types.Lens

HasRange TextDocumentContentChangeEvent (Maybe Range) 
Instance details

Defined in Language.LSP.Types.Lens

type Rep Range 
Instance details

Defined in Language.LSP.Types.Location

type Rep Range = D1 ('MetaData "Range" "Language.LSP.Types.Location" "lsp-types-1.2.0.0-IvqFnI2S3PjC4T3Mqse1fL" 'False) (C1 ('MetaCons "Range" 'PrefixI 'True) (S1 ('MetaSel ('Just "_start") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Position) :*: S1 ('MetaSel ('Just "_end") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Position)))

newtype Uri #

Constructors

Uri 

Fields

Instances

Instances details
Eq Uri 
Instance details

Defined in Language.LSP.Types.Uri

Methods

(==) :: Uri -> Uri -> Bool #

(/=) :: Uri -> Uri -> Bool #

Ord Uri 
Instance details

Defined in Language.LSP.Types.Uri

Methods

compare :: Uri -> Uri -> Ordering #

(<) :: Uri -> Uri -> Bool #

(<=) :: Uri -> Uri -> Bool #

(>) :: Uri -> Uri -> Bool #

(>=) :: Uri -> Uri -> Bool #

max :: Uri -> Uri -> Uri #

min :: Uri -> Uri -> Uri #

Read Uri 
Instance details

Defined in Language.LSP.Types.Uri

Show Uri 
Instance details

Defined in Language.LSP.Types.Uri

Methods

showsPrec :: Int -> Uri -> ShowS #

show :: Uri -> String #

showList :: [Uri] -> ShowS #

Generic Uri 
Instance details

Defined in Language.LSP.Types.Uri

Associated Types

type Rep Uri :: Type -> Type #

Methods

from :: Uri -> Rep Uri x #

to :: Rep Uri x -> Uri #

Hashable Uri 
Instance details

Defined in Language.LSP.Types.Uri

Methods

hashWithSalt :: Int -> Uri -> Int #

hash :: Uri -> Int #

ToJSON Uri 
Instance details

Defined in Language.LSP.Types.Uri

ToJSONKey Uri 
Instance details

Defined in Language.LSP.Types.Uri

FromJSON Uri 
Instance details

Defined in Language.LSP.Types.Uri

FromJSONKey Uri 
Instance details

Defined in Language.LSP.Types.Uri

NFData Uri 
Instance details

Defined in Language.LSP.Types.Uri

Methods

rnf :: Uri -> () #

HasNewUri RenameFile Uri 
Instance details

Defined in Language.LSP.Types.Lens

HasOldUri RenameFile Uri 
Instance details

Defined in Language.LSP.Types.Lens

HasTargetUri LocationLink Uri 
Instance details

Defined in Language.LSP.Types.Lens

HasUri DeleteFile Uri 
Instance details

Defined in Language.LSP.Types.Lens

HasUri CreateFile Uri 
Instance details

Defined in Language.LSP.Types.Lens

HasUri FileEvent Uri 
Instance details

Defined in Language.LSP.Types.Lens

Methods

uri :: Lens' FileEvent Uri #

HasUri PublishDiagnosticsParams Uri 
Instance details

Defined in Language.LSP.Types.Lens

HasUri TextDocumentItem Uri 
Instance details

Defined in Language.LSP.Types.Lens

HasUri VersionedTextDocumentIdentifier Uri 
Instance details

Defined in Language.LSP.Types.Lens

HasUri TextDocumentIdentifier Uri 
Instance details

Defined in Language.LSP.Types.Lens

HasUri Location Uri 
Instance details

Defined in Language.LSP.Types.Lens

Methods

uri :: Lens' Location Uri #

HasTarget DocumentLink (Maybe Uri) 
Instance details

Defined in Language.LSP.Types.Lens

HasChanges WorkspaceEdit (Maybe WorkspaceEditMap) 
Instance details

Defined in Language.LSP.Types.Lens

HasRootUri InitializeParams (Maybe Uri) 
Instance details

Defined in Language.LSP.Types.Lens

type Rep Uri 
Instance details

Defined in Language.LSP.Types.Uri

type Rep Uri = D1 ('MetaData "Uri" "Language.LSP.Types.Uri" "lsp-types-1.2.0.0-IvqFnI2S3PjC4T3Mqse1fL" 'True) (C1 ('MetaCons "Uri" 'PrefixI 'True) (S1 ('MetaSel ('Just "getUri") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data NormalizedUri #

Instances

Instances details
Eq NormalizedUri 
Instance details

Defined in Language.LSP.Types.Uri

Ord NormalizedUri 
Instance details

Defined in Language.LSP.Types.Uri

Read NormalizedUri 
Instance details

Defined in Language.LSP.Types.Uri

Show NormalizedUri 
Instance details

Defined in Language.LSP.Types.Uri

Generic NormalizedUri 
Instance details

Defined in Language.LSP.Types.Uri

Associated Types

type Rep NormalizedUri :: Type -> Type #

Hashable NormalizedUri 
Instance details

Defined in Language.LSP.Types.Uri

NFData NormalizedUri 
Instance details

Defined in Language.LSP.Types.Uri

Methods

rnf :: NormalizedUri -> () #

type Rep NormalizedUri 
Instance details

Defined in Language.LSP.Types.Uri

type Rep NormalizedUri = D1 ('MetaData "NormalizedUri" "Language.LSP.Types.Uri" "lsp-types-1.2.0.0-IvqFnI2S3PjC4T3Mqse1fL" 'False) (C1 ('MetaCons "NormalizedUri" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)))

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

Instances details
Eq NormalizedFilePath 
Instance details

Defined in Language.LSP.Types.Uri

Ord NormalizedFilePath 
Instance details

Defined in Language.LSP.Types.Uri

Show NormalizedFilePath 
Instance details

Defined in Language.LSP.Types.Uri

IsString NormalizedFilePath 
Instance details

Defined in Language.LSP.Types.Uri

Generic NormalizedFilePath 
Instance details

Defined in Language.LSP.Types.Uri

Associated Types

type Rep NormalizedFilePath :: Type -> Type #

Hashable NormalizedFilePath 
Instance details

Defined in Language.LSP.Types.Uri

Binary NormalizedFilePath 
Instance details

Defined in Language.LSP.Types.Uri

NFData NormalizedFilePath 
Instance details

Defined in Language.LSP.Types.Uri

Methods

rnf :: NormalizedFilePath -> () #

type Rep NormalizedFilePath 
Instance details

Defined in Language.LSP.Types.Uri

type Rep NormalizedFilePath = D1 ('MetaData "NormalizedFilePath" "Language.LSP.Types.Uri" "lsp-types-1.2.0.0-IvqFnI2S3PjC4T3Mqse1fL" 'False) (C1 ('MetaCons "NormalizedFilePath" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 NormalizedUri) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FilePath)))

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