X-Git-Url: http://git.lukelau.me/?a=blobdiff_plain;f=src%2FLanguage%2FHaskell%2FLSP%2FTest.hs;h=200dbb84807856959a2dfe0bf92faa8947eb8958;hb=72257c6a7b5461c529c415b93e1c3507e1c843a7;hp=761151e8ac9f282d9b8652f4b70a0ee29fbf4cbe;hpb=71f5ececdaa02c87b026c40d70fb55c4a0d05044;p=lsp-test.git diff --git a/src/Language/Haskell/LSP/Test.hs b/src/Language/Haskell/LSP/Test.hs index 761151e..200dbb8 100644 --- a/src/Language/Haskell/LSP/Test.hs +++ b/src/Language/Haskell/LSP/Test.hs @@ -399,7 +399,7 @@ createDoc file languageId contents = do when shouldSend $ sendNotification WorkspaceDidChangeWatchedFiles $ DidChangeWatchedFilesParams $ - List [ FileEvent (filePathToUri file) FcCreated ] + List [ FileEvent (filePathToUri (rootDir file)) FcCreated ] openDoc' file languageId contents -- | Opens a text document that /exists on disk/, and sends a @@ -611,9 +611,12 @@ getDefinitions doc pos = do getTypeDefinitions :: TextDocumentIdentifier -- ^ The document the term is in. -> Position -- ^ The position the term is at. -> Session [Location] -- ^ The location(s) of the definitions -getTypeDefinitions doc pos = +getTypeDefinitions doc pos = do let params = TextDocumentPositionParams doc pos Nothing - in getResponseResult <$> request TextDocumentTypeDefinition params + rsp <- request TextDocumentTypeDefinition params :: Session TypeDefinitionResponse + case getResponseResult rsp of + SingleLoc loc -> pure [loc] + MultiLoc locs -> pure locs -- | Renames the term at the specified position. rename :: TextDocumentIdentifier -> Position -> String -> Session ()