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

{-|
Represents programming constructs like variables, classes, interfaces etc.
that appear in a document. Document symbols can be hierarchical and they
have two ranges: one that encloses its definition and one that points to
its most interesting range, e.g. the range of an identifier.
-}
data DocumentSymbol = DocumentSymbol 
  { {-|
  The name of this symbol. Will be displayed in the user interface and therefore must not be
  an empty string or a string only consisting of white spaces.
  -}
  DocumentSymbol -> Text
_name :: Data.Text.Text
  , {-|
  More detail for this symbol, e.g the signature of a function.
  -}
  DocumentSymbol -> Maybe Text
_detail :: (Maybe Data.Text.Text)
  , {-|
  The kind of this symbol.
  -}
  DocumentSymbol -> SymbolKind
_kind :: Language.LSP.Protocol.Internal.Types.SymbolKind.SymbolKind
  , {-|
  Tags for this document symbol.

  @since 3.16.0
  -}
  DocumentSymbol -> Maybe [SymbolTag]
_tags :: (Maybe [Language.LSP.Protocol.Internal.Types.SymbolTag.SymbolTag])
  , {-|
  Indicates if this symbol is deprecated.

  @deprecated Use tags instead
  -}
  DocumentSymbol -> Maybe Bool
_deprecated :: (Maybe Bool)
  , {-|
  The range enclosing this symbol not including leading/trailing whitespace but everything else
  like comments. This information is typically used to determine if the clients cursor is
  inside the symbol to reveal in the symbol in the UI.
  -}
  DocumentSymbol -> 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 `range`.
  -}
  DocumentSymbol -> Range
_selectionRange :: Language.LSP.Protocol.Internal.Types.Range.Range
  , {-|
  Children of this symbol, e.g. properties of a class.
  -}
  DocumentSymbol -> Maybe [DocumentSymbol]
_children :: (Maybe [Language.LSP.Protocol.Internal.Types.DocumentSymbol.DocumentSymbol])
  }
  deriving stock (Int -> DocumentSymbol -> ShowS
[DocumentSymbol] -> ShowS
DocumentSymbol -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocumentSymbol] -> ShowS
$cshowList :: [DocumentSymbol] -> ShowS
show :: DocumentSymbol -> String
$cshow :: DocumentSymbol -> String
showsPrec :: Int -> DocumentSymbol -> ShowS
$cshowsPrec :: Int -> DocumentSymbol -> ShowS
Show, DocumentSymbol -> DocumentSymbol -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocumentSymbol -> DocumentSymbol -> Bool
$c/= :: DocumentSymbol -> DocumentSymbol -> Bool
== :: DocumentSymbol -> DocumentSymbol -> Bool
$c== :: DocumentSymbol -> DocumentSymbol -> Bool
Eq, Eq DocumentSymbol
DocumentSymbol -> DocumentSymbol -> Bool
DocumentSymbol -> DocumentSymbol -> Ordering
DocumentSymbol -> DocumentSymbol -> DocumentSymbol
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 :: DocumentSymbol -> DocumentSymbol -> DocumentSymbol
$cmin :: DocumentSymbol -> DocumentSymbol -> DocumentSymbol
max :: DocumentSymbol -> DocumentSymbol -> DocumentSymbol
$cmax :: DocumentSymbol -> DocumentSymbol -> DocumentSymbol
>= :: DocumentSymbol -> DocumentSymbol -> Bool
$c>= :: DocumentSymbol -> DocumentSymbol -> Bool
> :: DocumentSymbol -> DocumentSymbol -> Bool
$c> :: DocumentSymbol -> DocumentSymbol -> Bool
<= :: DocumentSymbol -> DocumentSymbol -> Bool
$c<= :: DocumentSymbol -> DocumentSymbol -> Bool
< :: DocumentSymbol -> DocumentSymbol -> Bool
$c< :: DocumentSymbol -> DocumentSymbol -> Bool
compare :: DocumentSymbol -> DocumentSymbol -> Ordering
$ccompare :: DocumentSymbol -> DocumentSymbol -> Ordering
Ord, forall x. Rep DocumentSymbol x -> DocumentSymbol
forall x. DocumentSymbol -> Rep DocumentSymbol x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DocumentSymbol x -> DocumentSymbol
$cfrom :: forall x. DocumentSymbol -> Rep DocumentSymbol x
Generic)
  deriving anyclass (DocumentSymbol -> ()
forall a. (a -> ()) -> NFData a
rnf :: DocumentSymbol -> ()
$crnf :: DocumentSymbol -> ()
NFData, Eq DocumentSymbol
Int -> DocumentSymbol -> Int
DocumentSymbol -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: DocumentSymbol -> Int
$chash :: DocumentSymbol -> Int
hashWithSalt :: Int -> DocumentSymbol -> Int
$chashWithSalt :: Int -> DocumentSymbol -> Int
Hashable)
  deriving forall ann. [DocumentSymbol] -> Doc ann
forall ann. DocumentSymbol -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [DocumentSymbol] -> Doc ann
$cprettyList :: forall ann. [DocumentSymbol] -> Doc ann
pretty :: forall ann. DocumentSymbol -> Doc ann
$cpretty :: forall ann. DocumentSymbol -> Doc ann
Pretty via (ViaJSON DocumentSymbol)

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

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