{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-unused-matches #-}
{-# OPTIONS_GHC -Wno-deprecations #-}
module Language.LSP.Protocol.Internal.Types.FoldingRange 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.Internal.Types.FoldingRangeKind
import qualified Language.LSP.Protocol.Types.Common
data FoldingRange = FoldingRange
{
FoldingRange -> UInt
_startLine :: Language.LSP.Protocol.Types.Common.UInt
,
FoldingRange -> Maybe UInt
_startCharacter :: (Maybe Language.LSP.Protocol.Types.Common.UInt)
,
FoldingRange -> UInt
_endLine :: Language.LSP.Protocol.Types.Common.UInt
,
FoldingRange -> Maybe UInt
_endCharacter :: (Maybe Language.LSP.Protocol.Types.Common.UInt)
,
FoldingRange -> Maybe FoldingRangeKind
_kind :: (Maybe Language.LSP.Protocol.Internal.Types.FoldingRangeKind.FoldingRangeKind)
,
FoldingRange -> Maybe Text
_collapsedText :: (Maybe Data.Text.Text)
}
deriving stock (Int -> FoldingRange -> ShowS
[FoldingRange] -> ShowS
FoldingRange -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FoldingRange] -> ShowS
$cshowList :: [FoldingRange] -> ShowS
show :: FoldingRange -> String
$cshow :: FoldingRange -> String
showsPrec :: Int -> FoldingRange -> ShowS
$cshowsPrec :: Int -> FoldingRange -> ShowS
Show, FoldingRange -> FoldingRange -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FoldingRange -> FoldingRange -> Bool
$c/= :: FoldingRange -> FoldingRange -> Bool
== :: FoldingRange -> FoldingRange -> Bool
$c== :: FoldingRange -> FoldingRange -> Bool
Eq, Eq FoldingRange
FoldingRange -> FoldingRange -> Bool
FoldingRange -> FoldingRange -> Ordering
FoldingRange -> FoldingRange -> FoldingRange
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 :: FoldingRange -> FoldingRange -> FoldingRange
$cmin :: FoldingRange -> FoldingRange -> FoldingRange
max :: FoldingRange -> FoldingRange -> FoldingRange
$cmax :: FoldingRange -> FoldingRange -> FoldingRange
>= :: FoldingRange -> FoldingRange -> Bool
$c>= :: FoldingRange -> FoldingRange -> Bool
> :: FoldingRange -> FoldingRange -> Bool
$c> :: FoldingRange -> FoldingRange -> Bool
<= :: FoldingRange -> FoldingRange -> Bool
$c<= :: FoldingRange -> FoldingRange -> Bool
< :: FoldingRange -> FoldingRange -> Bool
$c< :: FoldingRange -> FoldingRange -> Bool
compare :: FoldingRange -> FoldingRange -> Ordering
$ccompare :: FoldingRange -> FoldingRange -> Ordering
Ord, forall x. Rep FoldingRange x -> FoldingRange
forall x. FoldingRange -> Rep FoldingRange x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FoldingRange x -> FoldingRange
$cfrom :: forall x. FoldingRange -> Rep FoldingRange x
Generic)
deriving anyclass (FoldingRange -> ()
forall a. (a -> ()) -> NFData a
rnf :: FoldingRange -> ()
$crnf :: FoldingRange -> ()
NFData, Eq FoldingRange
Int -> FoldingRange -> Int
FoldingRange -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: FoldingRange -> Int
$chash :: FoldingRange -> Int
hashWithSalt :: Int -> FoldingRange -> Int
$chashWithSalt :: Int -> FoldingRange -> Int
Hashable)
deriving forall ann. [FoldingRange] -> Doc ann
forall ann. FoldingRange -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [FoldingRange] -> Doc ann
$cprettyList :: forall ann. [FoldingRange] -> Doc ann
pretty :: forall ann. FoldingRange -> Doc ann
$cpretty :: forall ann. FoldingRange -> Doc ann
Pretty via (ViaJSON FoldingRange)
instance Aeson.ToJSON FoldingRange where
toJSON :: FoldingRange -> Value
toJSON (FoldingRange UInt
arg0 Maybe UInt
arg1 UInt
arg2 Maybe UInt
arg3 Maybe FoldingRangeKind
arg4 Maybe Text
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
"startLine" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= UInt
arg0]
,String
"startCharacter" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe UInt
arg1
,[Key
"endLine" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= UInt
arg2]
,String
"endCharacter" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe UInt
arg3
,String
"kind" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe FoldingRangeKind
arg4
,String
"collapsedText" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg5]
instance Aeson.FromJSON FoldingRange where
parseJSON :: Value -> Parser FoldingRange
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"FoldingRange" forall a b. (a -> b) -> a -> b
$ \Object
arg -> UInt
-> Maybe UInt
-> UInt
-> Maybe UInt
-> Maybe FoldingRangeKind
-> Maybe Text
-> FoldingRange
FoldingRange forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"startLine" 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
"startCharacter" 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
"endLine" 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
"endCharacter" 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
"kind" 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
"collapsedText"