mirror of
https://github.com/haskell/ghcide.git
synced 2024-12-17 23:22:04 +03:00
Switch Hover from MarkedString to MarkupContent (#1473)
MarkedString is deprecated in LSP (both the protocol itself and the Haskell library) so we should move away from it.
This commit is contained in:
parent
6cba2e57a4
commit
e370589e77
src/Development/IDE
@ -58,7 +58,7 @@ atPoint tcs srcSpans pos = do
|
|||||||
SpanInfo{..} <- listToMaybe $ orderSpans $ spansAtPoint pos srcSpans
|
SpanInfo{..} <- listToMaybe $ orderSpans $ spansAtPoint pos srcSpans
|
||||||
ty <- spaninfoType
|
ty <- spaninfoType
|
||||||
let mbName = getNameM spaninfoSource
|
let mbName = getNameM spaninfoSource
|
||||||
mbDefinedAt = HoverHeading . ("Defined " <>) . T.pack . showSDocUnsafe . pprNameDefnLoc <$> mbName
|
mbDefinedAt = fmap (\name -> HoverMarkdown $ "**Defined " <> T.pack (showSDocUnsafe $ pprNameDefnLoc name) <> "**\n") mbName
|
||||||
mbDocs = fmap (\name -> getDocumentation name tcs) mbName
|
mbDocs = fmap (\name -> getDocumentation name tcs) mbName
|
||||||
docInfo = maybe [] (map HoverMarkdown . docHeaders) mbDocs
|
docInfo = maybe [] (map HoverMarkdown . docHeaders) mbDocs
|
||||||
range = Range
|
range = Range
|
||||||
|
@ -16,9 +16,7 @@ import Development.IDE.Types.Diagnostics
|
|||||||
|
|
||||||
-- | Different types of content we can show on hover.
|
-- | Different types of content we can show on hover.
|
||||||
data HoverText
|
data HoverText
|
||||||
= HoverHeading !T.Text
|
= HoverDamlCode !T.Text
|
||||||
-- ^ A header that explains the content below it.
|
|
||||||
| HoverDamlCode !T.Text
|
|
||||||
-- ^ Highlighted DAML-Code
|
-- ^ Highlighted DAML-Code
|
||||||
| HoverMarkdown !T.Text
|
| HoverMarkdown !T.Text
|
||||||
-- ^ Markdown text.
|
-- ^ Markdown text.
|
||||||
@ -26,7 +24,6 @@ data HoverText
|
|||||||
|
|
||||||
getHoverTextContent :: HoverText -> T.Text
|
getHoverTextContent :: HoverText -> T.Text
|
||||||
getHoverTextContent = \case
|
getHoverTextContent = \case
|
||||||
HoverHeading t -> t
|
|
||||||
HoverDamlCode t -> t
|
HoverDamlCode t -> t
|
||||||
HoverMarkdown t -> t
|
HoverMarkdown t -> t
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user