Safe Haskell | None |
---|---|
Language | GHC2021 |
Development.IDE.Spans.Common
Synopsis
- unqualIEWrapName :: IEWrappedName GhcPs -> Text
- safeTyThingId :: TyThing -> Maybe Id
- safeTyThingType :: TyThing -> Maybe Type
- data SpanDoc
- data SpanDocUris = SpanDocUris {}
- emptySpanDoc :: SpanDoc
- spanDocToMarkdown :: SpanDoc -> [Text]
- spanDocToMarkdownForTest :: String -> String
- type DocMap = NameEnv SpanDoc
- type TyThingMap = NameEnv TyThing
- srcSpanToMdLink :: Location -> Text
Documentation
unqualIEWrapName :: IEWrappedName GhcPs -> Text Source #
Shows IEWrappedName, without any modifier, qualifier or unique identifier.
Constructors
SpanDocString [HsDocString] SpanDocUris | |
SpanDocText [Text] SpanDocUris |
Instances
data SpanDocUris Source #
Constructors
SpanDocUris | |
Fields
|
Instances
Generic SpanDocUris Source # | |||||
Defined in Development.IDE.Spans.Common Associated Types
| |||||
Show SpanDocUris Source # | |||||
Defined in Development.IDE.Spans.Common Methods showsPrec :: Int -> SpanDocUris -> ShowS # show :: SpanDocUris -> String # showList :: [SpanDocUris] -> ShowS # | |||||
NFData SpanDocUris Source # | |||||
Defined in Development.IDE.Spans.Common Methods rnf :: SpanDocUris -> () # | |||||
Eq SpanDocUris Source # | |||||
Defined in Development.IDE.Spans.Common | |||||
type Rep SpanDocUris Source # | |||||
Defined in Development.IDE.Spans.Common type Rep SpanDocUris = D1 ('MetaData "SpanDocUris" "Development.IDE.Spans.Common" "ghcide-2.11.0.0-IzuGh9ZsoLJF9Sbc2JF8Yt" 'False) (C1 ('MetaCons "SpanDocUris" 'PrefixI 'True) (S1 ('MetaSel ('Just "spanDocUriDoc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "spanDocUriSrc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)))) |
spanDocToMarkdown :: SpanDoc -> [Text] Source #
Convert SpanDoc
to Markdown format.
Return a list Text
includes haddock, document uri and source code uri,
each item can be empty and must end with '\n' if exist. This is to prevent
subsequent render problem caused by the missing newline.
Example:
For return value ["xxxx","yyyy"], if we concat the list with inserting a separate line(note by "---n"), it will result "xxxx---nyyyy" and can't be rendered as a normal doc. Therefore we check every item in the value to make sure they all end with '\n', this makes "xxxxn---nyyyn" and can be rendered correctly.
Notes:
To insert a new line in Markdown, we need two '\n', like ("\n\n"), or a section symbol with one '\n', like ("***\n").
type TyThingMap = NameEnv TyThing Source #
srcSpanToMdLink :: Location -> Text Source #
Generate a source link for the Location
according to VSCode's supported form:
https://github.com/microsoft/vscode/blob/b3ec8181fc49f5462b5128f38e0723ae85e295c2/src/vs/platform/opener/common/opener.ts#L151-L160