{- 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.InlineValueVariableLookup 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 through a variable lookup.
If only a range is specified, the variable name will be extracted from the underlying document.
An optional variable name can be used to override the extracted name.

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

instance Aeson.ToJSON InlineValueVariableLookup where
  toJSON :: InlineValueVariableLookup -> Value
toJSON (InlineValueVariableLookup Range
arg0 Maybe Text
arg1 Bool
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
$  [[Key
"range" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Range
arg0]
    ,String
"variableName" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg1
    ,[Key
"caseSensitiveLookup" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Bool
arg2]]

instance Aeson.FromJSON InlineValueVariableLookup where
  parseJSON :: Value -> Parser InlineValueVariableLookup
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"InlineValueVariableLookup" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Range -> Maybe Text -> Bool -> InlineValueVariableLookup
InlineValueVariableLookup 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
"variableName" 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
"caseSensitiveLookup"