File tree 2 files changed +10
-0
lines changed
lsp-types/src/Language/LSP/Types
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ module Language.LSP.Types.Common (
18
18
import Control.Applicative
19
19
import Control.DeepSeq
20
20
import Data.Aeson
21
+ import Data.Hashable
21
22
import Data.Int (Int32 )
22
23
import Data.Mod.Word
23
24
import Text.Read (Read (readPrec ))
@@ -33,6 +34,8 @@ newtype UInt = UInt (Mod (2^31))
33
34
deriving stock (Generic )
34
35
deriving anyclass (NFData )
35
36
37
+ instance Hashable UInt where hashWithSalt s (UInt n) = hashWithSalt s (unMod n)
38
+
36
39
instance Show UInt where
37
40
show (UInt u) = show $ unMod u
38
41
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ module Language.LSP.Types.Location where
4
4
5
5
import Control.DeepSeq
6
6
import Data.Aeson.TH
7
+ import Data.Hashable
7
8
import GHC.Generics hiding (UInt )
8
9
import Language.LSP.Types.Common
9
10
import Language.LSP.Types.Uri
@@ -26,6 +27,8 @@ data Position =
26
27
instance NFData Position
27
28
deriveJSON lspOptions ''Position
28
29
30
+ instance Hashable Position
31
+
29
32
-- ---------------------------------------------------------------------
30
33
31
34
data Range =
@@ -37,6 +40,8 @@ data Range =
37
40
instance NFData Range
38
41
deriveJSON lspOptions ''Range
39
42
43
+ instance Hashable Range
44
+
40
45
-- ---------------------------------------------------------------------
41
46
42
47
data Location =
@@ -48,6 +53,8 @@ data Location =
48
53
instance NFData Location
49
54
deriveJSON lspOptions ''Location
50
55
56
+ instance Hashable Location
57
+
51
58
-- ---------------------------------------------------------------------
52
59
53
60
-- | Represents a link between a source and a target location.
You can’t perform that action at this time.
0 commit comments