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:
Moritz Kiefer 2019-05-31 15:43:36 +02:00 committed by mergify[bot]
parent 6cba2e57a4
commit e370589e77
2 changed files with 2 additions and 5 deletions

View File

@ -58,7 +58,7 @@ atPoint tcs srcSpans pos = do
SpanInfo{..} <- listToMaybe $ orderSpans $ spansAtPoint pos srcSpans
ty <- spaninfoType
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
docInfo = maybe [] (map HoverMarkdown . docHeaders) mbDocs
range = Range

View File

@ -16,9 +16,7 @@ import Development.IDE.Types.Diagnostics
-- | Different types of content we can show on hover.
data HoverText
= HoverHeading !T.Text
-- ^ A header that explains the content below it.
| HoverDamlCode !T.Text
= HoverDamlCode !T.Text
-- ^ Highlighted DAML-Code
| HoverMarkdown !T.Text
-- ^ Markdown text.
@ -26,7 +24,6 @@ data HoverText
getHoverTextContent :: HoverText -> T.Text
getHoverTextContent = \case
HoverHeading t -> t
HoverDamlCode t -> t
HoverMarkdown t -> t