{- 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.CallHierarchyItem where

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

{-|
Represents programming constructs like functions or constructors in the context
of call hierarchy.

@since 3.16.0
-}
data CallHierarchyItem = CallHierarchyItem 
  { {-|
  The name of this item.
  -}
  CallHierarchyItem -> Text
_name :: Data.Text.Text
  , {-|
  The kind of this item.
  -}
  CallHierarchyItem -> SymbolKind
_kind :: Language.LSP.Protocol.Internal.Types.SymbolKind.SymbolKind
  , {-|
  Tags for this item.
  -}
  CallHierarchyItem -> Maybe [SymbolTag]
_tags :: (Maybe [Language.LSP.Protocol.Internal.Types.SymbolTag.SymbolTag])
  , {-|
  More detail for this item, e.g. the signature of a function.
  -}
  CallHierarchyItem -> Maybe Text
_detail :: (Maybe Data.Text.Text)
  , {-|
  The resource identifier of this item.
  -}
  CallHierarchyItem -> Uri
_uri :: Language.LSP.Protocol.Types.Uri.Uri
  , {-|
  The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code.
  -}
  CallHierarchyItem -> Range
_range :: Language.LSP.Protocol.Internal.Types.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 `CallHierarchyItem.range`.
  -}
  CallHierarchyItem -> Range
_selectionRange :: Language.LSP.Protocol.Internal.Types.Range.Range
  , {-|
  A data entry field that is preserved between a call hierarchy prepare and
  incoming calls or outgoing calls requests.
  -}
  CallHierarchyItem -> Maybe Value
_data_ :: (Maybe Data.Aeson.Value)
  }
  deriving stock (Int -> CallHierarchyItem -> ShowS
[CallHierarchyItem] -> ShowS
CallHierarchyItem -> String
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, CallHierarchyItem -> CallHierarchyItem -> Bool
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, Eq CallHierarchyItem
CallHierarchyItem -> CallHierarchyItem -> Bool
CallHierarchyItem -> CallHierarchyItem -> Ordering
CallHierarchyItem -> CallHierarchyItem -> CallHierarchyItem
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 :: CallHierarchyItem -> CallHierarchyItem -> CallHierarchyItem
$cmin :: CallHierarchyItem -> CallHierarchyItem -> CallHierarchyItem
max :: CallHierarchyItem -> CallHierarchyItem -> CallHierarchyItem
$cmax :: CallHierarchyItem -> CallHierarchyItem -> CallHierarchyItem
>= :: CallHierarchyItem -> CallHierarchyItem -> Bool
$c>= :: CallHierarchyItem -> CallHierarchyItem -> Bool
> :: CallHierarchyItem -> CallHierarchyItem -> Bool
$c> :: CallHierarchyItem -> CallHierarchyItem -> Bool
<= :: CallHierarchyItem -> CallHierarchyItem -> Bool
$c<= :: CallHierarchyItem -> CallHierarchyItem -> Bool
< :: CallHierarchyItem -> CallHierarchyItem -> Bool
$c< :: CallHierarchyItem -> CallHierarchyItem -> Bool
compare :: CallHierarchyItem -> CallHierarchyItem -> Ordering
$ccompare :: CallHierarchyItem -> CallHierarchyItem -> Ordering
Ord, forall x. Rep CallHierarchyItem x -> CallHierarchyItem
forall x. CallHierarchyItem -> Rep CallHierarchyItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CallHierarchyItem x -> CallHierarchyItem
$cfrom :: forall x. CallHierarchyItem -> Rep CallHierarchyItem x
Generic)
  deriving anyclass (CallHierarchyItem -> ()
forall a. (a -> ()) -> NFData a
rnf :: CallHierarchyItem -> ()
$crnf :: CallHierarchyItem -> ()
NFData, Eq CallHierarchyItem
Int -> CallHierarchyItem -> Int
CallHierarchyItem -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: CallHierarchyItem -> Int
$chash :: CallHierarchyItem -> Int
hashWithSalt :: Int -> CallHierarchyItem -> Int
$chashWithSalt :: Int -> CallHierarchyItem -> Int
Hashable)
  deriving forall ann. [CallHierarchyItem] -> Doc ann
forall ann. CallHierarchyItem -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [CallHierarchyItem] -> Doc ann
$cprettyList :: forall ann. [CallHierarchyItem] -> Doc ann
pretty :: forall ann. CallHierarchyItem -> Doc ann
$cpretty :: forall ann. CallHierarchyItem -> Doc ann
Pretty via (ViaJSON CallHierarchyItem)

instance Aeson.ToJSON CallHierarchyItem where
  toJSON :: CallHierarchyItem -> Value
toJSON (CallHierarchyItem Text
arg0 SymbolKind
arg1 Maybe [SymbolTag]
arg2 Maybe Text
arg3 Uri
arg4 Range
arg5 Range
arg6 Maybe Value
arg7) = [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
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Text
arg0]
    ,[Key
"kind" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= SymbolKind
arg1]
    ,String
"tags" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe [SymbolTag]
arg2
    ,String
"detail" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg3
    ,[Key
"uri" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Uri
arg4]
    ,[Key
"range" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Range
arg5]
    ,[Key
"selectionRange" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Range
arg6]
    ,String
"data" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Value
arg7]

instance Aeson.FromJSON CallHierarchyItem where
  parseJSON :: Value -> Parser CallHierarchyItem
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"CallHierarchyItem" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Text
-> SymbolKind
-> Maybe [SymbolTag]
-> Maybe Text
-> Uri
-> Range
-> Range
-> Maybe Value
-> CallHierarchyItem
CallHierarchyItem forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"name" 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
"kind" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"tags" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"detail" 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
"uri" 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
"range" 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
"selectionRange" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"data"