projects
/
lsp-test.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix getTypeDefinitions
[lsp-test.git]
/
src
/
Language
/
Haskell
/
LSP
/
Test.hs
diff --git
a/src/Language/Haskell/LSP/Test.hs
b/src/Language/Haskell/LSP/Test.hs
index 81bdc8a8b465087baa960fbc6b1303e8497fcff7..200dbb84807856959a2dfe0bf92faa8947eb8958 100644
(file)
--- a/
src/Language/Haskell/LSP/Test.hs
+++ b/
src/Language/Haskell/LSP/Test.hs
@@
-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 :: 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
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 ()
-- | Renames the term at the specified position.
rename :: TextDocumentIdentifier -> Position -> String -> Session ()