{- 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.InlayHintLabelPart 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.Command
import qualified Language.LSP.Protocol.Internal.Types.Location
import qualified Language.LSP.Protocol.Internal.Types.MarkupContent
import qualified Language.LSP.Protocol.Types.Common

{-|
An inlay hint label part allows for interactive and composite labels
of inlay hints.

@since 3.17.0
-}
data InlayHintLabelPart = InlayHintLabelPart 
  { {-|
  The value of this label part.
  -}
  InlayHintLabelPart -> Text
_value :: Data.Text.Text
  , {-|
  The tooltip text when you hover over this label part. Depending on
  the client capability `inlayHint.resolveSupport` clients might resolve
  this property late using the resolve request.
  -}
  InlayHintLabelPart -> Maybe (Text |? MarkupContent)
_tooltip :: (Maybe (Data.Text.Text Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Internal.Types.MarkupContent.MarkupContent))
  , {-|
  An optional source code location that represents this
  label part.

  The editor will use this location for the hover and for code navigation
  features: This part will become a clickable link that resolves to the
  definition of the symbol at the given location (not necessarily the
  location itself), it shows the hover that shows at the given location,
  and it shows a context menu with further code navigation commands.

  Depending on the client capability `inlayHint.resolveSupport` clients
  might resolve this property late using the resolve request.
  -}
  InlayHintLabelPart -> Maybe Location
_location :: (Maybe Language.LSP.Protocol.Internal.Types.Location.Location)
  , {-|
  An optional command for this label part.

  Depending on the client capability `inlayHint.resolveSupport` clients
  might resolve this property late using the resolve request.
  -}
  InlayHintLabelPart -> Maybe Command
_command :: (Maybe Language.LSP.Protocol.Internal.Types.Command.Command)
  }
  deriving stock (Int -> InlayHintLabelPart -> ShowS
[InlayHintLabelPart] -> ShowS
InlayHintLabelPart -> String
(Int -> InlayHintLabelPart -> ShowS)
-> (InlayHintLabelPart -> String)
-> ([InlayHintLabelPart] -> ShowS)
-> Show InlayHintLabelPart
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InlayHintLabelPart -> ShowS
showsPrec :: Int -> InlayHintLabelPart -> ShowS
$cshow :: InlayHintLabelPart -> String
show :: InlayHintLabelPart -> String
$cshowList :: [InlayHintLabelPart] -> ShowS
showList :: [InlayHintLabelPart] -> ShowS
Show, InlayHintLabelPart -> InlayHintLabelPart -> Bool
(InlayHintLabelPart -> InlayHintLabelPart -> Bool)
-> (InlayHintLabelPart -> InlayHintLabelPart -> Bool)
-> Eq InlayHintLabelPart
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InlayHintLabelPart -> InlayHintLabelPart -> Bool
== :: InlayHintLabelPart -> InlayHintLabelPart -> Bool
$c/= :: InlayHintLabelPart -> InlayHintLabelPart -> Bool
/= :: InlayHintLabelPart -> InlayHintLabelPart -> Bool
Eq, Eq InlayHintLabelPart
Eq InlayHintLabelPart =>
(InlayHintLabelPart -> InlayHintLabelPart -> Ordering)
-> (InlayHintLabelPart -> InlayHintLabelPart -> Bool)
-> (InlayHintLabelPart -> InlayHintLabelPart -> Bool)
-> (InlayHintLabelPart -> InlayHintLabelPart -> Bool)
-> (InlayHintLabelPart -> InlayHintLabelPart -> Bool)
-> (InlayHintLabelPart -> InlayHintLabelPart -> InlayHintLabelPart)
-> (InlayHintLabelPart -> InlayHintLabelPart -> InlayHintLabelPart)
-> Ord InlayHintLabelPart
InlayHintLabelPart -> InlayHintLabelPart -> Bool
InlayHintLabelPart -> InlayHintLabelPart -> Ordering
InlayHintLabelPart -> InlayHintLabelPart -> InlayHintLabelPart
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
$ccompare :: InlayHintLabelPart -> InlayHintLabelPart -> Ordering
compare :: InlayHintLabelPart -> InlayHintLabelPart -> Ordering
$c< :: InlayHintLabelPart -> InlayHintLabelPart -> Bool
< :: InlayHintLabelPart -> InlayHintLabelPart -> Bool
$c<= :: InlayHintLabelPart -> InlayHintLabelPart -> Bool
<= :: InlayHintLabelPart -> InlayHintLabelPart -> Bool
$c> :: InlayHintLabelPart -> InlayHintLabelPart -> Bool
> :: InlayHintLabelPart -> InlayHintLabelPart -> Bool
$c>= :: InlayHintLabelPart -> InlayHintLabelPart -> Bool
>= :: InlayHintLabelPart -> InlayHintLabelPart -> Bool
$cmax :: InlayHintLabelPart -> InlayHintLabelPart -> InlayHintLabelPart
max :: InlayHintLabelPart -> InlayHintLabelPart -> InlayHintLabelPart
$cmin :: InlayHintLabelPart -> InlayHintLabelPart -> InlayHintLabelPart
min :: InlayHintLabelPart -> InlayHintLabelPart -> InlayHintLabelPart
Ord, (forall x. InlayHintLabelPart -> Rep InlayHintLabelPart x)
-> (forall x. Rep InlayHintLabelPart x -> InlayHintLabelPart)
-> Generic InlayHintLabelPart
forall x. Rep InlayHintLabelPart x -> InlayHintLabelPart
forall x. InlayHintLabelPart -> Rep InlayHintLabelPart x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. InlayHintLabelPart -> Rep InlayHintLabelPart x
from :: forall x. InlayHintLabelPart -> Rep InlayHintLabelPart x
$cto :: forall x. Rep InlayHintLabelPart x -> InlayHintLabelPart
to :: forall x. Rep InlayHintLabelPart x -> InlayHintLabelPart
Generic)
  deriving anyclass (InlayHintLabelPart -> ()
(InlayHintLabelPart -> ()) -> NFData InlayHintLabelPart
forall a. (a -> ()) -> NFData a
$crnf :: InlayHintLabelPart -> ()
rnf :: InlayHintLabelPart -> ()
NFData, Eq InlayHintLabelPart
Eq InlayHintLabelPart =>
(Int -> InlayHintLabelPart -> Int)
-> (InlayHintLabelPart -> Int) -> Hashable InlayHintLabelPart
Int -> InlayHintLabelPart -> Int
InlayHintLabelPart -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> InlayHintLabelPart -> Int
hashWithSalt :: Int -> InlayHintLabelPart -> Int
$chash :: InlayHintLabelPart -> Int
hash :: InlayHintLabelPart -> Int
Hashable)
  deriving (forall ann. InlayHintLabelPart -> Doc ann)
-> (forall ann. [InlayHintLabelPart] -> Doc ann)
-> Pretty InlayHintLabelPart
forall ann. [InlayHintLabelPart] -> Doc ann
forall ann. InlayHintLabelPart -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. InlayHintLabelPart -> Doc ann
pretty :: forall ann. InlayHintLabelPart -> Doc ann
$cprettyList :: forall ann. [InlayHintLabelPart] -> Doc ann
prettyList :: forall ann. [InlayHintLabelPart] -> Doc ann
Pretty via (ViaJSON InlayHintLabelPart)

instance Aeson.ToJSON InlayHintLabelPart where
  toJSON :: InlayHintLabelPart -> Value
toJSON (InlayHintLabelPart Text
arg0 Maybe (Text |? MarkupContent)
arg1 Maybe Location
arg2 Maybe Command
arg3) = [Pair] -> Value
Aeson.object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$ [[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[Pair]] -> [Pair]) -> [[Pair]] -> [Pair]
forall a b. (a -> b) -> a -> b
$  [[Key
"value" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= Text
arg0]
    ,String
"tooltip" String -> Maybe (Text |? MarkupContent) -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe (Text |? MarkupContent)
arg1
    ,String
"location" String -> Maybe Location -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Location
arg2
    ,String
"command" String -> Maybe Command -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Command
arg3]

instance Aeson.FromJSON InlayHintLabelPart where
  parseJSON :: Value -> Parser InlayHintLabelPart
parseJSON = String
-> (Object -> Parser InlayHintLabelPart)
-> Value
-> Parser InlayHintLabelPart
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"InlayHintLabelPart" ((Object -> Parser InlayHintLabelPart)
 -> Value -> Parser InlayHintLabelPart)
-> (Object -> Parser InlayHintLabelPart)
-> Value
-> Parser InlayHintLabelPart
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Text
-> Maybe (Text |? MarkupContent)
-> Maybe Location
-> Maybe Command
-> InlayHintLabelPart
InlayHintLabelPart (Text
 -> Maybe (Text |? MarkupContent)
 -> Maybe Location
 -> Maybe Command
 -> InlayHintLabelPart)
-> Parser Text
-> Parser
     (Maybe (Text |? MarkupContent)
      -> Maybe Location -> Maybe Command -> InlayHintLabelPart)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"value" Parser
  (Maybe (Text |? MarkupContent)
   -> Maybe Location -> Maybe Command -> InlayHintLabelPart)
-> Parser (Maybe (Text |? MarkupContent))
-> Parser (Maybe Location -> Maybe Command -> InlayHintLabelPart)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe (Text |? MarkupContent))
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"tooltip" Parser (Maybe Location -> Maybe Command -> InlayHintLabelPart)
-> Parser (Maybe Location)
-> Parser (Maybe Command -> InlayHintLabelPart)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe Location)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"location" Parser (Maybe Command -> InlayHintLabelPart)
-> Parser (Maybe Command) -> Parser InlayHintLabelPart
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe Command)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"command"