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

{- | Since LSP 3.16.0 -}
module Language.LSP.Types.CallHierarchy where

import Data.Aeson.TH
import Data.Aeson.Types ( Value )
import Data.Text ( Text )

import Language.LSP.Types.Common
import Language.LSP.Types.DocumentSymbol
import Language.LSP.Types.Location
import Language.LSP.Types.Progress
import Language.LSP.Types.StaticRegistrationOptions
import Language.LSP.Types.TextDocument
import Language.LSP.Types.Uri
import Language.LSP.Types.Utils


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

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

makeExtendingDatatype "CallHierarchyRegistrationOptions"
  [ ''TextDocumentRegistrationOptions
  , ''CallHierarchyOptions
  , ''StaticRegistrationOptions
  ]
  []
deriveJSON lspOptions ''CallHierarchyRegistrationOptions

makeExtendingDatatype "CallHierarchyPrepareParams"
  [''TextDocumentPositionParams, ''WorkDoneProgressParams] []
deriveJSON lspOptions ''CallHierarchyPrepareParams

data CallHierarchyItem =
  CallHierarchyItem
    { CallHierarchyItem -> Text
_name :: Text
    , CallHierarchyItem -> SymbolKind
_kind :: SymbolKind
    , CallHierarchyItem -> Maybe (List SymbolTag)
_tags :: Maybe (List SymbolTag)
    -- | More detail for this item, e.g. the signature of a function.
    , CallHierarchyItem -> Maybe Text
_detail :: Maybe Text
    , CallHierarchyItem -> Uri
_uri :: Uri
    , CallHierarchyItem -> Range
_range :: Range
    -- | The range that should be selected and revealed when this symbol
    -- is being picked, e.g. the name of a function. Must be contained by
    -- the @_range@.
    , CallHierarchyItem -> Range
_selectionRange :: Range
    -- | A data entry field that is preserved between a call hierarchy
    -- prepare and incoming calls or outgoing calls requests.
    , CallHierarchyItem -> Maybe Value
_xdata :: Maybe Value
    }
    deriving (Int -> CallHierarchyItem -> ShowS
[CallHierarchyItem] -> ShowS
CallHierarchyItem -> String
(Int -> CallHierarchyItem -> ShowS)
-> (CallHierarchyItem -> String)
-> ([CallHierarchyItem] -> ShowS)
-> Show CallHierarchyItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CallHierarchyItem] -> ShowS
$cshowList :: [CallHierarchyItem] -> ShowS
show :: CallHierarchyItem -> String
$cshow :: CallHierarchyItem -> String
showsPrec :: Int -> CallHierarchyItem -> ShowS
$cshowsPrec :: Int -> CallHierarchyItem -> ShowS
Show, ReadPrec [CallHierarchyItem]
ReadPrec CallHierarchyItem
Int -> ReadS CallHierarchyItem
ReadS [CallHierarchyItem]
(Int -> ReadS CallHierarchyItem)
-> ReadS [CallHierarchyItem]
-> ReadPrec CallHierarchyItem
-> ReadPrec [CallHierarchyItem]
-> Read CallHierarchyItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CallHierarchyItem]
$creadListPrec :: ReadPrec [CallHierarchyItem]
readPrec :: ReadPrec CallHierarchyItem
$creadPrec :: ReadPrec CallHierarchyItem
readList :: ReadS [CallHierarchyItem]
$creadList :: ReadS [CallHierarchyItem]
readsPrec :: Int -> ReadS CallHierarchyItem
$creadsPrec :: Int -> ReadS CallHierarchyItem
Read, CallHierarchyItem -> CallHierarchyItem -> Bool
(CallHierarchyItem -> CallHierarchyItem -> Bool)
-> (CallHierarchyItem -> CallHierarchyItem -> Bool)
-> Eq CallHierarchyItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CallHierarchyItem -> CallHierarchyItem -> Bool
$c/= :: CallHierarchyItem -> CallHierarchyItem -> Bool
== :: CallHierarchyItem -> CallHierarchyItem -> Bool
$c== :: CallHierarchyItem -> CallHierarchyItem -> Bool
Eq)
deriveJSON lspOptions ''CallHierarchyItem

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

makeExtendingDatatype "CallHierarchyIncomingCallsParams"
  [ ''WorkDoneProgressParams
  , ''PartialResultParams
  ]
  [("_item", [t| CallHierarchyItem |])]
deriveJSON lspOptions ''CallHierarchyIncomingCallsParams

data CallHierarchyIncomingCall =
  CallHierarchyIncomingCall
    { -- | The item that makes the call.
      CallHierarchyIncomingCall -> CallHierarchyItem
_from :: CallHierarchyItem
    -- | The ranges at which the calls appear. This is relative to the caller
    -- denoted by @_from@.
    , CallHierarchyIncomingCall -> List Range
_fromRanges :: List Range
    }
    deriving (Int -> CallHierarchyIncomingCall -> ShowS
[CallHierarchyIncomingCall] -> ShowS
CallHierarchyIncomingCall -> String
(Int -> CallHierarchyIncomingCall -> ShowS)
-> (CallHierarchyIncomingCall -> String)
-> ([CallHierarchyIncomingCall] -> ShowS)
-> Show CallHierarchyIncomingCall
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CallHierarchyIncomingCall] -> ShowS
$cshowList :: [CallHierarchyIncomingCall] -> ShowS
show :: CallHierarchyIncomingCall -> String
$cshow :: CallHierarchyIncomingCall -> String
showsPrec :: Int -> CallHierarchyIncomingCall -> ShowS
$cshowsPrec :: Int -> CallHierarchyIncomingCall -> ShowS
Show, ReadPrec [CallHierarchyIncomingCall]
ReadPrec CallHierarchyIncomingCall
Int -> ReadS CallHierarchyIncomingCall
ReadS [CallHierarchyIncomingCall]
(Int -> ReadS CallHierarchyIncomingCall)
-> ReadS [CallHierarchyIncomingCall]
-> ReadPrec CallHierarchyIncomingCall
-> ReadPrec [CallHierarchyIncomingCall]
-> Read CallHierarchyIncomingCall
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CallHierarchyIncomingCall]
$creadListPrec :: ReadPrec [CallHierarchyIncomingCall]
readPrec :: ReadPrec CallHierarchyIncomingCall
$creadPrec :: ReadPrec CallHierarchyIncomingCall
readList :: ReadS [CallHierarchyIncomingCall]
$creadList :: ReadS [CallHierarchyIncomingCall]
readsPrec :: Int -> ReadS CallHierarchyIncomingCall
$creadsPrec :: Int -> ReadS CallHierarchyIncomingCall
Read, CallHierarchyIncomingCall -> CallHierarchyIncomingCall -> Bool
(CallHierarchyIncomingCall -> CallHierarchyIncomingCall -> Bool)
-> (CallHierarchyIncomingCall -> CallHierarchyIncomingCall -> Bool)
-> Eq CallHierarchyIncomingCall
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CallHierarchyIncomingCall -> CallHierarchyIncomingCall -> Bool
$c/= :: CallHierarchyIncomingCall -> CallHierarchyIncomingCall -> Bool
== :: CallHierarchyIncomingCall -> CallHierarchyIncomingCall -> Bool
$c== :: CallHierarchyIncomingCall -> CallHierarchyIncomingCall -> Bool
Eq)
deriveJSON lspOptions ''CallHierarchyIncomingCall

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

makeExtendingDatatype "CallHierarchyOutgoingCallsParams"
  [ ''WorkDoneProgressParams
  , ''PartialResultParams
  ]
  [("_item", [t| CallHierarchyItem |])]
deriveJSON lspOptions ''CallHierarchyOutgoingCallsParams

data CallHierarchyOutgoingCall =
  CallHierarchyOutgoingCall
    { -- | The item that is called.
      CallHierarchyOutgoingCall -> CallHierarchyItem
_to :: CallHierarchyItem
    -- | The range at which this item is called. THis is the range relative to
    -- the caller, e.g the item passed to `callHierarchy/outgoingCalls` request.
    , CallHierarchyOutgoingCall -> List Range
_fromRanges :: List Range
    }
    deriving (Int -> CallHierarchyOutgoingCall -> ShowS
[CallHierarchyOutgoingCall] -> ShowS
CallHierarchyOutgoingCall -> String
(Int -> CallHierarchyOutgoingCall -> ShowS)
-> (CallHierarchyOutgoingCall -> String)
-> ([CallHierarchyOutgoingCall] -> ShowS)
-> Show CallHierarchyOutgoingCall
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CallHierarchyOutgoingCall] -> ShowS
$cshowList :: [CallHierarchyOutgoingCall] -> ShowS
show :: CallHierarchyOutgoingCall -> String
$cshow :: CallHierarchyOutgoingCall -> String
showsPrec :: Int -> CallHierarchyOutgoingCall -> ShowS
$cshowsPrec :: Int -> CallHierarchyOutgoingCall -> ShowS
Show, ReadPrec [CallHierarchyOutgoingCall]
ReadPrec CallHierarchyOutgoingCall
Int -> ReadS CallHierarchyOutgoingCall
ReadS [CallHierarchyOutgoingCall]
(Int -> ReadS CallHierarchyOutgoingCall)
-> ReadS [CallHierarchyOutgoingCall]
-> ReadPrec CallHierarchyOutgoingCall
-> ReadPrec [CallHierarchyOutgoingCall]
-> Read CallHierarchyOutgoingCall
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CallHierarchyOutgoingCall]
$creadListPrec :: ReadPrec [CallHierarchyOutgoingCall]
readPrec :: ReadPrec CallHierarchyOutgoingCall
$creadPrec :: ReadPrec CallHierarchyOutgoingCall
readList :: ReadS [CallHierarchyOutgoingCall]
$creadList :: ReadS [CallHierarchyOutgoingCall]
readsPrec :: Int -> ReadS CallHierarchyOutgoingCall
$creadsPrec :: Int -> ReadS CallHierarchyOutgoingCall
Read, CallHierarchyOutgoingCall -> CallHierarchyOutgoingCall -> Bool
(CallHierarchyOutgoingCall -> CallHierarchyOutgoingCall -> Bool)
-> (CallHierarchyOutgoingCall -> CallHierarchyOutgoingCall -> Bool)
-> Eq CallHierarchyOutgoingCall
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CallHierarchyOutgoingCall -> CallHierarchyOutgoingCall -> Bool
$c/= :: CallHierarchyOutgoingCall -> CallHierarchyOutgoingCall -> Bool
== :: CallHierarchyOutgoingCall -> CallHierarchyOutgoingCall -> Bool
$c== :: CallHierarchyOutgoingCall -> CallHierarchyOutgoingCall -> Bool
Eq)
deriveJSON lspOptions ''CallHierarchyOutgoingCall