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