Skip to content

Commit 8a07d0e

Browse files
committed
Add a context parameter for getSignatureHelp
I find it is useful to pass the context when implementing the signature help feature for HLS.
1 parent d499c94 commit 8a07d0e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lsp-test/src/Language/LSP/Test.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -937,9 +937,9 @@ getHover doc pos =
937937
in nullToMaybe . getResponseResult <$> request SMethod_TextDocumentHover params
938938

939939
-- | Returns the signature help at the specified position.
940-
getSignatureHelp :: TextDocumentIdentifier -> Position -> Session (Maybe SignatureHelp)
941-
getSignatureHelp doc pos =
942-
let params = SignatureHelpParams doc pos Nothing Nothing
940+
getSignatureHelp :: TextDocumentIdentifier -> Position -> Maybe SignatureHelpContext -> Session (Maybe SignatureHelp)
941+
getSignatureHelp doc pos mCtx =
942+
let params = SignatureHelpParams doc pos Nothing mCtx
943943
in nullToMaybe . getResponseResult <$> request SMethod_TextDocumentSignatureHelp params
944944

945945
-- | Returns the highlighted occurrences of the term at the specified position

lsp-test/test/Test.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ main = hspec $ around withDummyServer $ do
310310
describe "getSignatureHelp" $
311311
it "works" $ \(hin, hout) -> runSessionWithHandles hin hout def fullLatestClientCaps "." $ do
312312
doc <- openDoc "test/data/renamePass/Desktop/simple.hs" "haskell"
313-
signatureHelp <- getSignatureHelp doc (Position 22 32)
313+
signatureHelp <- getSignatureHelp doc (Position 22 32) Nothing
314314
liftIO $ signatureHelp `shouldSatisfy` isJust
315315

316316
-- describe "getHighlights" $

0 commit comments

Comments
 (0)