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

{-|
Completion options.
-}
data CompletionOptions = CompletionOptions 
  { {-|

  -}
  CompletionOptions -> 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`.
  -}
  CompletionOptions -> 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
  -}
  CompletionOptions -> Maybe [Text]
_allCommitCharacters :: (Maybe [Data.Text.Text])
  , {-|
  The server provides support to resolve additional
  information for a completion item.
  -}
  CompletionOptions -> Maybe Bool
_resolveProvider :: (Maybe Bool)
  , {-|
  The server supports the following `CompletionItem` specific
  capabilities.

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

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

instance Aeson.FromJSON CompletionOptions where
  parseJSON :: Value -> Parser CompletionOptions
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"CompletionOptions" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Bool
-> Maybe [Text]
-> Maybe [Text]
-> Maybe Bool
-> Maybe
     (Rec
        (Extend "labelDetailsSupport" (Maybe Bool) ('R '[]) .+ 'R '[]))
-> CompletionOptions
CompletionOptions 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
"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"