{- 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.TypeHierarchyItem 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

{-|
@since 3.17.0
-}
data TypeHierarchyItem = TypeHierarchyItem 
  { {-|
  The name of this item.
  -}
  TypeHierarchyItem -> Text
_name :: Data.Text.Text
  , {-|
  The kind of this item.
  -}
  TypeHierarchyItem -> SymbolKind
_kind :: Language.LSP.Protocol.Internal.Types.SymbolKind.SymbolKind
  , {-|
  Tags for this item.
  -}
  TypeHierarchyItem -> Maybe [SymbolTag]
_tags :: (Maybe [Language.LSP.Protocol.Internal.Types.SymbolTag.SymbolTag])
  , {-|
  More detail for this item, e.g. the signature of a function.
  -}
  TypeHierarchyItem -> Maybe Text
_detail :: (Maybe Data.Text.Text)
  , {-|
  The resource identifier of this item.
  -}
  TypeHierarchyItem -> 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.
  -}
  TypeHierarchyItem -> 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
  `TypeHierarchyItem.range`.
  -}
  TypeHierarchyItem -> Range
_selectionRange :: Language.LSP.Protocol.Internal.Types.Range.Range
  , {-|
  A data entry field that is preserved between a type hierarchy prepare and
  supertypes or subtypes requests. It could also be used to identify the
  type hierarchy in the server, helping improve the performance on
  resolving supertypes and subtypes.
  -}
  TypeHierarchyItem -> Maybe Value
_data_ :: (Maybe Data.Aeson.Value)
  }
  deriving stock (Int -> TypeHierarchyItem -> ShowS
[TypeHierarchyItem] -> ShowS
TypeHierarchyItem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TypeHierarchyItem] -> ShowS
$cshowList :: [TypeHierarchyItem] -> ShowS
show :: TypeHierarchyItem -> String
$cshow :: TypeHierarchyItem -> String
showsPrec :: Int -> TypeHierarchyItem -> ShowS
$cshowsPrec :: Int -> TypeHierarchyItem -> ShowS
Show, TypeHierarchyItem -> TypeHierarchyItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TypeHierarchyItem -> TypeHierarchyItem -> Bool
$c/= :: TypeHierarchyItem -> TypeHierarchyItem -> Bool
== :: TypeHierarchyItem -> TypeHierarchyItem -> Bool
$c== :: TypeHierarchyItem -> TypeHierarchyItem -> Bool
Eq, Eq TypeHierarchyItem
TypeHierarchyItem -> TypeHierarchyItem -> Bool
TypeHierarchyItem -> TypeHierarchyItem -> Ordering
TypeHierarchyItem -> TypeHierarchyItem -> TypeHierarchyItem
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 :: TypeHierarchyItem -> TypeHierarchyItem -> TypeHierarchyItem
$cmin :: TypeHierarchyItem -> TypeHierarchyItem -> TypeHierarchyItem
max :: TypeHierarchyItem -> TypeHierarchyItem -> TypeHierarchyItem
$cmax :: TypeHierarchyItem -> TypeHierarchyItem -> TypeHierarchyItem
>= :: TypeHierarchyItem -> TypeHierarchyItem -> Bool
$c>= :: TypeHierarchyItem -> TypeHierarchyItem -> Bool
> :: TypeHierarchyItem -> TypeHierarchyItem -> Bool
$c> :: TypeHierarchyItem -> TypeHierarchyItem -> Bool
<= :: TypeHierarchyItem -> TypeHierarchyItem -> Bool
$c<= :: TypeHierarchyItem -> TypeHierarchyItem -> Bool
< :: TypeHierarchyItem -> TypeHierarchyItem -> Bool
$c< :: TypeHierarchyItem -> TypeHierarchyItem -> Bool
compare :: TypeHierarchyItem -> TypeHierarchyItem -> Ordering
$ccompare :: TypeHierarchyItem -> TypeHierarchyItem -> Ordering
Ord, forall x. Rep TypeHierarchyItem x -> TypeHierarchyItem
forall x. TypeHierarchyItem -> Rep TypeHierarchyItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TypeHierarchyItem x -> TypeHierarchyItem
$cfrom :: forall x. TypeHierarchyItem -> Rep TypeHierarchyItem x
Generic)
  deriving anyclass (TypeHierarchyItem -> ()
forall a. (a -> ()) -> NFData a
rnf :: TypeHierarchyItem -> ()
$crnf :: TypeHierarchyItem -> ()
NFData, Eq TypeHierarchyItem
Int -> TypeHierarchyItem -> Int
TypeHierarchyItem -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: TypeHierarchyItem -> Int
$chash :: TypeHierarchyItem -> Int
hashWithSalt :: Int -> TypeHierarchyItem -> Int
$chashWithSalt :: Int -> TypeHierarchyItem -> Int
Hashable)
  deriving forall ann. [TypeHierarchyItem] -> Doc ann
forall ann. TypeHierarchyItem -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [TypeHierarchyItem] -> Doc ann
$cprettyList :: forall ann. [TypeHierarchyItem] -> Doc ann
pretty :: forall ann. TypeHierarchyItem -> Doc ann
$cpretty :: forall ann. TypeHierarchyItem -> Doc ann
Pretty via (ViaJSON TypeHierarchyItem)

instance Aeson.ToJSON TypeHierarchyItem where
  toJSON :: TypeHierarchyItem -> Value
toJSON (TypeHierarchyItem 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 TypeHierarchyItem where
  parseJSON :: Value -> Parser TypeHierarchyItem
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"TypeHierarchyItem" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Text
-> SymbolKind
-> Maybe [SymbolTag]
-> Maybe Text
-> Uri
-> Range
-> Range
-> Maybe Value
-> TypeHierarchyItem
TypeHierarchyItem 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"