{- ORMOLU_DISABLE -}
{- HLINT ignore -}
-- THIS IS A GENERATED FILE, DO NOT EDIT

{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-unused-matches #-}
{-# OPTIONS_GHC -Wno-deprecations #-}
module Language.LSP.Protocol.Internal.Types.CallHierarchyIncomingCall where

import Control.DeepSeq
import Data.Hashable
import GHC.Generics
import Language.LSP.Protocol.Utils.Misc
import Prettyprinter
import qualified Data.Aeson as Aeson
import qualified Data.Row.Aeson as Aeson
import qualified Data.Row.Hashable as Hashable
import qualified Language.LSP.Protocol.Internal.Types.CallHierarchyItem
import qualified Language.LSP.Protocol.Internal.Types.Range
import qualified Language.LSP.Protocol.Types.Common

{-|
Represents an incoming call, e.g. a caller of a method or constructor.

@since 3.16.0
-}
data CallHierarchyIncomingCall = CallHierarchyIncomingCall 
  { {-|
  The item that makes the call.
  -}
  CallHierarchyIncomingCall -> CallHierarchyItem
_from :: Language.LSP.Protocol.Internal.Types.CallHierarchyItem.CallHierarchyItem
  , {-|
  The ranges at which the calls appear. This is relative to the caller
  denoted by `CallHierarchyIncomingCall.from`.
  -}
  CallHierarchyIncomingCall -> [Range]
_fromRanges :: [Language.LSP.Protocol.Internal.Types.Range.Range]
  }
  deriving stock (Int -> CallHierarchyIncomingCall -> ShowS
[CallHierarchyIncomingCall] -> ShowS
CallHierarchyIncomingCall -> String
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, CallHierarchyIncomingCall -> CallHierarchyIncomingCall -> Bool
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, Eq CallHierarchyIncomingCall
CallHierarchyIncomingCall -> CallHierarchyIncomingCall -> Bool
CallHierarchyIncomingCall -> CallHierarchyIncomingCall -> Ordering
CallHierarchyIncomingCall
-> CallHierarchyIncomingCall -> CallHierarchyIncomingCall
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: CallHierarchyIncomingCall
-> CallHierarchyIncomingCall -> CallHierarchyIncomingCall
$cmin :: CallHierarchyIncomingCall
-> CallHierarchyIncomingCall -> CallHierarchyIncomingCall
max :: CallHierarchyIncomingCall
-> CallHierarchyIncomingCall -> CallHierarchyIncomingCall
$cmax :: CallHierarchyIncomingCall
-> CallHierarchyIncomingCall -> CallHierarchyIncomingCall
>= :: CallHierarchyIncomingCall -> CallHierarchyIncomingCall -> Bool
$c>= :: CallHierarchyIncomingCall -> CallHierarchyIncomingCall -> Bool
> :: CallHierarchyIncomingCall -> CallHierarchyIncomingCall -> Bool
$c> :: CallHierarchyIncomingCall -> CallHierarchyIncomingCall -> Bool
<= :: CallHierarchyIncomingCall -> CallHierarchyIncomingCall -> Bool
$c<= :: CallHierarchyIncomingCall -> CallHierarchyIncomingCall -> Bool
< :: CallHierarchyIncomingCall -> CallHierarchyIncomingCall -> Bool
$c< :: CallHierarchyIncomingCall -> CallHierarchyIncomingCall -> Bool
compare :: CallHierarchyIncomingCall -> CallHierarchyIncomingCall -> Ordering
$ccompare :: CallHierarchyIncomingCall -> CallHierarchyIncomingCall -> Ordering
Ord, forall x.
Rep CallHierarchyIncomingCall x -> CallHierarchyIncomingCall
forall x.
CallHierarchyIncomingCall -> Rep CallHierarchyIncomingCall x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CallHierarchyIncomingCall x -> CallHierarchyIncomingCall
$cfrom :: forall x.
CallHierarchyIncomingCall -> Rep CallHierarchyIncomingCall x
Generic)
  deriving anyclass (CallHierarchyIncomingCall -> ()
forall a. (a -> ()) -> NFData a
rnf :: CallHierarchyIncomingCall -> ()
$crnf :: CallHierarchyIncomingCall -> ()
NFData, Eq CallHierarchyIncomingCall
Int -> CallHierarchyIncomingCall -> Int
CallHierarchyIncomingCall -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: CallHierarchyIncomingCall -> Int
$chash :: CallHierarchyIncomingCall -> Int
hashWithSalt :: Int -> CallHierarchyIncomingCall -> Int
$chashWithSalt :: Int -> CallHierarchyIncomingCall -> Int
Hashable)
  deriving forall ann. [CallHierarchyIncomingCall] -> Doc ann
forall ann. CallHierarchyIncomingCall -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [CallHierarchyIncomingCall] -> Doc ann
$cprettyList :: forall ann. [CallHierarchyIncomingCall] -> Doc ann
pretty :: forall ann. CallHierarchyIncomingCall -> Doc ann
$cpretty :: forall ann. CallHierarchyIncomingCall -> Doc ann
Pretty via (ViaJSON CallHierarchyIncomingCall)

instance Aeson.ToJSON CallHierarchyIncomingCall where
  toJSON :: CallHierarchyIncomingCall -> Value
toJSON (CallHierarchyIncomingCall CallHierarchyItem
arg0 [Range]
arg1) = [Pair] -> Value
Aeson.object forall a b. (a -> b) -> a -> b
$ forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall a b. (a -> b) -> a -> b
$  [[Key
"from" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= CallHierarchyItem
arg0]
    ,[Key
"fromRanges" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= [Range]
arg1]]

instance Aeson.FromJSON CallHierarchyIncomingCall where
  parseJSON :: Value -> Parser CallHierarchyIncomingCall
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"CallHierarchyIncomingCall" forall a b. (a -> b) -> a -> b
$ \Object
arg -> CallHierarchyItem -> [Range] -> CallHierarchyIncomingCall
CallHierarchyIncomingCall forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"from" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"fromRanges"