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 77module Language.LSP.Types.LspId where
88
99import qualified Data.Aeson as A
10- import Data.Text ( Text )
10+ import Data.Hashable
1111import Data.Int (Int32 )
1212import Data.IxMap
13+ import Data.Text (Text )
1314
1415import Language.LSP.Types.Method
1516
@@ -30,6 +31,10 @@ instance IxOrd LspId where
3031 type Base LspId = SomeLspId
3132 toBase = SomeLspId
3233
34+ instance Hashable (LspId m ) where
35+ hashWithSalt n (IdInt i) = hashWithSalt n i
36+ hashWithSalt n (IdString t) = hashWithSalt n t
37+
3338data SomeLspId where
3439 SomeLspId :: ! (LspId m ) -> SomeLspId
3540
@@ -45,3 +50,6 @@ instance Ord SomeLspId where
4550 go (IdString a) (IdString b) = a `compare` b
4651 go (IdInt _) (IdString _) = LT
4752 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