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

{-|
Additional details for a completion item label.

@since 3.17.0
-}
data CompletionItemLabelDetails = CompletionItemLabelDetails 
  { {-|
  An optional string which is rendered less prominently directly after `CompletionItem.label`,
  without any spacing. Should be used for function signatures and type annotations.
  -}
  CompletionItemLabelDetails -> Maybe Text
_detail :: (Maybe Data.Text.Text)
  , {-|
  An optional string which is rendered less prominently after `CompletionItem.detail`. Should be used
  for fully qualified names and file paths.
  -}
  CompletionItemLabelDetails -> Maybe Text
_description :: (Maybe Data.Text.Text)
  }
  deriving stock (Int -> CompletionItemLabelDetails -> ShowS
[CompletionItemLabelDetails] -> ShowS
CompletionItemLabelDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CompletionItemLabelDetails] -> ShowS
$cshowList :: [CompletionItemLabelDetails] -> ShowS
show :: CompletionItemLabelDetails -> String
$cshow :: CompletionItemLabelDetails -> String
showsPrec :: Int -> CompletionItemLabelDetails -> ShowS
$cshowsPrec :: Int -> CompletionItemLabelDetails -> ShowS
Show, CompletionItemLabelDetails -> CompletionItemLabelDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CompletionItemLabelDetails -> CompletionItemLabelDetails -> Bool
$c/= :: CompletionItemLabelDetails -> CompletionItemLabelDetails -> Bool
== :: CompletionItemLabelDetails -> CompletionItemLabelDetails -> Bool
$c== :: CompletionItemLabelDetails -> CompletionItemLabelDetails -> Bool
Eq, Eq CompletionItemLabelDetails
CompletionItemLabelDetails -> CompletionItemLabelDetails -> Bool
CompletionItemLabelDetails
-> CompletionItemLabelDetails -> Ordering
CompletionItemLabelDetails
-> CompletionItemLabelDetails -> CompletionItemLabelDetails
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 :: CompletionItemLabelDetails
-> CompletionItemLabelDetails -> CompletionItemLabelDetails
$cmin :: CompletionItemLabelDetails
-> CompletionItemLabelDetails -> CompletionItemLabelDetails
max :: CompletionItemLabelDetails
-> CompletionItemLabelDetails -> CompletionItemLabelDetails
$cmax :: CompletionItemLabelDetails
-> CompletionItemLabelDetails -> CompletionItemLabelDetails
>= :: CompletionItemLabelDetails -> CompletionItemLabelDetails -> Bool
$c>= :: CompletionItemLabelDetails -> CompletionItemLabelDetails -> Bool
> :: CompletionItemLabelDetails -> CompletionItemLabelDetails -> Bool
$c> :: CompletionItemLabelDetails -> CompletionItemLabelDetails -> Bool
<= :: CompletionItemLabelDetails -> CompletionItemLabelDetails -> Bool
$c<= :: CompletionItemLabelDetails -> CompletionItemLabelDetails -> Bool
< :: CompletionItemLabelDetails -> CompletionItemLabelDetails -> Bool
$c< :: CompletionItemLabelDetails -> CompletionItemLabelDetails -> Bool
compare :: CompletionItemLabelDetails
-> CompletionItemLabelDetails -> Ordering
$ccompare :: CompletionItemLabelDetails
-> CompletionItemLabelDetails -> Ordering
Ord, forall x.
Rep CompletionItemLabelDetails x -> CompletionItemLabelDetails
forall x.
CompletionItemLabelDetails -> Rep CompletionItemLabelDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CompletionItemLabelDetails x -> CompletionItemLabelDetails
$cfrom :: forall x.
CompletionItemLabelDetails -> Rep CompletionItemLabelDetails x
Generic)
  deriving anyclass (CompletionItemLabelDetails -> ()
forall a. (a -> ()) -> NFData a
rnf :: CompletionItemLabelDetails -> ()
$crnf :: CompletionItemLabelDetails -> ()
NFData, Eq CompletionItemLabelDetails
Int -> CompletionItemLabelDetails -> Int
CompletionItemLabelDetails -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: CompletionItemLabelDetails -> Int
$chash :: CompletionItemLabelDetails -> Int
hashWithSalt :: Int -> CompletionItemLabelDetails -> Int
$chashWithSalt :: Int -> CompletionItemLabelDetails -> Int
Hashable)
  deriving forall ann. [CompletionItemLabelDetails] -> Doc ann
forall ann. CompletionItemLabelDetails -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [CompletionItemLabelDetails] -> Doc ann
$cprettyList :: forall ann. [CompletionItemLabelDetails] -> Doc ann
pretty :: forall ann. CompletionItemLabelDetails -> Doc ann
$cpretty :: forall ann. CompletionItemLabelDetails -> Doc ann
Pretty via (ViaJSON CompletionItemLabelDetails)

instance Aeson.ToJSON CompletionItemLabelDetails where
  toJSON :: CompletionItemLabelDetails -> Value
toJSON (CompletionItemLabelDetails Maybe Text
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
$  [String
"detail" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg0
    ,String
"description" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg1]

instance Aeson.FromJSON CompletionItemLabelDetails where
  parseJSON :: Value -> Parser CompletionItemLabelDetails
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"CompletionItemLabelDetails" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Text -> Maybe Text -> CompletionItemLabelDetails
CompletionItemLabelDetails forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"detail" 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
"description"