Skip to content

Commit c974bb0

Browse files
author
Kobayashi
authored
fix textDocument/selectionRange's method (#388)
* fix selection range * remove Arbitrary instance for Value when aeson provides it
1 parent 08e8a72 commit c974bb0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lsp-types/src/Language/LSP/Types/Method.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ instance FromJSON SomeClientMethod where
320320
parseJSON (A.String "textDocument/rename") = pure $ SomeClientMethod STextDocumentRename
321321
parseJSON (A.String "textDocument/prepareRename") = pure $ SomeClientMethod STextDocumentPrepareRename
322322
parseJSON (A.String "textDocument/foldingRange") = pure $ SomeClientMethod STextDocumentFoldingRange
323-
parseJSON (A.String "textDocument/selectionRange") = pure $ SomeClientMethod STextDocumentFoldingRange
323+
parseJSON (A.String "textDocument/selectionRange") = pure $ SomeClientMethod STextDocumentSelectionRange
324324
parseJSON (A.String "textDocument/prepareCallHierarchy") = pure $ SomeClientMethod STextDocumentPrepareCallHierarchy
325325
parseJSON (A.String "callHierarchy/incomingCalls") = pure $ SomeClientMethod SCallHierarchyIncomingCalls
326326
parseJSON (A.String "callHierarchy/outgoingCalls") = pure $ SomeClientMethod SCallHierarchyOutgoingCalls

lsp/test/JsonSpec.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE UndecidableInstances #-}
23
{-# LANGUAGE FlexibleContexts #-}
34
{-# LANGUAGE TypeInType #-}
@@ -159,13 +160,15 @@ smallList = resize 3 . listOf
159160
instance (Arbitrary a) => Arbitrary (List a) where
160161
arbitrary = List <$> arbitrary
161162

163+
#if !MIN_VERSION_aeson(2,0,3)
162164
instance Arbitrary J.Value where
163165
arbitrary = oneof
164166
[ J.String <$> arbitrary
165167
, J.Number <$> arbitrary
166168
, J.Bool <$> arbitrary
167169
, pure J.Null
168170
]
171+
#endif
169172

170173
-- ---------------------------------------------------------------------
171174

0 commit comments

Comments
 (0)