{- 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.DocumentSymbolOptions 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.Types.Common

{-|
Provider options for a `DocumentSymbolRequest`.
-}
data DocumentSymbolOptions = DocumentSymbolOptions 
  { {-|

  -}
  DocumentSymbolOptions -> Maybe Bool
_workDoneProgress :: (Maybe Bool)
  , {-|
  A human-readable string that is shown when multiple outlines trees
  are shown for the same document.

  @since 3.16.0
  -}
  DocumentSymbolOptions -> Maybe Text
_label :: (Maybe Data.Text.Text)
  }
  deriving stock (Int -> DocumentSymbolOptions -> ShowS
[DocumentSymbolOptions] -> ShowS
DocumentSymbolOptions -> String
(Int -> DocumentSymbolOptions -> ShowS)
-> (DocumentSymbolOptions -> String)
-> ([DocumentSymbolOptions] -> ShowS)
-> Show DocumentSymbolOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DocumentSymbolOptions -> ShowS
showsPrec :: Int -> DocumentSymbolOptions -> ShowS
$cshow :: DocumentSymbolOptions -> String
show :: DocumentSymbolOptions -> String
$cshowList :: [DocumentSymbolOptions] -> ShowS
showList :: [DocumentSymbolOptions] -> ShowS
Show, DocumentSymbolOptions -> DocumentSymbolOptions -> Bool
(DocumentSymbolOptions -> DocumentSymbolOptions -> Bool)
-> (DocumentSymbolOptions -> DocumentSymbolOptions -> Bool)
-> Eq DocumentSymbolOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DocumentSymbolOptions -> DocumentSymbolOptions -> Bool
== :: DocumentSymbolOptions -> DocumentSymbolOptions -> Bool
$c/= :: DocumentSymbolOptions -> DocumentSymbolOptions -> Bool
/= :: DocumentSymbolOptions -> DocumentSymbolOptions -> Bool
Eq, Eq DocumentSymbolOptions
Eq DocumentSymbolOptions =>
(DocumentSymbolOptions -> DocumentSymbolOptions -> Ordering)
-> (DocumentSymbolOptions -> DocumentSymbolOptions -> Bool)
-> (DocumentSymbolOptions -> DocumentSymbolOptions -> Bool)
-> (DocumentSymbolOptions -> DocumentSymbolOptions -> Bool)
-> (DocumentSymbolOptions -> DocumentSymbolOptions -> Bool)
-> (DocumentSymbolOptions
    -> DocumentSymbolOptions -> DocumentSymbolOptions)
-> (DocumentSymbolOptions
    -> DocumentSymbolOptions -> DocumentSymbolOptions)
-> Ord DocumentSymbolOptions
DocumentSymbolOptions -> DocumentSymbolOptions -> Bool
DocumentSymbolOptions -> DocumentSymbolOptions -> Ordering
DocumentSymbolOptions
-> DocumentSymbolOptions -> DocumentSymbolOptions
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 :: DocumentSymbolOptions -> DocumentSymbolOptions -> Ordering
compare :: DocumentSymbolOptions -> DocumentSymbolOptions -> Ordering
$c< :: DocumentSymbolOptions -> DocumentSymbolOptions -> Bool
< :: DocumentSymbolOptions -> DocumentSymbolOptions -> Bool
$c<= :: DocumentSymbolOptions -> DocumentSymbolOptions -> Bool
<= :: DocumentSymbolOptions -> DocumentSymbolOptions -> Bool
$c> :: DocumentSymbolOptions -> DocumentSymbolOptions -> Bool
> :: DocumentSymbolOptions -> DocumentSymbolOptions -> Bool
$c>= :: DocumentSymbolOptions -> DocumentSymbolOptions -> Bool
>= :: DocumentSymbolOptions -> DocumentSymbolOptions -> Bool
$cmax :: DocumentSymbolOptions
-> DocumentSymbolOptions -> DocumentSymbolOptions
max :: DocumentSymbolOptions
-> DocumentSymbolOptions -> DocumentSymbolOptions
$cmin :: DocumentSymbolOptions
-> DocumentSymbolOptions -> DocumentSymbolOptions
min :: DocumentSymbolOptions
-> DocumentSymbolOptions -> DocumentSymbolOptions
Ord, (forall x. DocumentSymbolOptions -> Rep DocumentSymbolOptions x)
-> (forall x. Rep DocumentSymbolOptions x -> DocumentSymbolOptions)
-> Generic DocumentSymbolOptions
forall x. Rep DocumentSymbolOptions x -> DocumentSymbolOptions
forall x. DocumentSymbolOptions -> Rep DocumentSymbolOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DocumentSymbolOptions -> Rep DocumentSymbolOptions x
from :: forall x. DocumentSymbolOptions -> Rep DocumentSymbolOptions x
$cto :: forall x. Rep DocumentSymbolOptions x -> DocumentSymbolOptions
to :: forall x. Rep DocumentSymbolOptions x -> DocumentSymbolOptions
Generic)
  deriving anyclass (DocumentSymbolOptions -> ()
(DocumentSymbolOptions -> ()) -> NFData DocumentSymbolOptions
forall a. (a -> ()) -> NFData a
$crnf :: DocumentSymbolOptions -> ()
rnf :: DocumentSymbolOptions -> ()
NFData, Eq DocumentSymbolOptions
Eq DocumentSymbolOptions =>
(Int -> DocumentSymbolOptions -> Int)
-> (DocumentSymbolOptions -> Int) -> Hashable DocumentSymbolOptions
Int -> DocumentSymbolOptions -> Int
DocumentSymbolOptions -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> DocumentSymbolOptions -> Int
hashWithSalt :: Int -> DocumentSymbolOptions -> Int
$chash :: DocumentSymbolOptions -> Int
hash :: DocumentSymbolOptions -> Int
Hashable)
  deriving (forall ann. DocumentSymbolOptions -> Doc ann)
-> (forall ann. [DocumentSymbolOptions] -> Doc ann)
-> Pretty DocumentSymbolOptions
forall ann. [DocumentSymbolOptions] -> Doc ann
forall ann. DocumentSymbolOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. DocumentSymbolOptions -> Doc ann
pretty :: forall ann. DocumentSymbolOptions -> Doc ann
$cprettyList :: forall ann. [DocumentSymbolOptions] -> Doc ann
prettyList :: forall ann. [DocumentSymbolOptions] -> Doc ann
Pretty via (ViaJSON DocumentSymbolOptions)

instance Aeson.ToJSON DocumentSymbolOptions where
  toJSON :: DocumentSymbolOptions -> Value
toJSON (DocumentSymbolOptions Maybe Bool
arg0 Maybe Text
arg1) = [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
$  [String
"workDoneProgress" String -> Maybe Bool -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg0
    ,String
"label" String -> Maybe Text -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg1]

instance Aeson.FromJSON DocumentSymbolOptions where
  parseJSON :: Value -> Parser DocumentSymbolOptions
parseJSON = String
-> (Object -> Parser DocumentSymbolOptions)
-> Value
-> Parser DocumentSymbolOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"DocumentSymbolOptions" ((Object -> Parser DocumentSymbolOptions)
 -> Value -> Parser DocumentSymbolOptions)
-> (Object -> Parser DocumentSymbolOptions)
-> Value
-> Parser DocumentSymbolOptions
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Bool -> Maybe Text -> DocumentSymbolOptions
DocumentSymbolOptions (Maybe Bool -> Maybe Text -> DocumentSymbolOptions)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> DocumentSymbolOptions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser (Maybe Bool)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"workDoneProgress" Parser (Maybe Text -> DocumentSymbolOptions)
-> Parser (Maybe Text) -> Parser DocumentSymbolOptions
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
"label"