{- 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.InlayHintParams 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 Language.LSP.Protocol.Internal.Types.ProgressToken
import qualified Language.LSP.Protocol.Internal.Types.Range
import qualified Language.LSP.Protocol.Internal.Types.TextDocumentIdentifier
import qualified Language.LSP.Protocol.Types.Common

{-|
A parameter literal used in inlay hint requests.

@since 3.17.0
-}
data InlayHintParams = InlayHintParams 
  { {-|
  An optional token that a server can use to report work done progress.
  -}
  InlayHintParams -> Maybe ProgressToken
_workDoneToken :: (Maybe Language.LSP.Protocol.Internal.Types.ProgressToken.ProgressToken)
  , {-|
  The text document.
  -}
  InlayHintParams -> TextDocumentIdentifier
_textDocument :: Language.LSP.Protocol.Internal.Types.TextDocumentIdentifier.TextDocumentIdentifier
  , {-|
  The document range for which inlay hints should be computed.
  -}
  InlayHintParams -> Range
_range :: Language.LSP.Protocol.Internal.Types.Range.Range
  }
  deriving stock (Int -> InlayHintParams -> ShowS
[InlayHintParams] -> ShowS
InlayHintParams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InlayHintParams] -> ShowS
$cshowList :: [InlayHintParams] -> ShowS
show :: InlayHintParams -> String
$cshow :: InlayHintParams -> String
showsPrec :: Int -> InlayHintParams -> ShowS
$cshowsPrec :: Int -> InlayHintParams -> ShowS
Show, InlayHintParams -> InlayHintParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InlayHintParams -> InlayHintParams -> Bool
$c/= :: InlayHintParams -> InlayHintParams -> Bool
== :: InlayHintParams -> InlayHintParams -> Bool
$c== :: InlayHintParams -> InlayHintParams -> Bool
Eq, Eq InlayHintParams
InlayHintParams -> InlayHintParams -> Bool
InlayHintParams -> InlayHintParams -> Ordering
InlayHintParams -> InlayHintParams -> InlayHintParams
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 :: InlayHintParams -> InlayHintParams -> InlayHintParams
$cmin :: InlayHintParams -> InlayHintParams -> InlayHintParams
max :: InlayHintParams -> InlayHintParams -> InlayHintParams
$cmax :: InlayHintParams -> InlayHintParams -> InlayHintParams
>= :: InlayHintParams -> InlayHintParams -> Bool
$c>= :: InlayHintParams -> InlayHintParams -> Bool
> :: InlayHintParams -> InlayHintParams -> Bool
$c> :: InlayHintParams -> InlayHintParams -> Bool
<= :: InlayHintParams -> InlayHintParams -> Bool
$c<= :: InlayHintParams -> InlayHintParams -> Bool
< :: InlayHintParams -> InlayHintParams -> Bool
$c< :: InlayHintParams -> InlayHintParams -> Bool
compare :: InlayHintParams -> InlayHintParams -> Ordering
$ccompare :: InlayHintParams -> InlayHintParams -> Ordering
Ord, forall x. Rep InlayHintParams x -> InlayHintParams
forall x. InlayHintParams -> Rep InlayHintParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InlayHintParams x -> InlayHintParams
$cfrom :: forall x. InlayHintParams -> Rep InlayHintParams x
Generic)
  deriving anyclass (InlayHintParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: InlayHintParams -> ()
$crnf :: InlayHintParams -> ()
NFData, Eq InlayHintParams
Int -> InlayHintParams -> Int
InlayHintParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: InlayHintParams -> Int
$chash :: InlayHintParams -> Int
hashWithSalt :: Int -> InlayHintParams -> Int
$chashWithSalt :: Int -> InlayHintParams -> Int
Hashable)
  deriving forall ann. [InlayHintParams] -> Doc ann
forall ann. InlayHintParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [InlayHintParams] -> Doc ann
$cprettyList :: forall ann. [InlayHintParams] -> Doc ann
pretty :: forall ann. InlayHintParams -> Doc ann
$cpretty :: forall ann. InlayHintParams -> Doc ann
Pretty via (ViaJSON InlayHintParams)

instance Aeson.ToJSON InlayHintParams where
  toJSON :: InlayHintParams -> Value
toJSON (InlayHintParams Maybe ProgressToken
arg0 TextDocumentIdentifier
arg1 Range
arg2) = [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
"workDoneToken" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe ProgressToken
arg0
    ,[Key
"textDocument" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= TextDocumentIdentifier
arg1]
    ,[Key
"range" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Range
arg2]]

instance Aeson.FromJSON InlayHintParams where
  parseJSON :: Value -> Parser InlayHintParams
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"InlayHintParams" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe ProgressToken
-> TextDocumentIdentifier -> Range -> InlayHintParams
InlayHintParams 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
"workDoneToken" 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
"textDocument" 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"