{- 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.TextDocumentSaveReason 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.Set
import qualified Data.String
import qualified Language.LSP.Protocol.Types.Common
import qualified Language.LSP.Protocol.Types.LspEnum

{-|
Represents reasons why a text document is saved.
-}
data TextDocumentSaveReason = 
    {-|
  Manually triggered, e.g. by the user pressing save, by starting debugging,
  or by an API call.
  -}
  TextDocumentSaveReason_Manual
  | {-|
  Automatic after a delay.
  -}
  TextDocumentSaveReason_AfterDelay
  | {-|
  When the editor lost focus.
  -}
  TextDocumentSaveReason_FocusOut
  deriving stock (Int -> TextDocumentSaveReason -> ShowS
[TextDocumentSaveReason] -> ShowS
TextDocumentSaveReason -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TextDocumentSaveReason] -> ShowS
$cshowList :: [TextDocumentSaveReason] -> ShowS
show :: TextDocumentSaveReason -> String
$cshow :: TextDocumentSaveReason -> String
showsPrec :: Int -> TextDocumentSaveReason -> ShowS
$cshowsPrec :: Int -> TextDocumentSaveReason -> ShowS
Show, TextDocumentSaveReason -> TextDocumentSaveReason -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TextDocumentSaveReason -> TextDocumentSaveReason -> Bool
$c/= :: TextDocumentSaveReason -> TextDocumentSaveReason -> Bool
== :: TextDocumentSaveReason -> TextDocumentSaveReason -> Bool
$c== :: TextDocumentSaveReason -> TextDocumentSaveReason -> Bool
Eq, Eq TextDocumentSaveReason
TextDocumentSaveReason -> TextDocumentSaveReason -> Bool
TextDocumentSaveReason -> TextDocumentSaveReason -> Ordering
TextDocumentSaveReason
-> TextDocumentSaveReason -> TextDocumentSaveReason
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 :: TextDocumentSaveReason
-> TextDocumentSaveReason -> TextDocumentSaveReason
$cmin :: TextDocumentSaveReason
-> TextDocumentSaveReason -> TextDocumentSaveReason
max :: TextDocumentSaveReason
-> TextDocumentSaveReason -> TextDocumentSaveReason
$cmax :: TextDocumentSaveReason
-> TextDocumentSaveReason -> TextDocumentSaveReason
>= :: TextDocumentSaveReason -> TextDocumentSaveReason -> Bool
$c>= :: TextDocumentSaveReason -> TextDocumentSaveReason -> Bool
> :: TextDocumentSaveReason -> TextDocumentSaveReason -> Bool
$c> :: TextDocumentSaveReason -> TextDocumentSaveReason -> Bool
<= :: TextDocumentSaveReason -> TextDocumentSaveReason -> Bool
$c<= :: TextDocumentSaveReason -> TextDocumentSaveReason -> Bool
< :: TextDocumentSaveReason -> TextDocumentSaveReason -> Bool
$c< :: TextDocumentSaveReason -> TextDocumentSaveReason -> Bool
compare :: TextDocumentSaveReason -> TextDocumentSaveReason -> Ordering
$ccompare :: TextDocumentSaveReason -> TextDocumentSaveReason -> Ordering
Ord, forall x. Rep TextDocumentSaveReason x -> TextDocumentSaveReason
forall x. TextDocumentSaveReason -> Rep TextDocumentSaveReason x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TextDocumentSaveReason x -> TextDocumentSaveReason
$cfrom :: forall x. TextDocumentSaveReason -> Rep TextDocumentSaveReason x
Generic)
  deriving anyclass (TextDocumentSaveReason -> ()
forall a. (a -> ()) -> NFData a
rnf :: TextDocumentSaveReason -> ()
$crnf :: TextDocumentSaveReason -> ()
NFData, Eq TextDocumentSaveReason
Int -> TextDocumentSaveReason -> Int
TextDocumentSaveReason -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: TextDocumentSaveReason -> Int
$chash :: TextDocumentSaveReason -> Int
hashWithSalt :: Int -> TextDocumentSaveReason -> Int
$chashWithSalt :: Int -> TextDocumentSaveReason -> Int
Hashable)
  deriving ( [TextDocumentSaveReason] -> Encoding
[TextDocumentSaveReason] -> Value
TextDocumentSaveReason -> Encoding
TextDocumentSaveReason -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [TextDocumentSaveReason] -> Encoding
$ctoEncodingList :: [TextDocumentSaveReason] -> Encoding
toJSONList :: [TextDocumentSaveReason] -> Value
$ctoJSONList :: [TextDocumentSaveReason] -> Value
toEncoding :: TextDocumentSaveReason -> Encoding
$ctoEncoding :: TextDocumentSaveReason -> Encoding
toJSON :: TextDocumentSaveReason -> Value
$ctoJSON :: TextDocumentSaveReason -> Value
Aeson.ToJSON
  , Value -> Parser [TextDocumentSaveReason]
Value -> Parser TextDocumentSaveReason
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [TextDocumentSaveReason]
$cparseJSONList :: Value -> Parser [TextDocumentSaveReason]
parseJSON :: Value -> Parser TextDocumentSaveReason
$cparseJSON :: Value -> Parser TextDocumentSaveReason
Aeson.FromJSON ) via (Language.LSP.Protocol.Types.LspEnum.AsLspEnum TextDocumentSaveReason Language.LSP.Protocol.Types.Common.UInt)
  deriving forall ann. [TextDocumentSaveReason] -> Doc ann
forall ann. TextDocumentSaveReason -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [TextDocumentSaveReason] -> Doc ann
$cprettyList :: forall ann. [TextDocumentSaveReason] -> Doc ann
pretty :: forall ann. TextDocumentSaveReason -> Doc ann
$cpretty :: forall ann. TextDocumentSaveReason -> Doc ann
Pretty via (ViaJSON TextDocumentSaveReason)

instance Language.LSP.Protocol.Types.LspEnum.LspEnum TextDocumentSaveReason where
  knownValues :: Set TextDocumentSaveReason
knownValues = forall a. Ord a => [a] -> Set a
Data.Set.fromList [TextDocumentSaveReason
TextDocumentSaveReason_Manual
    ,TextDocumentSaveReason
TextDocumentSaveReason_AfterDelay
    ,TextDocumentSaveReason
TextDocumentSaveReason_FocusOut]
  type EnumBaseType TextDocumentSaveReason = Language.LSP.Protocol.Types.Common.UInt
  toEnumBaseType :: TextDocumentSaveReason -> EnumBaseType TextDocumentSaveReason
toEnumBaseType TextDocumentSaveReason
TextDocumentSaveReason_Manual = UInt
1
  toEnumBaseType TextDocumentSaveReason
TextDocumentSaveReason_AfterDelay = UInt
2
  toEnumBaseType TextDocumentSaveReason
TextDocumentSaveReason_FocusOut = UInt
3
  fromEnumBaseType :: EnumBaseType TextDocumentSaveReason -> Maybe TextDocumentSaveReason
fromEnumBaseType EnumBaseType TextDocumentSaveReason
1 = forall (f :: * -> *) a. Applicative f => a -> f a
pure TextDocumentSaveReason
TextDocumentSaveReason_Manual
  fromEnumBaseType EnumBaseType TextDocumentSaveReason
2 = forall (f :: * -> *) a. Applicative f => a -> f a
pure TextDocumentSaveReason
TextDocumentSaveReason_AfterDelay
  fromEnumBaseType EnumBaseType TextDocumentSaveReason
3 = forall (f :: * -> *) a. Applicative f => a -> f a
pure TextDocumentSaveReason
TextDocumentSaveReason_FocusOut
  fromEnumBaseType EnumBaseType TextDocumentSaveReason
_ = forall a. Maybe a
Nothing