{- 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.TextDocumentItem 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.Types.Common
import qualified Language.LSP.Protocol.Types.Uri

{-|
An item to transfer a text document from the client to the
server.
-}
data TextDocumentItem = TextDocumentItem 
  { {-|
  The text document's uri.
  -}
  TextDocumentItem -> Uri
_uri :: Language.LSP.Protocol.Types.Uri.Uri
  , {-|
  The text document's language identifier.
  -}
  TextDocumentItem -> Text
_languageId :: Data.Text.Text
  , {-|
  The version number of this document (it will increase after each
  change, including undo/redo).
  -}
  TextDocumentItem -> Int32
_version :: Language.LSP.Protocol.Types.Common.Int32
  , {-|
  The content of the opened text document.
  -}
  TextDocumentItem -> Text
_text :: Data.Text.Text
  }
  deriving stock (Int -> TextDocumentItem -> ShowS
[TextDocumentItem] -> ShowS
TextDocumentItem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TextDocumentItem] -> ShowS
$cshowList :: [TextDocumentItem] -> ShowS
show :: TextDocumentItem -> String
$cshow :: TextDocumentItem -> String
showsPrec :: Int -> TextDocumentItem -> ShowS
$cshowsPrec :: Int -> TextDocumentItem -> ShowS
Show, TextDocumentItem -> TextDocumentItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TextDocumentItem -> TextDocumentItem -> Bool
$c/= :: TextDocumentItem -> TextDocumentItem -> Bool
== :: TextDocumentItem -> TextDocumentItem -> Bool
$c== :: TextDocumentItem -> TextDocumentItem -> Bool
Eq, Eq TextDocumentItem
TextDocumentItem -> TextDocumentItem -> Bool
TextDocumentItem -> TextDocumentItem -> Ordering
TextDocumentItem -> TextDocumentItem -> TextDocumentItem
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 :: TextDocumentItem -> TextDocumentItem -> TextDocumentItem
$cmin :: TextDocumentItem -> TextDocumentItem -> TextDocumentItem
max :: TextDocumentItem -> TextDocumentItem -> TextDocumentItem
$cmax :: TextDocumentItem -> TextDocumentItem -> TextDocumentItem
>= :: TextDocumentItem -> TextDocumentItem -> Bool
$c>= :: TextDocumentItem -> TextDocumentItem -> Bool
> :: TextDocumentItem -> TextDocumentItem -> Bool
$c> :: TextDocumentItem -> TextDocumentItem -> Bool
<= :: TextDocumentItem -> TextDocumentItem -> Bool
$c<= :: TextDocumentItem -> TextDocumentItem -> Bool
< :: TextDocumentItem -> TextDocumentItem -> Bool
$c< :: TextDocumentItem -> TextDocumentItem -> Bool
compare :: TextDocumentItem -> TextDocumentItem -> Ordering
$ccompare :: TextDocumentItem -> TextDocumentItem -> Ordering
Ord, forall x. Rep TextDocumentItem x -> TextDocumentItem
forall x. TextDocumentItem -> Rep TextDocumentItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TextDocumentItem x -> TextDocumentItem
$cfrom :: forall x. TextDocumentItem -> Rep TextDocumentItem x
Generic)
  deriving anyclass (TextDocumentItem -> ()
forall a. (a -> ()) -> NFData a
rnf :: TextDocumentItem -> ()
$crnf :: TextDocumentItem -> ()
NFData, Eq TextDocumentItem
Int -> TextDocumentItem -> Int
TextDocumentItem -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: TextDocumentItem -> Int
$chash :: TextDocumentItem -> Int
hashWithSalt :: Int -> TextDocumentItem -> Int
$chashWithSalt :: Int -> TextDocumentItem -> Int
Hashable)
  deriving forall ann. [TextDocumentItem] -> Doc ann
forall ann. TextDocumentItem -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [TextDocumentItem] -> Doc ann
$cprettyList :: forall ann. [TextDocumentItem] -> Doc ann
pretty :: forall ann. TextDocumentItem -> Doc ann
$cpretty :: forall ann. TextDocumentItem -> Doc ann
Pretty via (ViaJSON TextDocumentItem)

instance Aeson.ToJSON TextDocumentItem where
  toJSON :: TextDocumentItem -> Value
toJSON (TextDocumentItem Uri
arg0 Text
arg1 Int32
arg2 Text
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
$  [[Key
"uri" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Uri
arg0]
    ,[Key
"languageId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Text
arg1]
    ,[Key
"version" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Int32
arg2]
    ,[Key
"text" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Text
arg3]]

instance Aeson.FromJSON TextDocumentItem where
  parseJSON :: Value -> Parser TextDocumentItem
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"TextDocumentItem" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Uri -> Text -> Int32 -> Text -> TextDocumentItem
TextDocumentItem forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"uri" 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
"languageId" 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
"version" 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
"text"