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

{-|
Represents information about programming constructs like variables, classes,
interfaces etc.
-}
data SymbolInformation = SymbolInformation 
  { {-|
  The name of this symbol.
  -}
  SymbolInformation -> Text
_name :: Data.Text.Text
  , {-|
  The kind of this symbol.
  -}
  SymbolInformation -> SymbolKind
_kind :: Language.LSP.Protocol.Internal.Types.SymbolKind.SymbolKind
  , {-|
  Tags for this symbol.

  @since 3.16.0
  -}
  SymbolInformation -> 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.
  -}
  SymbolInformation -> Maybe Text
_containerName :: (Maybe Data.Text.Text)
  , {-|
  Indicates if this symbol is deprecated.

  @deprecated Use tags instead
  -}
  SymbolInformation -> Maybe Bool
_deprecated :: (Maybe Bool)
  , {-|
  The location of this symbol. The location's range is used by a tool
  to reveal the location in the editor. If the symbol is selected in the
  tool the range's start information is used to position the cursor. So
  the range usually spans more than the actual symbol's name and does
  normally include things like visibility modifiers.

  The range doesn't have to denote a node range in the sense of an abstract
  syntax tree. It can therefore not be used to re-construct a hierarchy of
  the symbols.
  -}
  SymbolInformation -> Location
_location :: Language.LSP.Protocol.Internal.Types.Location.Location
  }
  deriving stock (Int -> SymbolInformation -> ShowS
[SymbolInformation] -> ShowS
SymbolInformation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SymbolInformation] -> ShowS
$cshowList :: [SymbolInformation] -> ShowS
show :: SymbolInformation -> String
$cshow :: SymbolInformation -> String
showsPrec :: Int -> SymbolInformation -> ShowS
$cshowsPrec :: Int -> SymbolInformation -> ShowS
Show, SymbolInformation -> SymbolInformation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SymbolInformation -> SymbolInformation -> Bool
$c/= :: SymbolInformation -> SymbolInformation -> Bool
== :: SymbolInformation -> SymbolInformation -> Bool
$c== :: SymbolInformation -> SymbolInformation -> Bool
Eq, Eq SymbolInformation
SymbolInformation -> SymbolInformation -> Bool
SymbolInformation -> SymbolInformation -> Ordering
SymbolInformation -> SymbolInformation -> SymbolInformation
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 :: SymbolInformation -> SymbolInformation -> SymbolInformation
$cmin :: SymbolInformation -> SymbolInformation -> SymbolInformation
max :: SymbolInformation -> SymbolInformation -> SymbolInformation
$cmax :: SymbolInformation -> SymbolInformation -> SymbolInformation
>= :: SymbolInformation -> SymbolInformation -> Bool
$c>= :: SymbolInformation -> SymbolInformation -> Bool
> :: SymbolInformation -> SymbolInformation -> Bool
$c> :: SymbolInformation -> SymbolInformation -> Bool
<= :: SymbolInformation -> SymbolInformation -> Bool
$c<= :: SymbolInformation -> SymbolInformation -> Bool
< :: SymbolInformation -> SymbolInformation -> Bool
$c< :: SymbolInformation -> SymbolInformation -> Bool
compare :: SymbolInformation -> SymbolInformation -> Ordering
$ccompare :: SymbolInformation -> SymbolInformation -> Ordering
Ord, forall x. Rep SymbolInformation x -> SymbolInformation
forall x. SymbolInformation -> Rep SymbolInformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SymbolInformation x -> SymbolInformation
$cfrom :: forall x. SymbolInformation -> Rep SymbolInformation x
Generic)
  deriving anyclass (SymbolInformation -> ()
forall a. (a -> ()) -> NFData a
rnf :: SymbolInformation -> ()
$crnf :: SymbolInformation -> ()
NFData, Eq SymbolInformation
Int -> SymbolInformation -> Int
SymbolInformation -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: SymbolInformation -> Int
$chash :: SymbolInformation -> Int
hashWithSalt :: Int -> SymbolInformation -> Int
$chashWithSalt :: Int -> SymbolInformation -> Int
Hashable)
  deriving forall ann. [SymbolInformation] -> Doc ann
forall ann. SymbolInformation -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [SymbolInformation] -> Doc ann
$cprettyList :: forall ann. [SymbolInformation] -> Doc ann
pretty :: forall ann. SymbolInformation -> Doc ann
$cpretty :: forall ann. SymbolInformation -> Doc ann
Pretty via (ViaJSON SymbolInformation)

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

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