{- 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.CompletionRegistrationOptions 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 as Row
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.DocumentSelector
import qualified Language.LSP.Protocol.Types.Common

{-|
Registration options for a `CompletionRequest`.
-}
data CompletionRegistrationOptions = CompletionRegistrationOptions 
  { {-|
  A document selector to identify the scope of the registration. If set to null
  the document selector provided on the client side will be used.
  -}
  CompletionRegistrationOptions -> DocumentSelector |? Null
_documentSelector :: (Language.LSP.Protocol.Internal.Types.DocumentSelector.DocumentSelector Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Types.Common.Null)
  , {-|

  -}
  CompletionRegistrationOptions -> Maybe Bool
_workDoneProgress :: (Maybe Bool)
  , {-|
  Most tools trigger completion request automatically without explicitly requesting
  it using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user
  starts to type an identifier. For example if the user types `c` in a JavaScript file
  code complete will automatically pop up present `console` besides others as a
  completion item. Characters that make up identifiers don't need to be listed here.

  If code complete should automatically be trigger on characters not being valid inside
  an identifier (for example `.` in JavaScript) list them in `triggerCharacters`.
  -}
  CompletionRegistrationOptions -> Maybe [Text]
_triggerCharacters :: (Maybe [Data.Text.Text])
  , {-|
  The list of all possible characters that commit a completion. This field can be used
  if clients don't support individual commit characters per completion item. See
  `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport`

  If a server provides both `allCommitCharacters` and commit characters on an individual
  completion item the ones on the completion item win.

  @since 3.2.0
  -}
  CompletionRegistrationOptions -> Maybe [Text]
_allCommitCharacters :: (Maybe [Data.Text.Text])
  , {-|
  The server provides support to resolve additional
  information for a completion item.
  -}
  CompletionRegistrationOptions -> Maybe Bool
_resolveProvider :: (Maybe Bool)
  , {-|
  The server supports the following `CompletionItem` specific
  capabilities.

  @since 3.17.0
  -}
  CompletionRegistrationOptions
-> Maybe
     (Rec
        (Extend "labelDetailsSupport" (Maybe Bool) ('R '[]) .+ 'R '[]))
_completionItem :: (Maybe (Row.Rec ("labelDetailsSupport" Row..== (Maybe Bool) Row..+ Row.Empty)))
  }
  deriving stock (Int -> CompletionRegistrationOptions -> ShowS
[CompletionRegistrationOptions] -> ShowS
CompletionRegistrationOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CompletionRegistrationOptions] -> ShowS
$cshowList :: [CompletionRegistrationOptions] -> ShowS
show :: CompletionRegistrationOptions -> String
$cshow :: CompletionRegistrationOptions -> String
showsPrec :: Int -> CompletionRegistrationOptions -> ShowS
$cshowsPrec :: Int -> CompletionRegistrationOptions -> ShowS
Show, CompletionRegistrationOptions
-> CompletionRegistrationOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CompletionRegistrationOptions
-> CompletionRegistrationOptions -> Bool
$c/= :: CompletionRegistrationOptions
-> CompletionRegistrationOptions -> Bool
== :: CompletionRegistrationOptions
-> CompletionRegistrationOptions -> Bool
$c== :: CompletionRegistrationOptions
-> CompletionRegistrationOptions -> Bool
Eq, Eq CompletionRegistrationOptions
CompletionRegistrationOptions
-> CompletionRegistrationOptions -> Bool
CompletionRegistrationOptions
-> CompletionRegistrationOptions -> Ordering
CompletionRegistrationOptions
-> CompletionRegistrationOptions -> CompletionRegistrationOptions
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 :: CompletionRegistrationOptions
-> CompletionRegistrationOptions -> CompletionRegistrationOptions
$cmin :: CompletionRegistrationOptions
-> CompletionRegistrationOptions -> CompletionRegistrationOptions
max :: CompletionRegistrationOptions
-> CompletionRegistrationOptions -> CompletionRegistrationOptions
$cmax :: CompletionRegistrationOptions
-> CompletionRegistrationOptions -> CompletionRegistrationOptions
>= :: CompletionRegistrationOptions
-> CompletionRegistrationOptions -> Bool
$c>= :: CompletionRegistrationOptions
-> CompletionRegistrationOptions -> Bool
> :: CompletionRegistrationOptions
-> CompletionRegistrationOptions -> Bool
$c> :: CompletionRegistrationOptions
-> CompletionRegistrationOptions -> Bool
<= :: CompletionRegistrationOptions
-> CompletionRegistrationOptions -> Bool
$c<= :: CompletionRegistrationOptions
-> CompletionRegistrationOptions -> Bool
< :: CompletionRegistrationOptions
-> CompletionRegistrationOptions -> Bool
$c< :: CompletionRegistrationOptions
-> CompletionRegistrationOptions -> Bool
compare :: CompletionRegistrationOptions
-> CompletionRegistrationOptions -> Ordering
$ccompare :: CompletionRegistrationOptions
-> CompletionRegistrationOptions -> Ordering
Ord, forall x.
Rep CompletionRegistrationOptions x
-> CompletionRegistrationOptions
forall x.
CompletionRegistrationOptions
-> Rep CompletionRegistrationOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CompletionRegistrationOptions x
-> CompletionRegistrationOptions
$cfrom :: forall x.
CompletionRegistrationOptions
-> Rep CompletionRegistrationOptions x
Generic)
  deriving anyclass (CompletionRegistrationOptions -> ()
forall a. (a -> ()) -> NFData a
rnf :: CompletionRegistrationOptions -> ()
$crnf :: CompletionRegistrationOptions -> ()
NFData, Eq CompletionRegistrationOptions
Int -> CompletionRegistrationOptions -> Int
CompletionRegistrationOptions -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: CompletionRegistrationOptions -> Int
$chash :: CompletionRegistrationOptions -> Int
hashWithSalt :: Int -> CompletionRegistrationOptions -> Int
$chashWithSalt :: Int -> CompletionRegistrationOptions -> Int
Hashable)
  deriving forall ann. [CompletionRegistrationOptions] -> Doc ann
forall ann. CompletionRegistrationOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [CompletionRegistrationOptions] -> Doc ann
$cprettyList :: forall ann. [CompletionRegistrationOptions] -> Doc ann
pretty :: forall ann. CompletionRegistrationOptions -> Doc ann
$cpretty :: forall ann. CompletionRegistrationOptions -> Doc ann
Pretty via (ViaJSON CompletionRegistrationOptions)

instance Aeson.ToJSON CompletionRegistrationOptions where
  toJSON :: CompletionRegistrationOptions -> Value
toJSON (CompletionRegistrationOptions DocumentSelector |? Null
arg0 Maybe Bool
arg1 Maybe [Text]
arg2 Maybe [Text]
arg3 Maybe Bool
arg4 Maybe
  (Rec
     (Extend "labelDetailsSupport" (Maybe Bool) ('R '[]) .+ 'R '[]))
arg5) = [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
"documentSelector" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= DocumentSelector |? Null
arg0]
    ,String
"workDoneProgress" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg1
    ,String
"triggerCharacters" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe [Text]
arg2
    ,String
"allCommitCharacters" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe [Text]
arg3
    ,String
"resolveProvider" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg4
    ,String
"completionItem" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe
  (Rec
     (Extend "labelDetailsSupport" (Maybe Bool) ('R '[]) .+ 'R '[]))
arg5]

instance Aeson.FromJSON CompletionRegistrationOptions where
  parseJSON :: Value -> Parser CompletionRegistrationOptions
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"CompletionRegistrationOptions" forall a b. (a -> b) -> a -> b
$ \Object
arg -> (DocumentSelector |? Null)
-> Maybe Bool
-> Maybe [Text]
-> Maybe [Text]
-> Maybe Bool
-> Maybe
     (Rec
        (Extend "labelDetailsSupport" (Maybe Bool) ('R '[]) .+ 'R '[]))
-> CompletionRegistrationOptions
CompletionRegistrationOptions forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"documentSelector" 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
"workDoneProgress" 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
"triggerCharacters" 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
"allCommitCharacters" 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
"resolveProvider" 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
"completionItem"