{-# 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
readListPrec :: ReadPrec [DeclarationClientCapabilities]
$creadListPrec :: ReadPrec [DeclarationClientCapabilities]
readPrec :: ReadPrec DeclarationClientCapabilities
$creadPrec :: ReadPrec DeclarationClientCapabilities
readList :: ReadS [DeclarationClientCapabilities]
$creadList :: ReadS [DeclarationClientCapabilities]
readsPrec :: Int -> ReadS DeclarationClientCapabilities
$creadsPrec :: Int -> ReadS 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
showList :: [DeclarationClientCapabilities] -> ShowS
$cshowList :: [DeclarationClientCapabilities] -> ShowS
show :: DeclarationClientCapabilities -> String
$cshow :: DeclarationClientCapabilities -> String
showsPrec :: Int -> DeclarationClientCapabilities -> ShowS
$cshowsPrec :: Int -> DeclarationClientCapabilities -> ShowS
Show, DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
(DeclarationClientCapabilities
 -> DeclarationClientCapabilities -> Bool)
-> (DeclarationClientCapabilities
    -> DeclarationClientCapabilities -> Bool)
-> Eq DeclarationClientCapabilities
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
$c/= :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
== :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
$c== :: 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