{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-unused-matches #-}
{-# OPTIONS_GHC -Wno-deprecations #-}
module Language.LSP.Protocol.Internal.Types.DocumentRangeFormattingParams 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 Language.LSP.Protocol.Internal.Types.FormattingOptions
import qualified Language.LSP.Protocol.Internal.Types.ProgressToken
import qualified Language.LSP.Protocol.Internal.Types.Range
import qualified Language.LSP.Protocol.Internal.Types.TextDocumentIdentifier
import qualified Language.LSP.Protocol.Types.Common
data DocumentRangeFormattingParams = DocumentRangeFormattingParams
{
DocumentRangeFormattingParams -> Maybe ProgressToken
_workDoneToken :: (Maybe Language.LSP.Protocol.Internal.Types.ProgressToken.ProgressToken)
,
DocumentRangeFormattingParams -> TextDocumentIdentifier
_textDocument :: Language.LSP.Protocol.Internal.Types.TextDocumentIdentifier.TextDocumentIdentifier
,
DocumentRangeFormattingParams -> Range
_range :: Language.LSP.Protocol.Internal.Types.Range.Range
,
DocumentRangeFormattingParams -> FormattingOptions
_options :: Language.LSP.Protocol.Internal.Types.FormattingOptions.FormattingOptions
}
deriving stock (Int -> DocumentRangeFormattingParams -> ShowS
[DocumentRangeFormattingParams] -> ShowS
DocumentRangeFormattingParams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocumentRangeFormattingParams] -> ShowS
$cshowList :: [DocumentRangeFormattingParams] -> ShowS
show :: DocumentRangeFormattingParams -> String
$cshow :: DocumentRangeFormattingParams -> String
showsPrec :: Int -> DocumentRangeFormattingParams -> ShowS
$cshowsPrec :: Int -> DocumentRangeFormattingParams -> ShowS
Show, DocumentRangeFormattingParams
-> DocumentRangeFormattingParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocumentRangeFormattingParams
-> DocumentRangeFormattingParams -> Bool
$c/= :: DocumentRangeFormattingParams
-> DocumentRangeFormattingParams -> Bool
== :: DocumentRangeFormattingParams
-> DocumentRangeFormattingParams -> Bool
$c== :: DocumentRangeFormattingParams
-> DocumentRangeFormattingParams -> Bool
Eq, Eq DocumentRangeFormattingParams
DocumentRangeFormattingParams
-> DocumentRangeFormattingParams -> Bool
DocumentRangeFormattingParams
-> DocumentRangeFormattingParams -> Ordering
DocumentRangeFormattingParams
-> DocumentRangeFormattingParams -> DocumentRangeFormattingParams
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 :: DocumentRangeFormattingParams
-> DocumentRangeFormattingParams -> DocumentRangeFormattingParams
$cmin :: DocumentRangeFormattingParams
-> DocumentRangeFormattingParams -> DocumentRangeFormattingParams
max :: DocumentRangeFormattingParams
-> DocumentRangeFormattingParams -> DocumentRangeFormattingParams
$cmax :: DocumentRangeFormattingParams
-> DocumentRangeFormattingParams -> DocumentRangeFormattingParams
>= :: DocumentRangeFormattingParams
-> DocumentRangeFormattingParams -> Bool
$c>= :: DocumentRangeFormattingParams
-> DocumentRangeFormattingParams -> Bool
> :: DocumentRangeFormattingParams
-> DocumentRangeFormattingParams -> Bool
$c> :: DocumentRangeFormattingParams
-> DocumentRangeFormattingParams -> Bool
<= :: DocumentRangeFormattingParams
-> DocumentRangeFormattingParams -> Bool
$c<= :: DocumentRangeFormattingParams
-> DocumentRangeFormattingParams -> Bool
< :: DocumentRangeFormattingParams
-> DocumentRangeFormattingParams -> Bool
$c< :: DocumentRangeFormattingParams
-> DocumentRangeFormattingParams -> Bool
compare :: DocumentRangeFormattingParams
-> DocumentRangeFormattingParams -> Ordering
$ccompare :: DocumentRangeFormattingParams
-> DocumentRangeFormattingParams -> Ordering
Ord, forall x.
Rep DocumentRangeFormattingParams x
-> DocumentRangeFormattingParams
forall x.
DocumentRangeFormattingParams
-> Rep DocumentRangeFormattingParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DocumentRangeFormattingParams x
-> DocumentRangeFormattingParams
$cfrom :: forall x.
DocumentRangeFormattingParams
-> Rep DocumentRangeFormattingParams x
Generic)
deriving anyclass (DocumentRangeFormattingParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: DocumentRangeFormattingParams -> ()
$crnf :: DocumentRangeFormattingParams -> ()
NFData, Eq DocumentRangeFormattingParams
Int -> DocumentRangeFormattingParams -> Int
DocumentRangeFormattingParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: DocumentRangeFormattingParams -> Int
$chash :: DocumentRangeFormattingParams -> Int
hashWithSalt :: Int -> DocumentRangeFormattingParams -> Int
$chashWithSalt :: Int -> DocumentRangeFormattingParams -> Int
Hashable)
deriving forall ann. [DocumentRangeFormattingParams] -> Doc ann
forall ann. DocumentRangeFormattingParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [DocumentRangeFormattingParams] -> Doc ann
$cprettyList :: forall ann. [DocumentRangeFormattingParams] -> Doc ann
pretty :: forall ann. DocumentRangeFormattingParams -> Doc ann
$cpretty :: forall ann. DocumentRangeFormattingParams -> Doc ann
Pretty via (ViaJSON DocumentRangeFormattingParams)
instance Aeson.ToJSON DocumentRangeFormattingParams where
toJSON :: DocumentRangeFormattingParams -> Value
toJSON (DocumentRangeFormattingParams Maybe ProgressToken
arg0 TextDocumentIdentifier
arg1 Range
arg2 FormattingOptions
arg3) = [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
"workDoneToken" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe ProgressToken
arg0
,[Key
"textDocument" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= TextDocumentIdentifier
arg1]
,[Key
"range" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Range
arg2]
,[Key
"options" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= FormattingOptions
arg3]]
instance Aeson.FromJSON DocumentRangeFormattingParams where
parseJSON :: Value -> Parser DocumentRangeFormattingParams
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"DocumentRangeFormattingParams" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe ProgressToken
-> TextDocumentIdentifier
-> Range
-> FormattingOptions
-> DocumentRangeFormattingParams
DocumentRangeFormattingParams 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
"workDoneToken" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"textDocument" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"range" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"options"