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

{-|
Provide inline value as text.

@since 3.17.0
-}
data InlineValueText = InlineValueText 
  { {-|
  The document range for which the inline value applies.
  -}
  InlineValueText -> Range
_range :: Language.LSP.Protocol.Internal.Types.Range.Range
  , {-|
  The text of the inline value.
  -}
  InlineValueText -> Text
_text :: Data.Text.Text
  }
  deriving stock (Int -> InlineValueText -> ShowS
[InlineValueText] -> ShowS
InlineValueText -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InlineValueText] -> ShowS
$cshowList :: [InlineValueText] -> ShowS
show :: InlineValueText -> String
$cshow :: InlineValueText -> String
showsPrec :: Int -> InlineValueText -> ShowS
$cshowsPrec :: Int -> InlineValueText -> ShowS
Show, InlineValueText -> InlineValueText -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InlineValueText -> InlineValueText -> Bool
$c/= :: InlineValueText -> InlineValueText -> Bool
== :: InlineValueText -> InlineValueText -> Bool
$c== :: InlineValueText -> InlineValueText -> Bool
Eq, Eq InlineValueText
InlineValueText -> InlineValueText -> Bool
InlineValueText -> InlineValueText -> Ordering
InlineValueText -> InlineValueText -> InlineValueText
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 :: InlineValueText -> InlineValueText -> InlineValueText
$cmin :: InlineValueText -> InlineValueText -> InlineValueText
max :: InlineValueText -> InlineValueText -> InlineValueText
$cmax :: InlineValueText -> InlineValueText -> InlineValueText
>= :: InlineValueText -> InlineValueText -> Bool
$c>= :: InlineValueText -> InlineValueText -> Bool
> :: InlineValueText -> InlineValueText -> Bool
$c> :: InlineValueText -> InlineValueText -> Bool
<= :: InlineValueText -> InlineValueText -> Bool
$c<= :: InlineValueText -> InlineValueText -> Bool
< :: InlineValueText -> InlineValueText -> Bool
$c< :: InlineValueText -> InlineValueText -> Bool
compare :: InlineValueText -> InlineValueText -> Ordering
$ccompare :: InlineValueText -> InlineValueText -> Ordering
Ord, forall x. Rep InlineValueText x -> InlineValueText
forall x. InlineValueText -> Rep InlineValueText x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InlineValueText x -> InlineValueText
$cfrom :: forall x. InlineValueText -> Rep InlineValueText x
Generic)
  deriving anyclass (InlineValueText -> ()
forall a. (a -> ()) -> NFData a
rnf :: InlineValueText -> ()
$crnf :: InlineValueText -> ()
NFData, Eq InlineValueText
Int -> InlineValueText -> Int
InlineValueText -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: InlineValueText -> Int
$chash :: InlineValueText -> Int
hashWithSalt :: Int -> InlineValueText -> Int
$chashWithSalt :: Int -> InlineValueText -> Int
Hashable)
  deriving forall ann. [InlineValueText] -> Doc ann
forall ann. InlineValueText -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [InlineValueText] -> Doc ann
$cprettyList :: forall ann. [InlineValueText] -> Doc ann
pretty :: forall ann. InlineValueText -> Doc ann
$cpretty :: forall ann. InlineValueText -> Doc ann
Pretty via (ViaJSON InlineValueText)

instance Aeson.ToJSON InlineValueText where
  toJSON :: InlineValueText -> Value
toJSON (InlineValueText Range
arg0 Text
arg1) = [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
"range" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Range
arg0]
    ,[Key
"text" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Text
arg1]]

instance Aeson.FromJSON InlineValueText where
  parseJSON :: Value -> Parser InlineValueText
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"InlineValueText" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Range -> Text -> InlineValueText
InlineValueText forall (f :: * -> *) a b. Functor 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
"text"