{- 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.BaseSymbolInformation 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 Data.Text
import qualified Language.LSP.Protocol.Internal.Types.SymbolKind
import qualified Language.LSP.Protocol.Internal.Types.SymbolTag
import qualified Language.LSP.Protocol.Types.Common

{-|
A base for all symbol information.
-}
data BaseSymbolInformation = BaseSymbolInformation 
  { {-|
  The name of this symbol.
  -}
  BaseSymbolInformation -> Text
_name :: Data.Text.Text
  , {-|
  The kind of this symbol.
  -}
  BaseSymbolInformation -> SymbolKind
_kind :: Language.LSP.Protocol.Internal.Types.SymbolKind.SymbolKind
  , {-|
  Tags for this symbol.

  @since 3.16.0
  -}
  BaseSymbolInformation -> Maybe [SymbolTag]
_tags :: (Maybe [Language.LSP.Protocol.Internal.Types.SymbolTag.SymbolTag])
  , {-|
  The name of the symbol containing this symbol. This information is for
  user interface purposes (e.g. to render a qualifier in the user interface
  if necessary). It can't be used to re-infer a hierarchy for the document
  symbols.
  -}
  BaseSymbolInformation -> Maybe Text
_containerName :: (Maybe Data.Text.Text)
  }
  deriving stock (Int -> BaseSymbolInformation -> ShowS
[BaseSymbolInformation] -> ShowS
BaseSymbolInformation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BaseSymbolInformation] -> ShowS
$cshowList :: [BaseSymbolInformation] -> ShowS
show :: BaseSymbolInformation -> String
$cshow :: BaseSymbolInformation -> String
showsPrec :: Int -> BaseSymbolInformation -> ShowS
$cshowsPrec :: Int -> BaseSymbolInformation -> ShowS
Show, BaseSymbolInformation -> BaseSymbolInformation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BaseSymbolInformation -> BaseSymbolInformation -> Bool
$c/= :: BaseSymbolInformation -> BaseSymbolInformation -> Bool
== :: BaseSymbolInformation -> BaseSymbolInformation -> Bool
$c== :: BaseSymbolInformation -> BaseSymbolInformation -> Bool
Eq, Eq BaseSymbolInformation
BaseSymbolInformation -> BaseSymbolInformation -> Bool
BaseSymbolInformation -> BaseSymbolInformation -> Ordering
BaseSymbolInformation
-> BaseSymbolInformation -> BaseSymbolInformation
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 :: BaseSymbolInformation
-> BaseSymbolInformation -> BaseSymbolInformation
$cmin :: BaseSymbolInformation
-> BaseSymbolInformation -> BaseSymbolInformation
max :: BaseSymbolInformation
-> BaseSymbolInformation -> BaseSymbolInformation
$cmax :: BaseSymbolInformation
-> BaseSymbolInformation -> BaseSymbolInformation
>= :: BaseSymbolInformation -> BaseSymbolInformation -> Bool
$c>= :: BaseSymbolInformation -> BaseSymbolInformation -> Bool
> :: BaseSymbolInformation -> BaseSymbolInformation -> Bool
$c> :: BaseSymbolInformation -> BaseSymbolInformation -> Bool
<= :: BaseSymbolInformation -> BaseSymbolInformation -> Bool
$c<= :: BaseSymbolInformation -> BaseSymbolInformation -> Bool
< :: BaseSymbolInformation -> BaseSymbolInformation -> Bool
$c< :: BaseSymbolInformation -> BaseSymbolInformation -> Bool
compare :: BaseSymbolInformation -> BaseSymbolInformation -> Ordering
$ccompare :: BaseSymbolInformation -> BaseSymbolInformation -> Ordering
Ord, forall x. Rep BaseSymbolInformation x -> BaseSymbolInformation
forall x. BaseSymbolInformation -> Rep BaseSymbolInformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BaseSymbolInformation x -> BaseSymbolInformation
$cfrom :: forall x. BaseSymbolInformation -> Rep BaseSymbolInformation x
Generic)
  deriving anyclass (BaseSymbolInformation -> ()
forall a. (a -> ()) -> NFData a
rnf :: BaseSymbolInformation -> ()
$crnf :: BaseSymbolInformation -> ()
NFData, Eq BaseSymbolInformation
Int -> BaseSymbolInformation -> Int
BaseSymbolInformation -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: BaseSymbolInformation -> Int
$chash :: BaseSymbolInformation -> Int
hashWithSalt :: Int -> BaseSymbolInformation -> Int
$chashWithSalt :: Int -> BaseSymbolInformation -> Int
Hashable)
  deriving forall ann. [BaseSymbolInformation] -> Doc ann
forall ann. BaseSymbolInformation -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [BaseSymbolInformation] -> Doc ann
$cprettyList :: forall ann. [BaseSymbolInformation] -> Doc ann
pretty :: forall ann. BaseSymbolInformation -> Doc ann
$cpretty :: forall ann. BaseSymbolInformation -> Doc ann
Pretty via (ViaJSON BaseSymbolInformation)

instance Aeson.ToJSON BaseSymbolInformation where
  toJSON :: BaseSymbolInformation -> Value
toJSON (BaseSymbolInformation Text
arg0 SymbolKind
arg1 Maybe [SymbolTag]
arg2 Maybe Text
arg3) = [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
"containerName" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg3]

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