{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-unused-matches #-}
{-# OPTIONS_GHC -Wno-deprecations #-}
module Language.LSP.Protocol.Internal.Types.InlineValueEvaluatableExpression 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
data InlineValueEvaluatableExpression = InlineValueEvaluatableExpression
{
InlineValueEvaluatableExpression -> Range
_range :: Language.LSP.Protocol.Internal.Types.Range.Range
,
InlineValueEvaluatableExpression -> Maybe Text
_expression :: (Maybe Data.Text.Text)
}
deriving stock (Int -> InlineValueEvaluatableExpression -> ShowS
[InlineValueEvaluatableExpression] -> ShowS
InlineValueEvaluatableExpression -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InlineValueEvaluatableExpression] -> ShowS
$cshowList :: [InlineValueEvaluatableExpression] -> ShowS
show :: InlineValueEvaluatableExpression -> String
$cshow :: InlineValueEvaluatableExpression -> String
showsPrec :: Int -> InlineValueEvaluatableExpression -> ShowS
$cshowsPrec :: Int -> InlineValueEvaluatableExpression -> ShowS
Show, InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression -> Bool
$c/= :: InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression -> Bool
== :: InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression -> Bool
$c== :: InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression -> Bool
Eq, Eq InlineValueEvaluatableExpression
InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression -> Bool
InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression -> Ordering
InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression
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 :: InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression
$cmin :: InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression
max :: InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression
$cmax :: InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression
>= :: InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression -> Bool
$c>= :: InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression -> Bool
> :: InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression -> Bool
$c> :: InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression -> Bool
<= :: InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression -> Bool
$c<= :: InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression -> Bool
< :: InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression -> Bool
$c< :: InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression -> Bool
compare :: InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression -> Ordering
$ccompare :: InlineValueEvaluatableExpression
-> InlineValueEvaluatableExpression -> Ordering
Ord, forall x.
Rep InlineValueEvaluatableExpression x
-> InlineValueEvaluatableExpression
forall x.
InlineValueEvaluatableExpression
-> Rep InlineValueEvaluatableExpression x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InlineValueEvaluatableExpression x
-> InlineValueEvaluatableExpression
$cfrom :: forall x.
InlineValueEvaluatableExpression
-> Rep InlineValueEvaluatableExpression x
Generic)
deriving anyclass (InlineValueEvaluatableExpression -> ()
forall a. (a -> ()) -> NFData a
rnf :: InlineValueEvaluatableExpression -> ()
$crnf :: InlineValueEvaluatableExpression -> ()
NFData, Eq InlineValueEvaluatableExpression
Int -> InlineValueEvaluatableExpression -> Int
InlineValueEvaluatableExpression -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: InlineValueEvaluatableExpression -> Int
$chash :: InlineValueEvaluatableExpression -> Int
hashWithSalt :: Int -> InlineValueEvaluatableExpression -> Int
$chashWithSalt :: Int -> InlineValueEvaluatableExpression -> Int
Hashable)
deriving forall ann. [InlineValueEvaluatableExpression] -> Doc ann
forall ann. InlineValueEvaluatableExpression -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [InlineValueEvaluatableExpression] -> Doc ann
$cprettyList :: forall ann. [InlineValueEvaluatableExpression] -> Doc ann
pretty :: forall ann. InlineValueEvaluatableExpression -> Doc ann
$cpretty :: forall ann. InlineValueEvaluatableExpression -> Doc ann
Pretty via (ViaJSON InlineValueEvaluatableExpression)
instance Aeson.ToJSON InlineValueEvaluatableExpression where
toJSON :: InlineValueEvaluatableExpression -> Value
toJSON (InlineValueEvaluatableExpression Range
arg0 Maybe 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]
,String
"expression" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg1]
instance Aeson.FromJSON InlineValueEvaluatableExpression where
parseJSON :: Value -> Parser InlineValueEvaluatableExpression
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"InlineValueEvaluatableExpression" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Range -> Maybe Text -> InlineValueEvaluatableExpression
InlineValueEvaluatableExpression 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 (Maybe a)
Aeson..:! Key
"expression"