Skip to content

Commit 4b10b43

Browse files
committed
Implement michaelpj's suggestions
1 parent 75826fb commit 4b10b43

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

lsp-types/lsp-types.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,12 @@ library
115115
Language.LSP.Protocol.Message.Registration
116116
Language.LSP.Protocol.Message.Types
117117
Language.LSP.Protocol.Types.Common
118-
Language.LSP.Protocol.Types.CustomInstances
119118
Language.LSP.Protocol.Types.Edit
120119
Language.LSP.Protocol.Types.Lens
121120
Language.LSP.Protocol.Types.Location
122121
Language.LSP.Protocol.Types.LspEnum
123122
Language.LSP.Protocol.Types.MarkupContent
123+
Language.LSP.Protocol.Types.Orphans
124124
Language.LSP.Protocol.Types.Progress
125125
Language.LSP.Protocol.Types.SemanticTokens
126126
Language.LSP.Protocol.Types.Singletons

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ module Language.LSP.Protocol.Types (
2222
, module SemanticTokens
2323
-- * Main LSP types and functions
2424
, module Generated
25-
-- ** Custom instances for the generated types
26-
, module CustomInstances
25+
-- ** Orphan instances for the generated types
26+
, module Orphans
2727
) where
2828

2929
import Language.LSP.Protocol.Internal.Types as Generated
@@ -37,4 +37,4 @@ import Language.LSP.Protocol.Types.Singletons as Singletons
3737
import Language.LSP.Protocol.Types.Uri as Uri
3838
import Language.LSP.Protocol.Types.Uri.OsPath as Uri
3939
import Language.LSP.Protocol.Types.Edit as Edits
40-
import Language.LSP.Protocol.Types.CustomInstances as CustomInstances
40+
import Language.LSP.Protocol.Types.Orphans as Orphans

lsp-types/src/Language/LSP/Protocol/Types/Common.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ maybeToNull :: Maybe a -> a |? Null
128128
maybeToNull (Just x) = InL x
129129
maybeToNull Nothing = InR Null
130130

131+
-- This is equivalent to the instance for 'Maybe s'
131132
instance Semigroup s => Semigroup (s |? Null) where
132133
InL x <> InL y = InL (x <> y)
133134
InL x <> InR _ = InL x
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
11
{-# OPTIONS_GHC -Wno-orphans #-}
2-
module Language.LSP.Protocol.Types.CustomInstances where
2+
module Language.LSP.Protocol.Types.Orphans where
33

44
import Language.LSP.Protocol.Internal.Types
55
import Data.Default
6-
import Data.Hashable
76
import Data.Semigroup ()
87

98
instance Semigroup WorkspaceEdit where
109
(WorkspaceEdit a b c) <> (WorkspaceEdit a' b' c') = WorkspaceEdit (a <> a') (b <> b') (c <> c')
1110
instance Monoid WorkspaceEdit where
1211
mempty = WorkspaceEdit Nothing Nothing Nothing
1312

14-
instance Hashable Location
15-
instance Hashable Range
16-
instance Hashable Position
17-
1813
instance Default ClientCapabilities where
19-
def = ClientCapabilities (Just def) (Just def) (Just def) (Just def) (Just def) Nothing
20-
14+
def = ClientCapabilities def def def def def Nothing
2115
instance Default WorkspaceClientCapabilities
2216
instance Default TextDocumentClientCapabilities
2317
instance Default NotebookDocumentClientCapabilities where
24-
def = NotebookDocumentClientCapabilities def
2518
instance Default NotebookDocumentSyncClientCapabilities
2619
instance Default WindowClientCapabilities
2720
instance Default GeneralClientCapabilities

0 commit comments

Comments
 (0)