{- 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.SemanticTokensOptions 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 as Row
import qualified Data.Row.Aeson as Aeson
import qualified Data.Row.Hashable as Hashable
import qualified Language.LSP.Protocol.Internal.Types.SemanticTokensLegend
import qualified Language.LSP.Protocol.Types.Common

{-|
@since 3.16.0
-}
data SemanticTokensOptions = SemanticTokensOptions 
  { {-|

  -}
  SemanticTokensOptions -> Maybe Bool
_workDoneProgress :: (Maybe Bool)
  , {-|
  The legend used by the server
  -}
  SemanticTokensOptions -> SemanticTokensLegend
_legend :: Language.LSP.Protocol.Internal.Types.SemanticTokensLegend.SemanticTokensLegend
  , {-|
  Server supports providing semantic tokens for a specific range
  of a document.
  -}
  SemanticTokensOptions -> Maybe (Bool |? Rec Empty)
_range :: (Maybe (Bool Language.LSP.Protocol.Types.Common.|? (Row.Rec Row.Empty)))
  , {-|
  Server supports providing semantic tokens for a full document.
  -}
  SemanticTokensOptions
-> Maybe (Bool |? Rec (Extend "delta" (Maybe Bool) Empty .+ Empty))
_full :: (Maybe (Bool Language.LSP.Protocol.Types.Common.|? (Row.Rec ("delta" Row..== (Maybe Bool) Row..+ Row.Empty))))
  }
  deriving stock (Int -> SemanticTokensOptions -> ShowS
[SemanticTokensOptions] -> ShowS
SemanticTokensOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SemanticTokensOptions] -> ShowS
$cshowList :: [SemanticTokensOptions] -> ShowS
show :: SemanticTokensOptions -> String
$cshow :: SemanticTokensOptions -> String
showsPrec :: Int -> SemanticTokensOptions -> ShowS
$cshowsPrec :: Int -> SemanticTokensOptions -> ShowS
Show, SemanticTokensOptions -> SemanticTokensOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SemanticTokensOptions -> SemanticTokensOptions -> Bool
$c/= :: SemanticTokensOptions -> SemanticTokensOptions -> Bool
== :: SemanticTokensOptions -> SemanticTokensOptions -> Bool
$c== :: SemanticTokensOptions -> SemanticTokensOptions -> Bool
Eq, Eq SemanticTokensOptions
SemanticTokensOptions -> SemanticTokensOptions -> Bool
SemanticTokensOptions -> SemanticTokensOptions -> Ordering
SemanticTokensOptions
-> SemanticTokensOptions -> SemanticTokensOptions
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 :: SemanticTokensOptions
-> SemanticTokensOptions -> SemanticTokensOptions
$cmin :: SemanticTokensOptions
-> SemanticTokensOptions -> SemanticTokensOptions
max :: SemanticTokensOptions
-> SemanticTokensOptions -> SemanticTokensOptions
$cmax :: SemanticTokensOptions
-> SemanticTokensOptions -> SemanticTokensOptions
>= :: SemanticTokensOptions -> SemanticTokensOptions -> Bool
$c>= :: SemanticTokensOptions -> SemanticTokensOptions -> Bool
> :: SemanticTokensOptions -> SemanticTokensOptions -> Bool
$c> :: SemanticTokensOptions -> SemanticTokensOptions -> Bool
<= :: SemanticTokensOptions -> SemanticTokensOptions -> Bool
$c<= :: SemanticTokensOptions -> SemanticTokensOptions -> Bool
< :: SemanticTokensOptions -> SemanticTokensOptions -> Bool
$c< :: SemanticTokensOptions -> SemanticTokensOptions -> Bool
compare :: SemanticTokensOptions -> SemanticTokensOptions -> Ordering
$ccompare :: SemanticTokensOptions -> SemanticTokensOptions -> Ordering
Ord, forall x. Rep SemanticTokensOptions x -> SemanticTokensOptions
forall x. SemanticTokensOptions -> Rep SemanticTokensOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SemanticTokensOptions x -> SemanticTokensOptions
$cfrom :: forall x. SemanticTokensOptions -> Rep SemanticTokensOptions x
Generic)
  deriving anyclass (SemanticTokensOptions -> ()
forall a. (a -> ()) -> NFData a
rnf :: SemanticTokensOptions -> ()
$crnf :: SemanticTokensOptions -> ()
NFData, Eq SemanticTokensOptions
Int -> SemanticTokensOptions -> Int
SemanticTokensOptions -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: SemanticTokensOptions -> Int
$chash :: SemanticTokensOptions -> Int
hashWithSalt :: Int -> SemanticTokensOptions -> Int
$chashWithSalt :: Int -> SemanticTokensOptions -> Int
Hashable)
  deriving forall ann. [SemanticTokensOptions] -> Doc ann
forall ann. SemanticTokensOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [SemanticTokensOptions] -> Doc ann
$cprettyList :: forall ann. [SemanticTokensOptions] -> Doc ann
pretty :: forall ann. SemanticTokensOptions -> Doc ann
$cpretty :: forall ann. SemanticTokensOptions -> Doc ann
Pretty via (ViaJSON SemanticTokensOptions)

instance Aeson.ToJSON SemanticTokensOptions where
  toJSON :: SemanticTokensOptions -> Value
toJSON (SemanticTokensOptions Maybe Bool
arg0 SemanticTokensLegend
arg1 Maybe (Bool |? Rec Empty)
arg2 Maybe (Bool |? Rec (Extend "delta" (Maybe Bool) Empty .+ Empty))
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
$  [String
"workDoneProgress" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg0
    ,[Key
"legend" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= SemanticTokensLegend
arg1]
    ,String
"range" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe (Bool |? Rec Empty)
arg2
    ,String
"full" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe (Bool |? Rec (Extend "delta" (Maybe Bool) Empty .+ Empty))
arg3]

instance Aeson.FromJSON SemanticTokensOptions where
  parseJSON :: Value -> Parser SemanticTokensOptions
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"SemanticTokensOptions" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Bool
-> SemanticTokensLegend
-> Maybe (Bool |? Rec Empty)
-> Maybe (Bool |? Rec (Extend "delta" (Maybe Bool) Empty .+ Empty))
-> SemanticTokensOptions
SemanticTokensOptions forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"workDoneProgress" 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
"legend" 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
"range" 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
"full"