{- 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.MessageType 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

{-|
The message type
-}
data MessageType = 
    {-|
  An error message.
  -}
  MessageType_Error
  | {-|
  A warning message.
  -}
  MessageType_Warning
  | {-|
  An information message.
  -}
  MessageType_Info
  | {-|
  A log message.
  -}
  MessageType_Log
  deriving stock (Int -> MessageType -> ShowS
[MessageType] -> ShowS
MessageType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MessageType] -> ShowS
$cshowList :: [MessageType] -> ShowS
show :: MessageType -> String
$cshow :: MessageType -> String
showsPrec :: Int -> MessageType -> ShowS
$cshowsPrec :: Int -> MessageType -> ShowS
Show, MessageType -> MessageType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MessageType -> MessageType -> Bool
$c/= :: MessageType -> MessageType -> Bool
== :: MessageType -> MessageType -> Bool
$c== :: MessageType -> MessageType -> Bool
Eq, Eq MessageType
MessageType -> MessageType -> Bool
MessageType -> MessageType -> Ordering
MessageType -> MessageType -> MessageType
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 :: MessageType -> MessageType -> MessageType
$cmin :: MessageType -> MessageType -> MessageType
max :: MessageType -> MessageType -> MessageType
$cmax :: MessageType -> MessageType -> MessageType
>= :: MessageType -> MessageType -> Bool
$c>= :: MessageType -> MessageType -> Bool
> :: MessageType -> MessageType -> Bool
$c> :: MessageType -> MessageType -> Bool
<= :: MessageType -> MessageType -> Bool
$c<= :: MessageType -> MessageType -> Bool
< :: MessageType -> MessageType -> Bool
$c< :: MessageType -> MessageType -> Bool
compare :: MessageType -> MessageType -> Ordering
$ccompare :: MessageType -> MessageType -> Ordering
Ord, forall x. Rep MessageType x -> MessageType
forall x. MessageType -> Rep MessageType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MessageType x -> MessageType
$cfrom :: forall x. MessageType -> Rep MessageType x
Generic)
  deriving anyclass (MessageType -> ()
forall a. (a -> ()) -> NFData a
rnf :: MessageType -> ()
$crnf :: MessageType -> ()
NFData, Eq MessageType
Int -> MessageType -> Int
MessageType -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: MessageType -> Int
$chash :: MessageType -> Int
hashWithSalt :: Int -> MessageType -> Int
$chashWithSalt :: Int -> MessageType -> Int
Hashable)
  deriving ( [MessageType] -> Encoding
[MessageType] -> Value
MessageType -> Encoding
MessageType -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [MessageType] -> Encoding
$ctoEncodingList :: [MessageType] -> Encoding
toJSONList :: [MessageType] -> Value
$ctoJSONList :: [MessageType] -> Value
toEncoding :: MessageType -> Encoding
$ctoEncoding :: MessageType -> Encoding
toJSON :: MessageType -> Value
$ctoJSON :: MessageType -> Value
Aeson.ToJSON
  , Value -> Parser [MessageType]
Value -> Parser MessageType
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [MessageType]
$cparseJSONList :: Value -> Parser [MessageType]
parseJSON :: Value -> Parser MessageType
$cparseJSON :: Value -> Parser MessageType
Aeson.FromJSON ) via (Language.LSP.Protocol.Types.LspEnum.AsLspEnum MessageType Language.LSP.Protocol.Types.Common.UInt)
  deriving forall ann. [MessageType] -> Doc ann
forall ann. MessageType -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [MessageType] -> Doc ann
$cprettyList :: forall ann. [MessageType] -> Doc ann
pretty :: forall ann. MessageType -> Doc ann
$cpretty :: forall ann. MessageType -> Doc ann
Pretty via (ViaJSON MessageType)

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