{- 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
(Int -> TextDocumentItem -> ShowS)
-> (TextDocumentItem -> String)
-> ([TextDocumentItem] -> ShowS)
-> Show TextDocumentItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TextDocumentItem -> ShowS
showsPrec :: Int -> TextDocumentItem -> ShowS
$cshow :: TextDocumentItem -> String
show :: TextDocumentItem -> String
$cshowList :: [TextDocumentItem] -> ShowS
showList :: [TextDocumentItem] -> ShowS
Show, TextDocumentItem -> TextDocumentItem -> Bool
(TextDocumentItem -> TextDocumentItem -> Bool)
-> (TextDocumentItem -> TextDocumentItem -> Bool)
-> Eq TextDocumentItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TextDocumentItem -> TextDocumentItem -> Bool
== :: TextDocumentItem -> TextDocumentItem -> Bool
$c/= :: TextDocumentItem -> TextDocumentItem -> Bool
/= :: TextDocumentItem -> TextDocumentItem -> Bool
Eq, Eq TextDocumentItem
Eq TextDocumentItem =>
(TextDocumentItem -> TextDocumentItem -> Ordering)
-> (TextDocumentItem -> TextDocumentItem -> Bool)
-> (TextDocumentItem -> TextDocumentItem -> Bool)
-> (TextDocumentItem -> TextDocumentItem -> Bool)
-> (TextDocumentItem -> TextDocumentItem -> Bool)
-> (TextDocumentItem -> TextDocumentItem -> TextDocumentItem)
-> (TextDocumentItem -> TextDocumentItem -> TextDocumentItem)
-> Ord 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
$ccompare :: TextDocumentItem -> TextDocumentItem -> Ordering
compare :: TextDocumentItem -> TextDocumentItem -> Ordering
$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
>= :: TextDocumentItem -> TextDocumentItem -> Bool
$cmax :: TextDocumentItem -> TextDocumentItem -> TextDocumentItem
max :: TextDocumentItem -> TextDocumentItem -> TextDocumentItem
$cmin :: TextDocumentItem -> TextDocumentItem -> TextDocumentItem
min :: TextDocumentItem -> TextDocumentItem -> TextDocumentItem
Ord, (forall x. TextDocumentItem -> Rep TextDocumentItem x)
-> (forall x. Rep TextDocumentItem x -> TextDocumentItem)
-> Generic TextDocumentItem
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
$cfrom :: forall x. TextDocumentItem -> Rep TextDocumentItem x
from :: forall x. TextDocumentItem -> Rep TextDocumentItem x
$cto :: forall x. Rep TextDocumentItem x -> TextDocumentItem
to :: forall x. Rep TextDocumentItem x -> TextDocumentItem
Generic)
  deriving anyclass (TextDocumentItem -> ()
(TextDocumentItem -> ()) -> NFData TextDocumentItem
forall a. (a -> ()) -> NFData a
$crnf :: TextDocumentItem -> ()
rnf :: TextDocumentItem -> ()
NFData, Eq TextDocumentItem
Eq TextDocumentItem =>
(Int -> TextDocumentItem -> Int)
-> (TextDocumentItem -> Int) -> Hashable TextDocumentItem
Int -> TextDocumentItem -> Int
TextDocumentItem -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> TextDocumentItem -> Int
hashWithSalt :: Int -> TextDocumentItem -> Int
$chash :: TextDocumentItem -> Int
hash :: TextDocumentItem -> Int
Hashable)
  deriving (forall ann. TextDocumentItem -> Doc ann)
-> (forall ann. [TextDocumentItem] -> Doc ann)
-> Pretty TextDocumentItem
forall ann. [TextDocumentItem] -> Doc ann
forall ann. TextDocumentItem -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. TextDocumentItem -> Doc ann
pretty :: forall ann. TextDocumentItem -> Doc ann
$cprettyList :: forall ann. [TextDocumentItem] -> Doc ann
prettyList :: 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 ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$ [[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[Pair]] -> [Pair]) -> [[Pair]] -> [Pair]
forall a b. (a -> b) -> a -> b
$  [[Key
"uri" Key -> Uri -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= Uri
arg0]
    ,[Key
"languageId" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= Text
arg1]
    ,[Key
"version" Key -> Int32 -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= Int32
arg2]
    ,[Key
"text" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= Text
arg3]]

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