ghcide-2.4.0.0: The core of an IDE

Safe Haskell | Safe-Inferred
Language | Haskell2010

Development.IDE.Types.Location

Description

Types and functions for working with source code locations.

Synopsis

- data Location = Location {
  - _uri :: Uri
  - _range :: Range
  }
- noFilePath :: FilePath
- noRange :: Range
- data Position = Position {
  - _line :: UInt
  - _character :: UInt
  }
- showPosition :: Position -> String
- data Range = Range {
  - _start :: Position
  - _end :: Position
  }
- newtype Uri = Uri {
  - getUri :: Text
  }
- 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

data Location #

Represents a location inside a resource, such as a line inside a text file.

Constructors

Location |
Fields _uri :: Uri _range :: Range

#### Instances

Instances details

FromJSON Location |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Location Methods parseJSON :: Value -> Parser Location # parseJSONList :: Value -> Parser [Location] # omittedField :: Maybe Location #
ToJSON Location |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Location Methods toJSON :: Location -> Value # toEncoding :: Location -> Encoding # toJSONList :: [Location] -> Value # toEncodingList :: [Location] -> Encoding # omitField :: Location -> Bool #
Generic Location |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Location Associated Types type Rep Location :: Type -> Type Methods from :: Location -> Rep Location x to :: Rep Location x -> Location
Show Location |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Location Methods showsPrec :: Int -> Location -> ShowS # show :: Location -> String # showList :: [Location] -> ShowS #
NFData Location |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Location Methods rnf :: Location -> () #
Eq Location |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Location Methods (==) :: Location -> Location -> Bool # (/=) :: Location -> Location -> Bool #
Ord Location |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Location Methods compare :: Location -> Location -> Ordering (<) :: Location -> Location -> Bool (<=) :: Location -> Location -> Bool (>) :: Location -> Location -> Bool (>=) :: Location -> Location -> Bool max :: Location -> Location -> Location min :: Location -> Location -> Location
Hashable Location |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Location Methods hashWithSalt :: Int -> Location -> Int # hash :: Location -> Int #
Pretty Location |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Location Methods pretty :: Location -> Doc ann # prettyList :: [Location] -> Doc ann #
HasLocation DiagnosticRelatedInformation Location |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods location :: Lens' DiagnosticRelatedInformation Location #
HasLocation SymbolInformation Location |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods location :: Lens' SymbolInformation Location #
HasRange Location Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' Location Range #
HasUri Location Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods uri :: Lens' Location Uri #
HasLocation InlayHintLabelPart (Maybe Location) |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods location :: Lens' InlayHintLabelPart (Maybe Location) #
type Rep Location |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Location type Rep Location = D1 ('MetaData "Location" "Language.LSP.Protocol.Internal.Types.Location" "lsp-types-2.0.2.0-6ldEQfFkAQaDyl5nknNRSX" 'False) (C1 ('MetaCons "Location" 'PrefixI 'True) (S1 ('MetaSel ('Just "_uri") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Uri) :*: S1 ('MetaSel ('Just "_range") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Range)))

noFilePath :: FilePath #

noRange :: Range #

data Position #

Position in a text document expressed as zero-based line and character offset. Prior to 3.17 the offsets were always based on a UTF-16 string representation. So a string of the form `a𐐀b` the character offset of the character `a` is 0, the character offset of `𐐀` is 1 and the character offset of b is 3 since `𐐀` is represented using two code units in UTF-16. Since 3.17 clients and servers can agree on a different string encoding representation (e.g. UTF-8). The client announces it's supported encoding via the client capability `general.positionEncodings`. The value is an array of position encodings the client supports, with decreasing preference (e.g. the encoding at index `0` is the most preferred one). To stay backwards compatible the only mandatory encoding is UTF-16 represented via the string `utf-16`. The server can pick one of the encodings offered by the client and signals that encoding back to the client via the initialize result's property `capabilities.positionEncoding`. If the string value `utf-16` is missing from the client's capability `general.positionEncodings` servers can safely assume that the client supports UTF-16. If the server omits the position encoding in its initialize result the encoding defaults to the string value `utf-16`. Implementation considerations: since the conversion from one encoding into another requires the content of the file / line the conversion is best done where the file is read which is usually on the server side.

Positions are line end character agnostic. So you can not specify a position that denotes `r|n` or `n|` where `|` represents the character offset.

@since 3.17.0 - support for negotiated position encoding.

Constructors

Position |
Fields _line :: UInt Line position in a document (zero-based). If a line number is greater than the number of lines in a document, it defaults back to the number of lines in the document. If a line number is negative, it defaults to 0. _character :: UInt Character offset on a line in a document (zero-based). The meaning of this offset is determined by the negotiated `PositionEncodingKind`. If the character value is greater than the line length it defaults back to the line length.

#### Instances

Instances details

FromJSON Position |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Position Methods parseJSON :: Value -> Parser Position # parseJSONList :: Value -> Parser [Position] # omittedField :: Maybe Position #
ToJSON Position |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Position Methods toJSON :: Position -> Value # toEncoding :: Position -> Encoding # toJSONList :: [Position] -> Value # toEncodingList :: [Position] -> Encoding # omitField :: Position -> Bool #
Generic Position |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Position Associated Types type Rep Position :: Type -> Type Methods from :: Position -> Rep Position x to :: Rep Position x -> Position
Show Position |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Position Methods showsPrec :: Int -> Position -> ShowS # show :: Position -> String # showList :: [Position] -> ShowS #
NFData Position |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Position Methods rnf :: Position -> () #
Eq Position |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Position Methods (==) :: Position -> Position -> Bool # (/=) :: Position -> Position -> Bool #
Ord Position |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Position Methods compare :: Position -> Position -> Ordering (<) :: Position -> Position -> Bool (<=) :: Position -> Position -> Bool (>) :: Position -> Position -> Bool (>=) :: Position -> Position -> Bool max :: Position -> Position -> Position min :: Position -> Position -> Position
Hashable Position |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Position Methods hashWithSalt :: Int -> Position -> Int # hash :: Position -> Int #
Pretty Position |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Position Methods pretty :: Position -> Doc ann # prettyList :: [Position] -> Doc ann #
HasCharacter Position UInt |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods character :: Lens' Position UInt #
HasEnd Range Position |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods end :: Lens' Range Position #
HasLine Position UInt |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods line :: Lens' Position UInt #
HasPosition CallHierarchyPrepareParams Position |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods position :: Lens' CallHierarchyPrepareParams Position #
HasPosition CompletionParams Position |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods position :: Lens' CompletionParams Position #
HasPosition DeclarationParams Position |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods position :: Lens' DeclarationParams Position #
HasPosition DefinitionParams Position |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods position :: Lens' DefinitionParams Position #
HasPosition DocumentHighlightParams Position |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods position :: Lens' DocumentHighlightParams Position #
HasPosition DocumentOnTypeFormattingParams Position |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods position :: Lens' DocumentOnTypeFormattingParams Position #
HasPosition HoverParams Position |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods position :: Lens' HoverParams Position #
HasPosition ImplementationParams Position |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods position :: Lens' ImplementationParams Position #
HasPosition InlayHint Position |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods position :: Lens' InlayHint Position #
HasPosition LinkedEditingRangeParams Position |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods position :: Lens' LinkedEditingRangeParams Position #
HasPosition MonikerParams Position |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods position :: Lens' MonikerParams Position #
HasPosition PrepareRenameParams Position |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods position :: Lens' PrepareRenameParams Position #
HasPosition ReferenceParams Position |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods position :: Lens' ReferenceParams Position #
HasPosition RenameParams Position |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods position :: Lens' RenameParams Position #
HasPosition SignatureHelpParams Position |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods position :: Lens' SignatureHelpParams Position #
HasPosition TextDocumentPositionParams Position |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods position :: Lens' TextDocumentPositionParams Position #
HasPosition TypeDefinitionParams Position |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods position :: Lens' TypeDefinitionParams Position #
HasPosition TypeHierarchyPrepareParams Position |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods position :: Lens' TypeHierarchyPrepareParams Position #
HasStart Range Position |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods start :: Lens' Range Position #
HasPositions SelectionRangeParams [Position] |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods positions :: Lens' SelectionRangeParams [Position] #
type Rep Position |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Position type Rep Position = D1 ('MetaData "Position" "Language.LSP.Protocol.Internal.Types.Position" "lsp-types-2.0.2.0-6ldEQfFkAQaDyl5nknNRSX" 'False) (C1 ('MetaCons "Position" 'PrefixI 'True) (S1 ('MetaSel ('Just "_line") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedUnpack) (Rec0 UInt) :*: S1 ('MetaSel ('Just "_character") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedUnpack) (Rec0 UInt)))

showPosition :: Position -> String #

data Range #

A range in a text document expressed as (zero-based) start and end positions.

If you want to specify a range that contains a line including the line ending character(s) then use an end position denoting the start of the next line. For example: ```ts { start: { line: 5, character: 23 } end : { line 6, character : 0 } } ```

Constructors

Range |
Fields _start :: Position The range's start position. _end :: Position The range's end position.

#### Instances

Instances details

FromJSON Range |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Range Methods parseJSON :: Value -> Parser Range # parseJSONList :: Value -> Parser [Range] # omittedField :: Maybe Range #
ToJSON Range |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Range Methods toJSON :: Range -> Value # toEncoding :: Range -> Encoding # toJSONList :: [Range] -> Value # toEncodingList :: [Range] -> Encoding # omitField :: Range -> Bool #
Generic Range |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Range Associated Types type Rep Range :: Type -> Type Methods from :: Range -> Rep Range x to :: Rep Range x -> Range
Show Range |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Range Methods showsPrec :: Int -> Range -> ShowS # show :: Range -> String # showList :: [Range] -> ShowS #
NFData Range |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Range Methods rnf :: Range -> () #
Eq Range |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Range Methods (==) :: Range -> Range -> Bool # (/=) :: Range -> Range -> Bool #
Ord Range |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Range 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
MapAge Range # |
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) # mapAgeTo :: forall (from :: Age) (to :: Age). PositionMap from to -> Tracked from Range -> Maybe (Tracked to Range) #
Hashable Range |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Range Methods hashWithSalt :: Int -> Range -> Int # hash :: Range -> Int #
Pretty Range |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Range Methods pretty :: Range -> Doc ann # prettyList :: [Range] -> Doc ann #
HasEnd Range Position |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods end :: Lens' Range Position #
HasInsert InsertReplaceEdit Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods insert :: Lens' InsertReplaceEdit Range #
HasRange AnnotatedTextEdit Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' AnnotatedTextEdit Range #
HasRange CallHierarchyItem Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' CallHierarchyItem Range #
HasRange CodeActionParams Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' CodeActionParams Range #
HasRange CodeLens Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' CodeLens Range #
HasRange ColorInformation Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' ColorInformation Range #
HasRange ColorPresentationParams Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' ColorPresentationParams Range #
HasRange Diagnostic Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' Diagnostic Range #
HasRange DocumentHighlight Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' DocumentHighlight Range #
HasRange DocumentLink Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' DocumentLink Range #
HasRange DocumentRangeFormattingParams Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' DocumentRangeFormattingParams Range #
HasRange DocumentSymbol Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' DocumentSymbol Range #
HasRange InlayHintParams Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' InlayHintParams Range #
HasRange InlineValueEvaluatableExpression Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' InlineValueEvaluatableExpression Range #
HasRange InlineValueParams Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' InlineValueParams Range #
HasRange InlineValueText Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' InlineValueText Range #
HasRange InlineValueVariableLookup Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' InlineValueVariableLookup Range #
HasRange Location Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' Location Range #
HasRange SelectionRange Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' SelectionRange Range #
HasRange SemanticTokensRangeParams Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' SemanticTokensRangeParams Range #
HasRange TextEdit Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' TextEdit Range #
HasRange TypeHierarchyItem Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' TypeHierarchyItem Range #
HasReplace InsertReplaceEdit Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods replace :: Lens' InsertReplaceEdit Range #
HasSelectionRange CallHierarchyItem Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods selectionRange :: Lens' CallHierarchyItem Range #
HasSelectionRange DocumentSymbol Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods selectionRange :: Lens' DocumentSymbol Range #
HasSelectionRange TypeHierarchyItem Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods selectionRange :: Lens' TypeHierarchyItem Range #
HasStart Range Position |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods start :: Lens' Range Position #
HasStoppedLocation InlineValueContext Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods stoppedLocation :: Lens' InlineValueContext Range #
HasTargetRange LocationLink Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods targetRange :: Lens' LocationLink Range #
HasTargetSelectionRange LocationLink Range |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods targetSelectionRange :: Lens' LocationLink Range #
HasFromRanges CallHierarchyIncomingCall [Range] |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods fromRanges :: Lens' CallHierarchyIncomingCall [Range] #
HasFromRanges CallHierarchyOutgoingCall [Range] |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods fromRanges :: Lens' CallHierarchyOutgoingCall [Range] #
HasOriginSelectionRange LocationLink (Maybe Range) |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods originSelectionRange :: Lens' LocationLink (Maybe Range) #
HasRange Hover (Maybe Range) |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods range :: Lens' Hover (Maybe Range) #
HasRanges LinkedEditingRanges [Range] |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods ranges :: Lens' LinkedEditingRanges [Range] #
HasSelection ShowDocumentParams (Maybe Range) |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods selection :: Lens' ShowDocumentParams (Maybe Range) #
type Rep Range |
Instance details Defined in Language.LSP.Protocol.Internal.Types.Range type Rep Range = D1 ('MetaData "Range" "Language.LSP.Protocol.Internal.Types.Range" "lsp-types-2.0.2.0-6ldEQfFkAQaDyl5nknNRSX" '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 #

The `Uri` type in the LSP specification.

Constructors

Uri |
Fields getUri :: Text

#### Instances

Instances details

FromJSON Uri |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods parseJSON :: Value -> Parser Uri # parseJSONList :: Value -> Parser [Uri] # omittedField :: Maybe Uri #
FromJSONKey Uri |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods fromJSONKey :: FromJSONKeyFunction Uri # fromJSONKeyList :: FromJSONKeyFunction [Uri] #
ToJSON Uri |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods toJSON :: Uri -> Value # toEncoding :: Uri -> Encoding # toJSONList :: [Uri] -> Value # toEncodingList :: [Uri] -> Encoding # omitField :: Uri -> Bool #
ToJSONKey Uri |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods toJSONKey :: ToJSONKeyFunction Uri # toJSONKeyList :: ToJSONKeyFunction [Uri] #
Generic Uri |
Instance details Defined in Language.LSP.Protocol.Types.Uri Associated Types type Rep Uri :: Type -> Type Methods from :: Uri -> Rep Uri x to :: Rep Uri x -> Uri
Read Uri |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods readsPrec :: Int -> ReadS Uri # readList :: ReadS [Uri] # readPrec :: ReadPrec Uri # readListPrec :: ReadPrec [Uri] #
Show Uri |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods showsPrec :: Int -> Uri -> ShowS # show :: Uri -> String # showList :: [Uri] -> ShowS #
NFData Uri |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods rnf :: Uri -> () #
Eq Uri |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods (==) :: Uri -> Uri -> Bool # (/=) :: Uri -> Uri -> Bool #
Ord Uri |
Instance details Defined in Language.LSP.Protocol.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
Hashable Uri |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods hashWithSalt :: Int -> Uri -> Int # hash :: Uri -> Int #
Pretty Uri |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods pretty :: Uri -> Doc ann # prettyList :: [Uri] -> Doc ann #
HasDocument NotebookCell Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods document :: Lens' NotebookCell Uri #
HasHref CodeDescription Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods href :: Lens' CodeDescription Uri #
HasNewUri RenameFile Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods newUri :: Lens' RenameFile Uri #
HasOldUri RenameFile Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods oldUri :: Lens' RenameFile Uri #
HasTargetUri LocationLink Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods targetUri :: Lens' LocationLink Uri #
HasUri CallHierarchyItem Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods uri :: Lens' CallHierarchyItem Uri #
HasUri CreateFile Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods uri :: Lens' CreateFile Uri #
HasUri DeleteFile Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods uri :: Lens' DeleteFile Uri #
HasUri FileEvent Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods uri :: Lens' FileEvent Uri #
HasUri Location Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods uri :: Lens' Location Uri #
HasUri NotebookDocument Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods uri :: Lens' NotebookDocument Uri #
HasUri NotebookDocumentIdentifier Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods uri :: Lens' NotebookDocumentIdentifier Uri #
HasUri OptionalVersionedTextDocumentIdentifier Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods uri :: Lens' OptionalVersionedTextDocumentIdentifier Uri #
HasUri PreviousResultId Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods uri :: Lens' PreviousResultId Uri #
HasUri PublishDiagnosticsParams Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods uri :: Lens' PublishDiagnosticsParams Uri #
HasUri ShowDocumentParams Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods uri :: Lens' ShowDocumentParams Uri #
HasUri TextDocumentIdentifier Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods uri :: Lens' TextDocumentIdentifier Uri #
HasUri TextDocumentItem Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods uri :: Lens' TextDocumentItem Uri #
HasUri TypeHierarchyItem Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods uri :: Lens' TypeHierarchyItem Uri #
HasUri VersionedNotebookDocumentIdentifier Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods uri :: Lens' VersionedNotebookDocumentIdentifier Uri #
HasUri VersionedTextDocumentIdentifier Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods uri :: Lens' VersionedTextDocumentIdentifier Uri #
HasUri WorkspaceFolder Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods uri :: Lens' WorkspaceFolder Uri #
HasUri WorkspaceFullDocumentDiagnosticReport Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods uri :: Lens' WorkspaceFullDocumentDiagnosticReport Uri #
HasUri WorkspaceUnchangedDocumentDiagnosticReport Uri |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods uri :: Lens' WorkspaceUnchangedDocumentDiagnosticReport Uri #
HasChanges WorkspaceEdit (Maybe (Map Uri [TextEdit])) |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods changes :: Lens' WorkspaceEdit (Maybe (Map Uri [TextEdit])) #
HasRelatedDocuments RelatedFullDocumentDiagnosticReport (Maybe (Map Uri (FullDocumentDiagnosticReport |? UnchangedDocumentDiagnosticReport))) |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods relatedDocuments :: Lens' RelatedFullDocumentDiagnosticReport (Maybe (Map Uri (FullDocumentDiagnosticReport |? UnchangedDocumentDiagnosticReport))) #
HasRelatedDocuments RelatedUnchangedDocumentDiagnosticReport (Maybe (Map Uri (FullDocumentDiagnosticReport |? UnchangedDocumentDiagnosticReport))) |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods relatedDocuments :: Lens' RelatedUnchangedDocumentDiagnosticReport (Maybe (Map Uri (FullDocumentDiagnosticReport |? UnchangedDocumentDiagnosticReport))) #
HasBaseUri RelativePattern (WorkspaceFolder |? Uri) |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods baseUri :: Lens' RelativePattern (WorkspaceFolder |? Uri) #
HasRelatedDocuments DocumentDiagnosticReportPartialResult (Map Uri (FullDocumentDiagnosticReport |? UnchangedDocumentDiagnosticReport)) |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods relatedDocuments :: Lens' DocumentDiagnosticReportPartialResult (Map Uri (FullDocumentDiagnosticReport |? UnchangedDocumentDiagnosticReport)) #
HasRootUri InitializeParams (Uri |? Null) |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods rootUri :: Lens' InitializeParams (Uri |? Null) #
HasRootUri UInitializeParams (Uri |? Null) |
Instance details Defined in Language.LSP.Protocol.Internal.Lens Methods rootUri :: Lens' UInitializeParams (Uri |? Null) #
type Rep Uri |
Instance details Defined in Language.LSP.Protocol.Types.Uri type Rep Uri = D1 ('MetaData "Uri" "Language.LSP.Protocol.Types.Uri" "lsp-types-2.0.2.0-6ldEQfFkAQaDyl5nknNRSX" 'True) (C1 ('MetaCons "Uri" 'PrefixI 'True) (S1 ('MetaSel ('Just "getUri") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data NormalizedUri #

A normalized `Uri`.

If you want to use a URI as a map key, use this type. 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.

`NormalizedUri` has a cached hash in order to make it especially fast in a hash map.

#### Instances

Instances details

Generic NormalizedUri |
Instance details Defined in Language.LSP.Protocol.Types.Uri Associated Types type Rep NormalizedUri :: Type -> Type Methods from :: NormalizedUri -> Rep NormalizedUri x to :: Rep NormalizedUri x -> NormalizedUri
Read NormalizedUri |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods readsPrec :: Int -> ReadS NormalizedUri # readList :: ReadS [NormalizedUri] # readPrec :: ReadPrec NormalizedUri # readListPrec :: ReadPrec [NormalizedUri] #
Show NormalizedUri |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods showsPrec :: Int -> NormalizedUri -> ShowS # show :: NormalizedUri -> String # showList :: [NormalizedUri] -> ShowS #
NFData NormalizedUri |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods rnf :: NormalizedUri -> () #
Eq NormalizedUri |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods (==) :: NormalizedUri -> NormalizedUri -> Bool # (/=) :: NormalizedUri -> NormalizedUri -> Bool #
Ord NormalizedUri |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods compare :: NormalizedUri -> NormalizedUri -> Ordering (<) :: NormalizedUri -> NormalizedUri -> Bool (<=) :: NormalizedUri -> NormalizedUri -> Bool (>) :: NormalizedUri -> NormalizedUri -> Bool (>=) :: NormalizedUri -> NormalizedUri -> Bool max :: NormalizedUri -> NormalizedUri -> NormalizedUri min :: NormalizedUri -> NormalizedUri -> NormalizedUri
Hashable NormalizedUri |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods hashWithSalt :: Int -> NormalizedUri -> Int # hash :: NormalizedUri -> Int #
Pretty NormalizedUri |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods pretty :: NormalizedUri -> Doc ann # prettyList :: [NormalizedUri] -> Doc ann #
HasVfsMap VFS (Map NormalizedUri VirtualFile) |
Instance details Defined in Language.LSP.VFS Methods vfsMap :: Lens' VFS (Map NormalizedUri VirtualFile) #
type Rep NormalizedUri |
Instance details Defined in Language.LSP.Protocol.Types.Uri type Rep NormalizedUri = D1 ('MetaData "NormalizedUri" "Language.LSP.Protocol.Types.Uri" "lsp-types-2.0.2.0-6ldEQfFkAQaDyl5nknNRSX" 'False) (C1 ('MetaCons "NormalizedUri" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)))

toNormalizedUri :: Uri -> NormalizedUri #

fromNormalizedUri :: NormalizedUri -> Uri #

data NormalizedFilePath #

A file path that is already normalized.

The `NormalizedUri` is 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 HLS, do not modify it without profiling.

#### Instances

Instances details

IsString NormalizedFilePath |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods fromString :: String -> NormalizedFilePath
Generic NormalizedFilePath |
Instance details Defined in Language.LSP.Protocol.Types.Uri Associated Types type Rep NormalizedFilePath :: Type -> Type Methods from :: NormalizedFilePath -> Rep NormalizedFilePath x to :: Rep NormalizedFilePath x -> NormalizedFilePath
Show NormalizedFilePath |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods showsPrec :: Int -> NormalizedFilePath -> ShowS # show :: NormalizedFilePath -> String # showList :: [NormalizedFilePath] -> ShowS #
Binary NormalizedFilePath |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods put :: NormalizedFilePath -> Put get :: Get NormalizedFilePath putList :: [NormalizedFilePath] -> Put
NFData NormalizedFilePath |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods rnf :: NormalizedFilePath -> () #
Eq NormalizedFilePath |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods (==) :: NormalizedFilePath -> NormalizedFilePath -> Bool # (/=) :: NormalizedFilePath -> NormalizedFilePath -> Bool #
Ord NormalizedFilePath |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods compare :: NormalizedFilePath -> NormalizedFilePath -> Ordering (<) :: NormalizedFilePath -> NormalizedFilePath -> Bool (<=) :: NormalizedFilePath -> NormalizedFilePath -> Bool (>) :: NormalizedFilePath -> NormalizedFilePath -> Bool (>=) :: NormalizedFilePath -> NormalizedFilePath -> Bool max :: NormalizedFilePath -> NormalizedFilePath -> NormalizedFilePath min :: NormalizedFilePath -> NormalizedFilePath -> NormalizedFilePath
Hashable NormalizedFilePath |
Instance details Defined in Language.LSP.Protocol.Types.Uri Methods hashWithSalt :: Int -> NormalizedFilePath -> Int # hash :: NormalizedFilePath -> Int #
type Rep NormalizedFilePath |
Instance details Defined in Language.LSP.Protocol.Types.Uri type Rep NormalizedFilePath = D1 ('MetaData "NormalizedFilePath" "Language.LSP.Protocol.Types.Uri" "lsp-types-2.0.2.0-6ldEQfFkAQaDyl5nknNRSX" 'False) (C1 ('MetaCons "NormalizedFilePath" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NormalizedUri) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedUnpack) (Rec0 Text)))

fromUri :: NormalizedUri -> NormalizedFilePath #

emptyFilePath :: NormalizedFilePath #

emptyPathUri :: NormalizedUri #

toNormalizedFilePath' :: FilePath -> NormalizedFilePath #

fromNormalizedFilePath :: NormalizedFilePath -> FilePath #

Extracts `FilePath` from `NormalizedFilePath`.

filePathToUri' :: NormalizedFilePath -> NormalizedUri #

uriToFilePath' :: Uri -> Maybe FilePath #

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 #

Parser for the GHC output format