mirror of
https://github.com/haskell/ghcide.git
synced 2024-12-17 15:11:41 +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
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user