{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE TemplateHaskell #-}
-- | Signature Help Request
-- https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#signature-help-request
module Language.LSP.Types.SignatureHelp where
    
import Data.Aeson
import Data.Aeson.TH
import Data.Text (Text)
import Language.LSP.Types.Common
import Language.LSP.Types.MarkupContent
import Language.LSP.Types.Progress
import Language.LSP.Types.TextDocument
import Language.LSP.Types.Utils

-- -------------------------------------

data SignatureHelpParameterInformation =
  SignatureHelpParameterInformation
    { -- | The client supports processing label offsets instead of a simple
      -- label string.
      --
      -- @since 3.14.0
      SignatureHelpParameterInformation -> Maybe Bool
_labelOffsetSupport :: Maybe Bool
    }
  deriving (ReadPrec [SignatureHelpParameterInformation]
ReadPrec SignatureHelpParameterInformation
Int -> ReadS SignatureHelpParameterInformation
ReadS [SignatureHelpParameterInformation]
(Int -> ReadS SignatureHelpParameterInformation)
-> ReadS [SignatureHelpParameterInformation]
-> ReadPrec SignatureHelpParameterInformation
-> ReadPrec [SignatureHelpParameterInformation]
-> Read SignatureHelpParameterInformation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SignatureHelpParameterInformation]
$creadListPrec :: ReadPrec [SignatureHelpParameterInformation]
readPrec :: ReadPrec SignatureHelpParameterInformation
$creadPrec :: ReadPrec SignatureHelpParameterInformation
readList :: ReadS [SignatureHelpParameterInformation]
$creadList :: ReadS [SignatureHelpParameterInformation]
readsPrec :: Int -> ReadS SignatureHelpParameterInformation
$creadsPrec :: Int -> ReadS SignatureHelpParameterInformation
Read, Int -> SignatureHelpParameterInformation -> ShowS
[SignatureHelpParameterInformation] -> ShowS
SignatureHelpParameterInformation -> String
(Int -> SignatureHelpParameterInformation -> ShowS)
-> (SignatureHelpParameterInformation -> String)
-> ([SignatureHelpParameterInformation] -> ShowS)
-> Show SignatureHelpParameterInformation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SignatureHelpParameterInformation] -> ShowS
$cshowList :: [SignatureHelpParameterInformation] -> ShowS
show :: SignatureHelpParameterInformation -> String
$cshow :: SignatureHelpParameterInformation -> String
showsPrec :: Int -> SignatureHelpParameterInformation -> ShowS
$cshowsPrec :: Int -> SignatureHelpParameterInformation -> ShowS
Show, SignatureHelpParameterInformation
-> SignatureHelpParameterInformation -> Bool
(SignatureHelpParameterInformation
 -> SignatureHelpParameterInformation -> Bool)
-> (SignatureHelpParameterInformation
    -> SignatureHelpParameterInformation -> Bool)
-> Eq SignatureHelpParameterInformation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SignatureHelpParameterInformation
-> SignatureHelpParameterInformation -> Bool
$c/= :: SignatureHelpParameterInformation
-> SignatureHelpParameterInformation -> Bool
== :: SignatureHelpParameterInformation
-> SignatureHelpParameterInformation -> Bool
$c== :: SignatureHelpParameterInformation
-> SignatureHelpParameterInformation -> Bool
Eq)
deriveJSON lspOptions ''SignatureHelpParameterInformation

data SignatureHelpSignatureInformation =
  SignatureHelpSignatureInformation
    { -- | Client supports the follow content formats for the documentation
      -- property. The order describes the preferred format of the client.
      SignatureHelpSignatureInformation -> Maybe (List MarkupKind)
_documentationFormat :: Maybe (List MarkupKind)
      -- | Client capabilities specific to parameter information.
    , SignatureHelpSignatureInformation
-> Maybe SignatureHelpParameterInformation
_parameterInformation :: Maybe SignatureHelpParameterInformation
    }
  deriving (Int -> SignatureHelpSignatureInformation -> ShowS
[SignatureHelpSignatureInformation] -> ShowS
SignatureHelpSignatureInformation -> String
(Int -> SignatureHelpSignatureInformation -> ShowS)
-> (SignatureHelpSignatureInformation -> String)
-> ([SignatureHelpSignatureInformation] -> ShowS)
-> Show SignatureHelpSignatureInformation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SignatureHelpSignatureInformation] -> ShowS
$cshowList :: [SignatureHelpSignatureInformation] -> ShowS
show :: SignatureHelpSignatureInformation -> String
$cshow :: SignatureHelpSignatureInformation -> String
showsPrec :: Int -> SignatureHelpSignatureInformation -> ShowS
$cshowsPrec :: Int -> SignatureHelpSignatureInformation -> ShowS
Show, ReadPrec [SignatureHelpSignatureInformation]
ReadPrec SignatureHelpSignatureInformation
Int -> ReadS SignatureHelpSignatureInformation
ReadS [SignatureHelpSignatureInformation]
(Int -> ReadS SignatureHelpSignatureInformation)
-> ReadS [SignatureHelpSignatureInformation]
-> ReadPrec SignatureHelpSignatureInformation
-> ReadPrec [SignatureHelpSignatureInformation]
-> Read SignatureHelpSignatureInformation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SignatureHelpSignatureInformation]
$creadListPrec :: ReadPrec [SignatureHelpSignatureInformation]
readPrec :: ReadPrec SignatureHelpSignatureInformation
$creadPrec :: ReadPrec SignatureHelpSignatureInformation
readList :: ReadS [SignatureHelpSignatureInformation]
$creadList :: ReadS [SignatureHelpSignatureInformation]
readsPrec :: Int -> ReadS SignatureHelpSignatureInformation
$creadsPrec :: Int -> ReadS SignatureHelpSignatureInformation
Read, SignatureHelpSignatureInformation
-> SignatureHelpSignatureInformation -> Bool
(SignatureHelpSignatureInformation
 -> SignatureHelpSignatureInformation -> Bool)
-> (SignatureHelpSignatureInformation
    -> SignatureHelpSignatureInformation -> Bool)
-> Eq SignatureHelpSignatureInformation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SignatureHelpSignatureInformation
-> SignatureHelpSignatureInformation -> Bool
$c/= :: SignatureHelpSignatureInformation
-> SignatureHelpSignatureInformation -> Bool
== :: SignatureHelpSignatureInformation
-> SignatureHelpSignatureInformation -> Bool
$c== :: SignatureHelpSignatureInformation
-> SignatureHelpSignatureInformation -> Bool
Eq)

deriveJSON lspOptions ''SignatureHelpSignatureInformation

data SignatureHelpClientCapabilities =
  SignatureHelpClientCapabilities
    { -- | Whether signature help supports dynamic registration.
      SignatureHelpClientCapabilities -> Maybe Bool
_dynamicRegistration :: Maybe Bool
      -- | The client supports the following 'SignatureInformation'
      -- specific properties.
    , SignatureHelpClientCapabilities
-> Maybe SignatureHelpSignatureInformation
_signatureInformation :: Maybe SignatureHelpSignatureInformation
      -- | The client supports to send additional context information for a
      -- @textDocument/signatureHelp@ request. A client that opts into
      -- contextSupport will also support the '_retriggerCharacters' on
      -- 'SignatureHelpOptions'.
      --
      -- @since 3.15.0
    , SignatureHelpClientCapabilities -> Maybe Bool
_contextSupport :: Maybe Bool
    } deriving (Int -> SignatureHelpClientCapabilities -> ShowS
[SignatureHelpClientCapabilities] -> ShowS
SignatureHelpClientCapabilities -> String
(Int -> SignatureHelpClientCapabilities -> ShowS)
-> (SignatureHelpClientCapabilities -> String)
-> ([SignatureHelpClientCapabilities] -> ShowS)
-> Show SignatureHelpClientCapabilities
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SignatureHelpClientCapabilities] -> ShowS
$cshowList :: [SignatureHelpClientCapabilities] -> ShowS
show :: SignatureHelpClientCapabilities -> String
$cshow :: SignatureHelpClientCapabilities -> String
showsPrec :: Int -> SignatureHelpClientCapabilities -> ShowS
$cshowsPrec :: Int -> SignatureHelpClientCapabilities -> ShowS
Show, ReadPrec [SignatureHelpClientCapabilities]
ReadPrec SignatureHelpClientCapabilities
Int -> ReadS SignatureHelpClientCapabilities
ReadS [SignatureHelpClientCapabilities]
(Int -> ReadS SignatureHelpClientCapabilities)
-> ReadS [SignatureHelpClientCapabilities]
-> ReadPrec SignatureHelpClientCapabilities
-> ReadPrec [SignatureHelpClientCapabilities]
-> Read SignatureHelpClientCapabilities
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SignatureHelpClientCapabilities]
$creadListPrec :: ReadPrec [SignatureHelpClientCapabilities]
readPrec :: ReadPrec SignatureHelpClientCapabilities
$creadPrec :: ReadPrec SignatureHelpClientCapabilities
readList :: ReadS [SignatureHelpClientCapabilities]
$creadList :: ReadS [SignatureHelpClientCapabilities]
readsPrec :: Int -> ReadS SignatureHelpClientCapabilities
$creadsPrec :: Int -> ReadS SignatureHelpClientCapabilities
Read, SignatureHelpClientCapabilities
-> SignatureHelpClientCapabilities -> Bool
(SignatureHelpClientCapabilities
 -> SignatureHelpClientCapabilities -> Bool)
-> (SignatureHelpClientCapabilities
    -> SignatureHelpClientCapabilities -> Bool)
-> Eq SignatureHelpClientCapabilities
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SignatureHelpClientCapabilities
-> SignatureHelpClientCapabilities -> Bool
$c/= :: SignatureHelpClientCapabilities
-> SignatureHelpClientCapabilities -> Bool
== :: SignatureHelpClientCapabilities
-> SignatureHelpClientCapabilities -> Bool
$c== :: SignatureHelpClientCapabilities
-> SignatureHelpClientCapabilities -> Bool
Eq)

deriveJSON lspOptions ''SignatureHelpClientCapabilities

-- -------------------------------------

makeExtendingDatatype "SignatureHelpOptions" [''WorkDoneProgressOptions]
  [ ("_triggerCharacters", [t| Maybe (List String) |])
  , ("_retriggerCharacters", [t| Maybe (List String) |])
  ]
deriveJSON lspOptions ''SignatureHelpOptions

makeExtendingDatatype "SignatureHelpRegistrationOptions"
  [ ''TextDocumentRegistrationOptions
  , ''SignatureHelpOptions
  ] []
deriveJSON lspOptions ''SignatureHelpRegistrationOptions

-- -------------------------------------

data ParameterInformation =
  ParameterInformation
    { ParameterInformation -> Text
_label         :: Text
    , ParameterInformation -> Maybe Text
_documentation :: Maybe Text
    } deriving (ReadPrec [ParameterInformation]
ReadPrec ParameterInformation
Int -> ReadS ParameterInformation
ReadS [ParameterInformation]
(Int -> ReadS ParameterInformation)
-> ReadS [ParameterInformation]
-> ReadPrec ParameterInformation
-> ReadPrec [ParameterInformation]
-> Read ParameterInformation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ParameterInformation]
$creadListPrec :: ReadPrec [ParameterInformation]
readPrec :: ReadPrec ParameterInformation
$creadPrec :: ReadPrec ParameterInformation
readList :: ReadS [ParameterInformation]
$creadList :: ReadS [ParameterInformation]
readsPrec :: Int -> ReadS ParameterInformation
$creadsPrec :: Int -> ReadS ParameterInformation
Read,Int -> ParameterInformation -> ShowS
[ParameterInformation] -> ShowS
ParameterInformation -> String
(Int -> ParameterInformation -> ShowS)
-> (ParameterInformation -> String)
-> ([ParameterInformation] -> ShowS)
-> Show ParameterInformation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParameterInformation] -> ShowS
$cshowList :: [ParameterInformation] -> ShowS
show :: ParameterInformation -> String
$cshow :: ParameterInformation -> String
showsPrec :: Int -> ParameterInformation -> ShowS
$cshowsPrec :: Int -> ParameterInformation -> ShowS
Show,ParameterInformation -> ParameterInformation -> Bool
(ParameterInformation -> ParameterInformation -> Bool)
-> (ParameterInformation -> ParameterInformation -> Bool)
-> Eq ParameterInformation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParameterInformation -> ParameterInformation -> Bool
$c/= :: ParameterInformation -> ParameterInformation -> Bool
== :: ParameterInformation -> ParameterInformation -> Bool
$c== :: ParameterInformation -> ParameterInformation -> Bool
Eq)
deriveJSON lspOptions ''ParameterInformation

-- -------------------------------------

data SignatureInformation =
  SignatureInformation
    { SignatureInformation -> Text
_label         :: Text
    , SignatureInformation -> Maybe Text
_documentation :: Maybe Text
    , SignatureInformation -> Maybe (List ParameterInformation)
_parameters    :: Maybe (List ParameterInformation)
    } deriving (ReadPrec [SignatureInformation]
ReadPrec SignatureInformation
Int -> ReadS SignatureInformation
ReadS [SignatureInformation]
(Int -> ReadS SignatureInformation)
-> ReadS [SignatureInformation]
-> ReadPrec SignatureInformation
-> ReadPrec [SignatureInformation]
-> Read SignatureInformation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SignatureInformation]
$creadListPrec :: ReadPrec [SignatureInformation]
readPrec :: ReadPrec SignatureInformation
$creadPrec :: ReadPrec SignatureInformation
readList :: ReadS [SignatureInformation]
$creadList :: ReadS [SignatureInformation]
readsPrec :: Int -> ReadS SignatureInformation
$creadsPrec :: Int -> ReadS SignatureInformation
Read,Int -> SignatureInformation -> ShowS
[SignatureInformation] -> ShowS
SignatureInformation -> String
(Int -> SignatureInformation -> ShowS)
-> (SignatureInformation -> String)
-> ([SignatureInformation] -> ShowS)
-> Show SignatureInformation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SignatureInformation] -> ShowS
$cshowList :: [SignatureInformation] -> ShowS
show :: SignatureInformation -> String
$cshow :: SignatureInformation -> String
showsPrec :: Int -> SignatureInformation -> ShowS
$cshowsPrec :: Int -> SignatureInformation -> ShowS
Show,SignatureInformation -> SignatureInformation -> Bool
(SignatureInformation -> SignatureInformation -> Bool)
-> (SignatureInformation -> SignatureInformation -> Bool)
-> Eq SignatureInformation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SignatureInformation -> SignatureInformation -> Bool
$c/= :: SignatureInformation -> SignatureInformation -> Bool
== :: SignatureInformation -> SignatureInformation -> Bool
$c== :: SignatureInformation -> SignatureInformation -> Bool
Eq)

deriveJSON lspOptions ''SignatureInformation

data SignatureHelp =
  SignatureHelp
    { SignatureHelp -> List SignatureInformation
_signatures      :: List SignatureInformation
    , SignatureHelp -> Maybe Int
_activeSignature :: Maybe Int -- ^ The active signature
    , SignatureHelp -> Maybe Int
_activeParameter :: Maybe Int -- ^ The active parameter of the active signature
    } deriving (ReadPrec [SignatureHelp]
ReadPrec SignatureHelp
Int -> ReadS SignatureHelp
ReadS [SignatureHelp]
(Int -> ReadS SignatureHelp)
-> ReadS [SignatureHelp]
-> ReadPrec SignatureHelp
-> ReadPrec [SignatureHelp]
-> Read SignatureHelp
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SignatureHelp]
$creadListPrec :: ReadPrec [SignatureHelp]
readPrec :: ReadPrec SignatureHelp
$creadPrec :: ReadPrec SignatureHelp
readList :: ReadS [SignatureHelp]
$creadList :: ReadS [SignatureHelp]
readsPrec :: Int -> ReadS SignatureHelp
$creadsPrec :: Int -> ReadS SignatureHelp
Read,Int -> SignatureHelp -> ShowS
[SignatureHelp] -> ShowS
SignatureHelp -> String
(Int -> SignatureHelp -> ShowS)
-> (SignatureHelp -> String)
-> ([SignatureHelp] -> ShowS)
-> Show SignatureHelp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SignatureHelp] -> ShowS
$cshowList :: [SignatureHelp] -> ShowS
show :: SignatureHelp -> String
$cshow :: SignatureHelp -> String
showsPrec :: Int -> SignatureHelp -> ShowS
$cshowsPrec :: Int -> SignatureHelp -> ShowS
Show,SignatureHelp -> SignatureHelp -> Bool
(SignatureHelp -> SignatureHelp -> Bool)
-> (SignatureHelp -> SignatureHelp -> Bool) -> Eq SignatureHelp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SignatureHelp -> SignatureHelp -> Bool
$c/= :: SignatureHelp -> SignatureHelp -> Bool
== :: SignatureHelp -> SignatureHelp -> Bool
$c== :: SignatureHelp -> SignatureHelp -> Bool
Eq)

deriveJSON lspOptions ''SignatureHelp

-- -------------------------------------

data SignatureHelpTriggerKind = SHTKInvoked
                              | SHTKTriggerCharacter
                              | SHTKContentChange
  deriving (ReadPrec [SignatureHelpTriggerKind]
ReadPrec SignatureHelpTriggerKind
Int -> ReadS SignatureHelpTriggerKind
ReadS [SignatureHelpTriggerKind]
(Int -> ReadS SignatureHelpTriggerKind)
-> ReadS [SignatureHelpTriggerKind]
-> ReadPrec SignatureHelpTriggerKind
-> ReadPrec [SignatureHelpTriggerKind]
-> Read SignatureHelpTriggerKind
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SignatureHelpTriggerKind]
$creadListPrec :: ReadPrec [SignatureHelpTriggerKind]
readPrec :: ReadPrec SignatureHelpTriggerKind
$creadPrec :: ReadPrec SignatureHelpTriggerKind
readList :: ReadS [SignatureHelpTriggerKind]
$creadList :: ReadS [SignatureHelpTriggerKind]
readsPrec :: Int -> ReadS SignatureHelpTriggerKind
$creadsPrec :: Int -> ReadS SignatureHelpTriggerKind
Read,Int -> SignatureHelpTriggerKind -> ShowS
[SignatureHelpTriggerKind] -> ShowS
SignatureHelpTriggerKind -> String
(Int -> SignatureHelpTriggerKind -> ShowS)
-> (SignatureHelpTriggerKind -> String)
-> ([SignatureHelpTriggerKind] -> ShowS)
-> Show SignatureHelpTriggerKind
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SignatureHelpTriggerKind] -> ShowS
$cshowList :: [SignatureHelpTriggerKind] -> ShowS
show :: SignatureHelpTriggerKind -> String
$cshow :: SignatureHelpTriggerKind -> String
showsPrec :: Int -> SignatureHelpTriggerKind -> ShowS
$cshowsPrec :: Int -> SignatureHelpTriggerKind -> ShowS
Show,SignatureHelpTriggerKind -> SignatureHelpTriggerKind -> Bool
(SignatureHelpTriggerKind -> SignatureHelpTriggerKind -> Bool)
-> (SignatureHelpTriggerKind -> SignatureHelpTriggerKind -> Bool)
-> Eq SignatureHelpTriggerKind
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SignatureHelpTriggerKind -> SignatureHelpTriggerKind -> Bool
$c/= :: SignatureHelpTriggerKind -> SignatureHelpTriggerKind -> Bool
== :: SignatureHelpTriggerKind -> SignatureHelpTriggerKind -> Bool
$c== :: SignatureHelpTriggerKind -> SignatureHelpTriggerKind -> Bool
Eq)

instance ToJSON SignatureHelpTriggerKind where
  toJSON :: SignatureHelpTriggerKind -> Value
toJSON SignatureHelpTriggerKind
SHTKInvoked          = Scientific -> Value
Number Scientific
1
  toJSON SignatureHelpTriggerKind
SHTKTriggerCharacter = Scientific -> Value
Number Scientific
2
  toJSON SignatureHelpTriggerKind
SHTKContentChange    = Scientific -> Value
Number Scientific
3

instance FromJSON SignatureHelpTriggerKind where
  parseJSON :: Value -> Parser SignatureHelpTriggerKind
parseJSON (Number Scientific
1) = SignatureHelpTriggerKind -> Parser SignatureHelpTriggerKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SignatureHelpTriggerKind
SHTKInvoked
  parseJSON (Number Scientific
2) = SignatureHelpTriggerKind -> Parser SignatureHelpTriggerKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SignatureHelpTriggerKind
SHTKTriggerCharacter
  parseJSON (Number Scientific
3) = SignatureHelpTriggerKind -> Parser SignatureHelpTriggerKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SignatureHelpTriggerKind
SHTKContentChange
  parseJSON Value
_          = Parser SignatureHelpTriggerKind
forall a. Monoid a => a
mempty

-- | Additional information about the context in which a signature help request
-- was triggered.
data SignatureHelpContext = 
  SignatureHelpContext
    { -- | Action that caused signature help to be triggered.
      SignatureHelpContext -> SignatureHelpTriggerKind
_triggerKind :: SignatureHelpTriggerKind
      -- | Character that caused signature help to be triggered. This is
      -- undefined when @triggerKind !==
      -- SignatureHelpTriggerKind.TriggerCharacter@
    , SignatureHelpContext -> Maybe String
_triggerCharacter :: Maybe String
      -- | 'True' if signature help was already showing when it was triggered.
      -- 
      -- Retriggers occur when the signature help is already active and can be
      -- caused by actions such as typing a trigger character, a cursor move, or
      -- document content changes.
    , SignatureHelpContext -> Bool
_isRetrigger :: Bool
      -- | The currently active 'SignatureHelp'.
      -- 
      -- The '_activeSignatureHelp' has its @SignatureHelp.activeSignature@
      -- field updated based on the user navigating through available
      -- signatures.
    , SignatureHelpContext -> Maybe SignatureHelp
_activeSignatureHelp :: Maybe SignatureHelp
    }
  deriving (ReadPrec [SignatureHelpContext]
ReadPrec SignatureHelpContext
Int -> ReadS SignatureHelpContext
ReadS [SignatureHelpContext]
(Int -> ReadS SignatureHelpContext)
-> ReadS [SignatureHelpContext]
-> ReadPrec SignatureHelpContext
-> ReadPrec [SignatureHelpContext]
-> Read SignatureHelpContext
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SignatureHelpContext]
$creadListPrec :: ReadPrec [SignatureHelpContext]
readPrec :: ReadPrec SignatureHelpContext
$creadPrec :: ReadPrec SignatureHelpContext
readList :: ReadS [SignatureHelpContext]
$creadList :: ReadS [SignatureHelpContext]
readsPrec :: Int -> ReadS SignatureHelpContext
$creadsPrec :: Int -> ReadS SignatureHelpContext
Read,Int -> SignatureHelpContext -> ShowS
[SignatureHelpContext] -> ShowS
SignatureHelpContext -> String
(Int -> SignatureHelpContext -> ShowS)
-> (SignatureHelpContext -> String)
-> ([SignatureHelpContext] -> ShowS)
-> Show SignatureHelpContext
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SignatureHelpContext] -> ShowS
$cshowList :: [SignatureHelpContext] -> ShowS
show :: SignatureHelpContext -> String
$cshow :: SignatureHelpContext -> String
showsPrec :: Int -> SignatureHelpContext -> ShowS
$cshowsPrec :: Int -> SignatureHelpContext -> ShowS
Show,SignatureHelpContext -> SignatureHelpContext -> Bool
(SignatureHelpContext -> SignatureHelpContext -> Bool)
-> (SignatureHelpContext -> SignatureHelpContext -> Bool)
-> Eq SignatureHelpContext
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SignatureHelpContext -> SignatureHelpContext -> Bool
$c/= :: SignatureHelpContext -> SignatureHelpContext -> Bool
== :: SignatureHelpContext -> SignatureHelpContext -> Bool
$c== :: SignatureHelpContext -> SignatureHelpContext -> Bool
Eq)
deriveJSON lspOptions ''SignatureHelpContext

makeExtendingDatatype "SignatureHelpParams"
  [ ''TextDocumentPositionParams
  , ''WorkDoneProgressParams
  ]
  [ ("_context", [t| Maybe SignatureHelpContext |])
  ]
deriveJSON lspOptions ''SignatureHelpParams