{- 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.InlayHint where

import Control.DeepSeq
import Data.Hashable
import GHC.Generics
import Language.LSP.Protocol.Utils.Misc
import Prettyprinter
import qualified Data.Aeson
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.InlayHintKind
import qualified Language.LSP.Protocol.Internal.Types.InlayHintLabelPart
import qualified Language.LSP.Protocol.Internal.Types.MarkupContent
import qualified Language.LSP.Protocol.Internal.Types.Position
import qualified Language.LSP.Protocol.Internal.Types.TextEdit
import qualified Language.LSP.Protocol.Types.Common

{-|
Inlay hint information.

@since 3.17.0
-}
data InlayHint = InlayHint 
  { {-|
  The position of this hint.
  -}
  InlayHint -> Position
_position :: Language.LSP.Protocol.Internal.Types.Position.Position
  , {-|
  The label of this hint. A human readable string or an array of
  InlayHintLabelPart label parts.

  *Note* that neither the string nor the label part can be empty.
  -}
  InlayHint -> Text |? [InlayHintLabelPart]
_label :: (Data.Text.Text Language.LSP.Protocol.Types.Common.|? [Language.LSP.Protocol.Internal.Types.InlayHintLabelPart.InlayHintLabelPart])
  , {-|
  The kind of this hint. Can be omitted in which case the client
  should fall back to a reasonable default.
  -}
  InlayHint -> Maybe InlayHintKind
_kind :: (Maybe Language.LSP.Protocol.Internal.Types.InlayHintKind.InlayHintKind)
  , {-|
  Optional text edits that are performed when accepting this inlay hint.

  *Note* that edits are expected to change the document so that the inlay
  hint (or its nearest variant) is now part of the document and the inlay
  hint itself is now obsolete.
  -}
  InlayHint -> Maybe [TextEdit]
_textEdits :: (Maybe [Language.LSP.Protocol.Internal.Types.TextEdit.TextEdit])
  , {-|
  The tooltip text when you hover over this item.
  -}
  InlayHint -> Maybe (Text |? MarkupContent)
_tooltip :: (Maybe (Data.Text.Text Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Internal.Types.MarkupContent.MarkupContent))
  , {-|
  Render padding before the hint.

  Note: Padding should use the editor's background color, not the
  background color of the hint itself. That means padding can be used
  to visually align/separate an inlay hint.
  -}
  InlayHint -> Maybe Bool
_paddingLeft :: (Maybe Bool)
  , {-|
  Render padding after the hint.

  Note: Padding should use the editor's background color, not the
  background color of the hint itself. That means padding can be used
  to visually align/separate an inlay hint.
  -}
  InlayHint -> Maybe Bool
_paddingRight :: (Maybe Bool)
  , {-|
  A data entry field that is preserved on an inlay hint between
  a `textDocument/inlayHint` and a `inlayHint/resolve` request.
  -}
  InlayHint -> Maybe Value
_data_ :: (Maybe Data.Aeson.Value)
  }
  deriving stock (Int -> InlayHint -> ShowS
[InlayHint] -> ShowS
InlayHint -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InlayHint] -> ShowS
$cshowList :: [InlayHint] -> ShowS
show :: InlayHint -> String
$cshow :: InlayHint -> String
showsPrec :: Int -> InlayHint -> ShowS
$cshowsPrec :: Int -> InlayHint -> ShowS
Show, InlayHint -> InlayHint -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InlayHint -> InlayHint -> Bool
$c/= :: InlayHint -> InlayHint -> Bool
== :: InlayHint -> InlayHint -> Bool
$c== :: InlayHint -> InlayHint -> Bool
Eq, Eq InlayHint
InlayHint -> InlayHint -> Bool
InlayHint -> InlayHint -> Ordering
InlayHint -> InlayHint -> InlayHint
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 :: InlayHint -> InlayHint -> InlayHint
$cmin :: InlayHint -> InlayHint -> InlayHint
max :: InlayHint -> InlayHint -> InlayHint
$cmax :: InlayHint -> InlayHint -> InlayHint
>= :: InlayHint -> InlayHint -> Bool
$c>= :: InlayHint -> InlayHint -> Bool
> :: InlayHint -> InlayHint -> Bool
$c> :: InlayHint -> InlayHint -> Bool
<= :: InlayHint -> InlayHint -> Bool
$c<= :: InlayHint -> InlayHint -> Bool
< :: InlayHint -> InlayHint -> Bool
$c< :: InlayHint -> InlayHint -> Bool
compare :: InlayHint -> InlayHint -> Ordering
$ccompare :: InlayHint -> InlayHint -> Ordering
Ord, forall x. Rep InlayHint x -> InlayHint
forall x. InlayHint -> Rep InlayHint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InlayHint x -> InlayHint
$cfrom :: forall x. InlayHint -> Rep InlayHint x
Generic)
  deriving anyclass (InlayHint -> ()
forall a. (a -> ()) -> NFData a
rnf :: InlayHint -> ()
$crnf :: InlayHint -> ()
NFData, Eq InlayHint
Int -> InlayHint -> Int
InlayHint -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: InlayHint -> Int
$chash :: InlayHint -> Int
hashWithSalt :: Int -> InlayHint -> Int
$chashWithSalt :: Int -> InlayHint -> Int
Hashable)
  deriving forall ann. [InlayHint] -> Doc ann
forall ann. InlayHint -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [InlayHint] -> Doc ann
$cprettyList :: forall ann. [InlayHint] -> Doc ann
pretty :: forall ann. InlayHint -> Doc ann
$cpretty :: forall ann. InlayHint -> Doc ann
Pretty via (ViaJSON InlayHint)

instance Aeson.ToJSON InlayHint where
  toJSON :: InlayHint -> Value
toJSON (InlayHint Position
arg0 Text |? [InlayHintLabelPart]
arg1 Maybe InlayHintKind
arg2 Maybe [TextEdit]
arg3 Maybe (Text |? MarkupContent)
arg4 Maybe Bool
arg5 Maybe Bool
arg6 Maybe Value
arg7) = [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
"position" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Position
arg0]
    ,[Key
"label" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Text |? [InlayHintLabelPart]
arg1]
    ,String
"kind" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe InlayHintKind
arg2
    ,String
"textEdits" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe [TextEdit]
arg3
    ,String
"tooltip" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe (Text |? MarkupContent)
arg4
    ,String
"paddingLeft" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg5
    ,String
"paddingRight" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg6
    ,String
"data" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Value
arg7]

instance Aeson.FromJSON InlayHint where
  parseJSON :: Value -> Parser InlayHint
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"InlayHint" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Position
-> (Text |? [InlayHintLabelPart])
-> Maybe InlayHintKind
-> Maybe [TextEdit]
-> Maybe (Text |? MarkupContent)
-> Maybe Bool
-> Maybe Bool
-> Maybe Value
-> InlayHint
InlayHint forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"position" 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
"label" 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
"kind" 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
"textEdits" 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
"tooltip" 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
"paddingLeft" 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
"paddingRight" 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
"data"