File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
lsp-types/src/Language/LSP/Types Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 7
7
module Language.LSP.Types.LspId where
8
8
9
9
import qualified Data.Aeson as A
10
- import Data.Text ( Text )
10
+ import Data.Hashable
11
11
import Data.Int (Int32 )
12
12
import Data.IxMap
13
+ import Data.Text (Text )
13
14
14
15
import Language.LSP.Types.Method
15
16
@@ -30,6 +31,10 @@ instance IxOrd LspId where
30
31
type Base LspId = SomeLspId
31
32
toBase = SomeLspId
32
33
34
+ instance Hashable (LspId m ) where
35
+ hashWithSalt n (IdInt i) = hashWithSalt n i
36
+ hashWithSalt n (IdString t) = hashWithSalt n t
37
+
33
38
data SomeLspId where
34
39
SomeLspId :: ! (LspId m ) -> SomeLspId
35
40
@@ -45,3 +50,6 @@ instance Ord SomeLspId where
45
50
go (IdString a) (IdString b) = a `compare` b
46
51
go (IdInt _) (IdString _) = LT
47
52
go (IdString _) (IdInt _) = GT
53
+
54
+ instance Hashable SomeLspId where
55
+ hashWithSalt n (SomeLspId lspId) = hashWithSalt n lspId
You can’t perform that action at this time.
0 commit comments