{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE TemplateHaskell #-}

module Language.LSP.Types.Implementation where

import Data.Aeson.TH
import Language.LSP.Types.Progress
import Language.LSP.Types.StaticRegistrationOptions
import Language.LSP.Types.TextDocument
import Language.LSP.Types.Utils

data ImplementationClientCapabilities = ImplementationClientCapabilities
  { -- | Whether implementation supports dynamic registration. If this is set
    -- to 'True'
    -- the client supports the new 'ImplementationRegistrationOptions' return
    -- value for the corresponding server capability as well.
    ImplementationClientCapabilities -> Maybe Bool
_dynamicRegistration :: Maybe Bool,
    -- | The client supports additional metadata in the form of definition links.
    --
    -- Since LSP 3.14.0
    ImplementationClientCapabilities -> Maybe Bool
_linkSupport :: Maybe Bool
  }
  deriving (ReadPrec [ImplementationClientCapabilities]
ReadPrec ImplementationClientCapabilities
Int -> ReadS ImplementationClientCapabilities
ReadS [ImplementationClientCapabilities]
(Int -> ReadS ImplementationClientCapabilities)
-> ReadS [ImplementationClientCapabilities]
-> ReadPrec ImplementationClientCapabilities
-> ReadPrec [ImplementationClientCapabilities]
-> Read ImplementationClientCapabilities
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS ImplementationClientCapabilities
readsPrec :: Int -> ReadS ImplementationClientCapabilities
$creadList :: ReadS [ImplementationClientCapabilities]
readList :: ReadS [ImplementationClientCapabilities]
$creadPrec :: ReadPrec ImplementationClientCapabilities
readPrec :: ReadPrec ImplementationClientCapabilities
$creadListPrec :: ReadPrec [ImplementationClientCapabilities]
readListPrec :: ReadPrec [ImplementationClientCapabilities]
Read, Int -> ImplementationClientCapabilities -> ShowS
[ImplementationClientCapabilities] -> ShowS
ImplementationClientCapabilities -> String
(Int -> ImplementationClientCapabilities -> ShowS)
-> (ImplementationClientCapabilities -> String)
-> ([ImplementationClientCapabilities] -> ShowS)
-> Show ImplementationClientCapabilities
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ImplementationClientCapabilities -> ShowS
showsPrec :: Int -> ImplementationClientCapabilities -> ShowS
$cshow :: ImplementationClientCapabilities -> String
show :: ImplementationClientCapabilities -> String
$cshowList :: [ImplementationClientCapabilities] -> ShowS
showList :: [ImplementationClientCapabilities] -> ShowS
Show, ImplementationClientCapabilities
-> ImplementationClientCapabilities -> Bool
(ImplementationClientCapabilities
 -> ImplementationClientCapabilities -> Bool)
-> (ImplementationClientCapabilities
    -> ImplementationClientCapabilities -> Bool)
-> Eq ImplementationClientCapabilities
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ImplementationClientCapabilities
-> ImplementationClientCapabilities -> Bool
== :: ImplementationClientCapabilities
-> ImplementationClientCapabilities -> Bool
$c/= :: ImplementationClientCapabilities
-> ImplementationClientCapabilities -> Bool
/= :: ImplementationClientCapabilities
-> ImplementationClientCapabilities -> Bool
Eq)

deriveJSON lspOptions ''ImplementationClientCapabilities

makeExtendingDatatype "ImplementationOptions" [''WorkDoneProgressOptions] []
deriveJSON lspOptions ''ImplementationOptions

makeExtendingDatatype "ImplementationRegistrationOptions"
  [ ''TextDocumentRegistrationOptions
  , ''ImplementationOptions
  , ''StaticRegistrationOptions
  ] []
deriveJSON lspOptions ''ImplementationRegistrationOptions

makeExtendingDatatype "ImplementationParams"
  [ ''TextDocumentPositionParams
  , ''WorkDoneProgressParams
  , ''PartialResultParams
  ] []
deriveJSON lspOptions ''ImplementationParams