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

module Language.LSP.Types.Declaration 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 DeclarationClientCapabilities =
  DeclarationClientCapabilities
  { -- | Whether declaration supports dynamic registration. If this is set to 'true'
    -- the client supports the new 'DeclarationRegistrationOptions' return value
    -- for the corresponding server capability as well.
    DeclarationClientCapabilities -> Maybe Bool
_dynamicRegistration :: Maybe Bool
    -- | The client supports additional metadata in the form of declaration links.
  , DeclarationClientCapabilities -> Maybe Bool
_linkSupport :: Maybe Bool
  }
  deriving (ReadPrec [DeclarationClientCapabilities]
ReadPrec DeclarationClientCapabilities
Int -> ReadS DeclarationClientCapabilities
ReadS [DeclarationClientCapabilities]
(Int -> ReadS DeclarationClientCapabilities)
-> ReadS [DeclarationClientCapabilities]
-> ReadPrec DeclarationClientCapabilities
-> ReadPrec [DeclarationClientCapabilities]
-> Read DeclarationClientCapabilities
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS DeclarationClientCapabilities
readsPrec :: Int -> ReadS DeclarationClientCapabilities
$creadList :: ReadS [DeclarationClientCapabilities]
readList :: ReadS [DeclarationClientCapabilities]
$creadPrec :: ReadPrec DeclarationClientCapabilities
readPrec :: ReadPrec DeclarationClientCapabilities
$creadListPrec :: ReadPrec [DeclarationClientCapabilities]
readListPrec :: ReadPrec [DeclarationClientCapabilities]
Read, Int -> DeclarationClientCapabilities -> ShowS
[DeclarationClientCapabilities] -> ShowS
DeclarationClientCapabilities -> String
(Int -> DeclarationClientCapabilities -> ShowS)
-> (DeclarationClientCapabilities -> String)
-> ([DeclarationClientCapabilities] -> ShowS)
-> Show DeclarationClientCapabilities
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DeclarationClientCapabilities -> ShowS
showsPrec :: Int -> DeclarationClientCapabilities -> ShowS
$cshow :: DeclarationClientCapabilities -> String
show :: DeclarationClientCapabilities -> String
$cshowList :: [DeclarationClientCapabilities] -> ShowS
showList :: [DeclarationClientCapabilities] -> ShowS
Show, DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
(DeclarationClientCapabilities
 -> DeclarationClientCapabilities -> Bool)
-> (DeclarationClientCapabilities
    -> DeclarationClientCapabilities -> Bool)
-> Eq DeclarationClientCapabilities
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
== :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
$c/= :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
/= :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
Eq)
deriveJSON lspOptions ''DeclarationClientCapabilities

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

makeExtendingDatatype "DeclarationRegistrationOptions"
  [ ''DeclarationOptions
  , ''TextDocumentRegistrationOptions
  , ''StaticRegistrationOptions
  ] []
deriveJSON lspOptions ''DeclarationRegistrationOptions

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