X-Git-Url: http://git.lukelau.me/?a=blobdiff_plain;f=src%2FLanguage%2FHaskell%2FLSP%2FTest.hs;h=e47109e03da0f1e83c84466423ad2fd2cd2262aa;hb=52fa38c9702407f58aeea09c6bded442d672d7fd;hp=d4c63110890707bcbb40a2457ffb2ac68b844590;hpb=9b78d100e96d3ea4c059edbc45d3d084dddcab0a;p=lsp-test.git diff --git a/src/Language/Haskell/LSP/Test.hs b/src/Language/Haskell/LSP/Test.hs index d4c6311..e47109e 100644 --- a/src/Language/Haskell/LSP/Test.hs +++ b/src/Language/Haskell/LSP/Test.hs @@ -69,6 +69,10 @@ module Language.Haskell.LSP.Test , getDefinitions -- ** Renaming , rename + -- ** Hover + , getHover + -- ** Highlights + , getHighlights -- ** Edits , applyEdit ) where @@ -459,6 +463,17 @@ rename doc pos newName = do req = RequestMessage "" (IdInt 0) WorkspaceApplyEdit (ApplyWorkspaceEditParams wEdit) updateState (ReqApplyWorkspaceEdit req) +-- ^ Returns the hover information at the specified position. +getHover :: TextDocumentIdentifier -> Position -> Session (Maybe Hover) +getHover doc pos = + let params = TextDocumentPositionParams doc pos + in getResponseResult <$> sendRequest TextDocumentHover params + +getHighlights :: TextDocumentIdentifier -> Position -> Session [DocumentHighlight] +getHighlights doc pos = + let params = TextDocumentPositionParams doc pos + in getResponseResult <$> sendRequest TextDocumentDocumentHighlight params + -- | Checks the response for errors and throws an exception if needed. -- Returns the result if successful. getResponseResult :: ResponseMessage a -> a