{- 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
(Int -> BaseSymbolInformation -> ShowS)
-> (BaseSymbolInformation -> String)
-> ([BaseSymbolInformation] -> ShowS)
-> Show BaseSymbolInformation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BaseSymbolInformation -> ShowS
showsPrec :: Int -> BaseSymbolInformation -> ShowS
$cshow :: BaseSymbolInformation -> String
show :: BaseSymbolInformation -> String
$cshowList :: [BaseSymbolInformation] -> ShowS
showList :: [BaseSymbolInformation] -> ShowS
Show, BaseSymbolInformation -> BaseSymbolInformation -> Bool
(BaseSymbolInformation -> BaseSymbolInformation -> Bool)
-> (BaseSymbolInformation -> BaseSymbolInformation -> Bool)
-> Eq BaseSymbolInformation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BaseSymbolInformation -> BaseSymbolInformation -> Bool
== :: BaseSymbolInformation -> BaseSymbolInformation -> Bool
$c/= :: BaseSymbolInformation -> BaseSymbolInformation -> Bool
/= :: BaseSymbolInformation -> BaseSymbolInformation -> Bool
Eq, Eq BaseSymbolInformation
Eq BaseSymbolInformation =>
(BaseSymbolInformation -> BaseSymbolInformation -> Ordering)
-> (BaseSymbolInformation -> BaseSymbolInformation -> Bool)
-> (BaseSymbolInformation -> BaseSymbolInformation -> Bool)
-> (BaseSymbolInformation -> BaseSymbolInformation -> Bool)
-> (BaseSymbolInformation -> BaseSymbolInformation -> Bool)
-> (BaseSymbolInformation
    -> BaseSymbolInformation -> BaseSymbolInformation)
-> (BaseSymbolInformation
    -> BaseSymbolInformation -> BaseSymbolInformation)
-> Ord 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
$ccompare :: BaseSymbolInformation -> BaseSymbolInformation -> Ordering
compare :: BaseSymbolInformation -> BaseSymbolInformation -> Ordering
$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
>= :: BaseSymbolInformation -> BaseSymbolInformation -> Bool
$cmax :: BaseSymbolInformation
-> BaseSymbolInformation -> BaseSymbolInformation
max :: BaseSymbolInformation
-> BaseSymbolInformation -> BaseSymbolInformation
$cmin :: BaseSymbolInformation
-> BaseSymbolInformation -> BaseSymbolInformation
min :: BaseSymbolInformation
-> BaseSymbolInformation -> BaseSymbolInformation
Ord, (forall x. BaseSymbolInformation -> Rep BaseSymbolInformation x)
-> (forall x. Rep BaseSymbolInformation x -> BaseSymbolInformation)
-> Generic BaseSymbolInformation
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
$cfrom :: forall x. BaseSymbolInformation -> Rep BaseSymbolInformation x
from :: forall x. BaseSymbolInformation -> Rep BaseSymbolInformation x
$cto :: forall x. Rep BaseSymbolInformation x -> BaseSymbolInformation
to :: forall x. Rep BaseSymbolInformation x -> BaseSymbolInformation
Generic)
  deriving anyclass (BaseSymbolInformation -> ()
(BaseSymbolInformation -> ()) -> NFData BaseSymbolInformation
forall a. (a -> ()) -> NFData a
$crnf :: BaseSymbolInformation -> ()
rnf :: BaseSymbolInformation -> ()
NFData, Eq BaseSymbolInformation
Eq BaseSymbolInformation =>
(Int -> BaseSymbolInformation -> Int)
-> (BaseSymbolInformation -> Int) -> Hashable BaseSymbolInformation
Int -> BaseSymbolInformation -> Int
BaseSymbolInformation -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> BaseSymbolInformation -> Int
hashWithSalt :: Int -> BaseSymbolInformation -> Int
$chash :: BaseSymbolInformation -> Int
hash :: BaseSymbolInformation -> Int
Hashable)
  deriving (forall ann. BaseSymbolInformation -> Doc ann)
-> (forall ann. [BaseSymbolInformation] -> Doc ann)
-> Pretty BaseSymbolInformation
forall ann. [BaseSymbolInformation] -> Doc ann
forall ann. BaseSymbolInformation -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. BaseSymbolInformation -> Doc ann
pretty :: forall ann. BaseSymbolInformation -> Doc ann
$cprettyList :: forall ann. [BaseSymbolInformation] -> Doc ann
prettyList :: 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 ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$ [[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[Pair]] -> [Pair]) -> [[Pair]] -> [Pair]
forall a b. (a -> b) -> a -> b
$  [[Key
"name" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= Text
arg0]
    ,[Key
"kind" Key -> SymbolKind -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= SymbolKind
arg1]
    ,String
"tags" String -> Maybe [SymbolTag] -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe [SymbolTag]
arg2
    ,String
"containerName" String -> Maybe Text -> [Pair]
forall e kv v.
(KeyValue e 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 = String
-> (Object -> Parser BaseSymbolInformation)
-> Value
-> Parser BaseSymbolInformation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"BaseSymbolInformation" ((Object -> Parser BaseSymbolInformation)
 -> Value -> Parser BaseSymbolInformation)
-> (Object -> Parser BaseSymbolInformation)
-> Value
-> Parser BaseSymbolInformation
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Text
-> SymbolKind
-> Maybe [SymbolTag]
-> Maybe Text
-> BaseSymbolInformation
BaseSymbolInformation (Text
 -> SymbolKind
 -> Maybe [SymbolTag]
 -> Maybe Text
 -> BaseSymbolInformation)
-> Parser Text
-> Parser
     (SymbolKind
      -> Maybe [SymbolTag] -> Maybe Text -> BaseSymbolInformation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"name" Parser
  (SymbolKind
   -> Maybe [SymbolTag] -> Maybe Text -> BaseSymbolInformation)
-> Parser SymbolKind
-> Parser
     (Maybe [SymbolTag] -> Maybe Text -> BaseSymbolInformation)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser SymbolKind
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"kind" Parser (Maybe [SymbolTag] -> Maybe Text -> BaseSymbolInformation)
-> Parser (Maybe [SymbolTag])
-> Parser (Maybe Text -> BaseSymbolInformation)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe [SymbolTag])
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"tags" Parser (Maybe Text -> BaseSymbolInformation)
-> Parser (Maybe Text) -> Parser BaseSymbolInformation
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe Text)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"containerName"