{- 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.CompletionClientCapabilities 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.CompletionItemKind
import qualified Language.LSP.Protocol.Internal.Types.CompletionItemTag
import qualified Language.LSP.Protocol.Internal.Types.InsertTextMode
import qualified Language.LSP.Protocol.Internal.Types.MarkupKind
import qualified Language.LSP.Protocol.Types.Common

{-|
Completion client capabilities
-}
data CompletionClientCapabilities = CompletionClientCapabilities 
  { {-|
  Whether completion supports dynamic registration.
  -}
  CompletionClientCapabilities -> Maybe Bool
_dynamicRegistration :: (Maybe Bool)
  , {-|
  The client supports the following `CompletionItem` specific
  capabilities.
  -}
  CompletionClientCapabilities
-> Maybe
     (Rec
        (("snippetSupport" .== Maybe Bool)
         .+ (("commitCharactersSupport" .== Maybe Bool)
             .+ (("documentationFormat" .== Maybe [MarkupKind])
                 .+ (("deprecatedSupport" .== Maybe Bool)
                     .+ (("preselectSupport" .== Maybe Bool)
                         .+ (("tagSupport"
                              .== Maybe
                                    (Rec
                                       (Extend "valueSet" [CompletionItemTag] ('R '[]) .+ 'R '[])))
                             .+ (("insertReplaceSupport" .== Maybe Bool)
                                 .+ (("resolveSupport"
                                      .== Maybe
                                            (Rec (Extend "properties" [Text] ('R '[]) .+ 'R '[])))
                                     .+ (("insertTextModeSupport"
                                          .== Maybe
                                                (Rec
                                                   (Extend "valueSet" [InsertTextMode] ('R '[])
                                                    .+ 'R '[])))
                                         .+ (("labelDetailsSupport" .== Maybe Bool)
                                             .+ 'R '[])))))))))))
_completionItem :: (Maybe (Row.Rec ("snippetSupport" Row..== (Maybe Bool) Row..+ ("commitCharactersSupport" Row..== (Maybe Bool) Row..+ ("documentationFormat" Row..== (Maybe [Language.LSP.Protocol.Internal.Types.MarkupKind.MarkupKind]) Row..+ ("deprecatedSupport" Row..== (Maybe Bool) Row..+ ("preselectSupport" Row..== (Maybe Bool) Row..+ ("tagSupport" Row..== (Maybe (Row.Rec ("valueSet" Row..== [Language.LSP.Protocol.Internal.Types.CompletionItemTag.CompletionItemTag] Row..+ Row.Empty))) Row..+ ("insertReplaceSupport" Row..== (Maybe Bool) Row..+ ("resolveSupport" Row..== (Maybe (Row.Rec ("properties" Row..== [Data.Text.Text] Row..+ Row.Empty))) Row..+ ("insertTextModeSupport" Row..== (Maybe (Row.Rec ("valueSet" Row..== [Language.LSP.Protocol.Internal.Types.InsertTextMode.InsertTextMode] Row..+ Row.Empty))) Row..+ ("labelDetailsSupport" Row..== (Maybe Bool) Row..+ Row.Empty))))))))))))
  , {-|

  -}
  CompletionClientCapabilities
-> Maybe
     (Rec
        (Extend "valueSet" (Maybe [CompletionItemKind]) ('R '[])
         .+ 'R '[]))
_completionItemKind :: (Maybe (Row.Rec ("valueSet" Row..== (Maybe [Language.LSP.Protocol.Internal.Types.CompletionItemKind.CompletionItemKind]) Row..+ Row.Empty)))
  , {-|
  Defines how the client handles whitespace and indentation
  when accepting a completion item that uses multi line
  text in either `insertText` or `textEdit`.

  @since 3.17.0
  -}
  CompletionClientCapabilities -> Maybe InsertTextMode
_insertTextMode :: (Maybe Language.LSP.Protocol.Internal.Types.InsertTextMode.InsertTextMode)
  , {-|
  The client supports to send additional context information for a
  `textDocument/completion` request.
  -}
  CompletionClientCapabilities -> Maybe Bool
_contextSupport :: (Maybe Bool)
  , {-|
  The client supports the following `CompletionList` specific
  capabilities.

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

instance Aeson.ToJSON CompletionClientCapabilities where
  toJSON :: CompletionClientCapabilities -> Value
toJSON (CompletionClientCapabilities Maybe Bool
arg0 Maybe
  (Rec
     (("snippetSupport" .== Maybe Bool)
      .+ (("commitCharactersSupport" .== Maybe Bool)
          .+ (("documentationFormat" .== Maybe [MarkupKind])
              .+ (("deprecatedSupport" .== Maybe Bool)
                  .+ (("preselectSupport" .== Maybe Bool)
                      .+ (("tagSupport"
                           .== Maybe
                                 (Rec (Extend "valueSet" [CompletionItemTag] ('R '[]) .+ 'R '[])))
                          .+ (("insertReplaceSupport" .== Maybe Bool)
                              .+ (("resolveSupport"
                                   .== Maybe (Rec (Extend "properties" [Text] ('R '[]) .+ 'R '[])))
                                  .+ (("insertTextModeSupport"
                                       .== Maybe
                                             (Rec
                                                (Extend "valueSet" [InsertTextMode] ('R '[])
                                                 .+ 'R '[])))
                                      .+ (("labelDetailsSupport" .== Maybe Bool)
                                          .+ 'R '[])))))))))))
arg1 Maybe
  (Rec
     (Extend "valueSet" (Maybe [CompletionItemKind]) ('R '[])
      .+ 'R '[]))
arg2 Maybe InsertTextMode
arg3 Maybe Bool
arg4 Maybe
  (Rec (Extend "itemDefaults" (Maybe [Text]) ('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
$  [String
"dynamicRegistration" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg0
    ,String
"completionItem" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe
  (Rec
     (("snippetSupport" .== Maybe Bool)
      .+ (("commitCharactersSupport" .== Maybe Bool)
          .+ (("documentationFormat" .== Maybe [MarkupKind])
              .+ (("deprecatedSupport" .== Maybe Bool)
                  .+ (("preselectSupport" .== Maybe Bool)
                      .+ (("tagSupport"
                           .== Maybe
                                 (Rec (Extend "valueSet" [CompletionItemTag] ('R '[]) .+ 'R '[])))
                          .+ (("insertReplaceSupport" .== Maybe Bool)
                              .+ (("resolveSupport"
                                   .== Maybe (Rec (Extend "properties" [Text] ('R '[]) .+ 'R '[])))
                                  .+ (("insertTextModeSupport"
                                       .== Maybe
                                             (Rec
                                                (Extend "valueSet" [InsertTextMode] ('R '[])
                                                 .+ 'R '[])))
                                      .+ (("labelDetailsSupport" .== Maybe Bool)
                                          .+ 'R '[])))))))))))
arg1
    ,String
"completionItemKind" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe
  (Rec
     (Extend "valueSet" (Maybe [CompletionItemKind]) ('R '[])
      .+ 'R '[]))
arg2
    ,String
"insertTextMode" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe InsertTextMode
arg3
    ,String
"contextSupport" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg4
    ,String
"completionList" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe
  (Rec (Extend "itemDefaults" (Maybe [Text]) ('R '[]) .+ 'R '[]))
arg5]

instance Aeson.FromJSON CompletionClientCapabilities where
  parseJSON :: Value -> Parser CompletionClientCapabilities
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"CompletionClientCapabilities" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Bool
-> Maybe
     (Rec
        (("snippetSupport" .== Maybe Bool)
         .+ (("commitCharactersSupport" .== Maybe Bool)
             .+ (("documentationFormat" .== Maybe [MarkupKind])
                 .+ (("deprecatedSupport" .== Maybe Bool)
                     .+ (("preselectSupport" .== Maybe Bool)
                         .+ (("tagSupport"
                              .== Maybe
                                    (Rec
                                       (Extend "valueSet" [CompletionItemTag] ('R '[]) .+ 'R '[])))
                             .+ (("insertReplaceSupport" .== Maybe Bool)
                                 .+ (("resolveSupport"
                                      .== Maybe
                                            (Rec (Extend "properties" [Text] ('R '[]) .+ 'R '[])))
                                     .+ (("insertTextModeSupport"
                                          .== Maybe
                                                (Rec
                                                   (Extend "valueSet" [InsertTextMode] ('R '[])
                                                    .+ 'R '[])))
                                         .+ (("labelDetailsSupport" .== Maybe Bool)
                                             .+ 'R '[])))))))))))
-> Maybe
     (Rec
        (Extend "valueSet" (Maybe [CompletionItemKind]) ('R '[])
         .+ 'R '[]))
-> Maybe InsertTextMode
-> Maybe Bool
-> Maybe
     (Rec (Extend "itemDefaults" (Maybe [Text]) ('R '[]) .+ 'R '[]))
-> CompletionClientCapabilities
CompletionClientCapabilities 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
"dynamicRegistration" 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" 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
"completionItemKind" 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
"insertTextMode" 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
"contextSupport" 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
"completionList"