{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-unused-matches #-}
{-# OPTIONS_GHC -Wno-deprecations #-}
module Language.LSP.Protocol.Internal.Types.ErrorCodes 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
data ErrorCodes =
ErrorCodes_ParseError
|
ErrorCodes_InvalidRequest
|
ErrorCodes_MethodNotFound
|
ErrorCodes_InvalidParams
|
ErrorCodes_InternalError
|
ErrorCodes_ServerNotInitialized
|
ErrorCodes_UnknownErrorCode
| ErrorCodes_Custom Language.LSP.Protocol.Types.Common.Int32
deriving stock (Int -> ErrorCodes -> ShowS
[ErrorCodes] -> ShowS
ErrorCodes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ErrorCodes] -> ShowS
$cshowList :: [ErrorCodes] -> ShowS
show :: ErrorCodes -> String
$cshow :: ErrorCodes -> String
showsPrec :: Int -> ErrorCodes -> ShowS
$cshowsPrec :: Int -> ErrorCodes -> ShowS
Show, ErrorCodes -> ErrorCodes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ErrorCodes -> ErrorCodes -> Bool
$c/= :: ErrorCodes -> ErrorCodes -> Bool
== :: ErrorCodes -> ErrorCodes -> Bool
$c== :: ErrorCodes -> ErrorCodes -> Bool
Eq, Eq ErrorCodes
ErrorCodes -> ErrorCodes -> Bool
ErrorCodes -> ErrorCodes -> Ordering
ErrorCodes -> ErrorCodes -> ErrorCodes
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 :: ErrorCodes -> ErrorCodes -> ErrorCodes
$cmin :: ErrorCodes -> ErrorCodes -> ErrorCodes
max :: ErrorCodes -> ErrorCodes -> ErrorCodes
$cmax :: ErrorCodes -> ErrorCodes -> ErrorCodes
>= :: ErrorCodes -> ErrorCodes -> Bool
$c>= :: ErrorCodes -> ErrorCodes -> Bool
> :: ErrorCodes -> ErrorCodes -> Bool
$c> :: ErrorCodes -> ErrorCodes -> Bool
<= :: ErrorCodes -> ErrorCodes -> Bool
$c<= :: ErrorCodes -> ErrorCodes -> Bool
< :: ErrorCodes -> ErrorCodes -> Bool
$c< :: ErrorCodes -> ErrorCodes -> Bool
compare :: ErrorCodes -> ErrorCodes -> Ordering
$ccompare :: ErrorCodes -> ErrorCodes -> Ordering
Ord, forall x. Rep ErrorCodes x -> ErrorCodes
forall x. ErrorCodes -> Rep ErrorCodes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ErrorCodes x -> ErrorCodes
$cfrom :: forall x. ErrorCodes -> Rep ErrorCodes x
Generic)
deriving anyclass (ErrorCodes -> ()
forall a. (a -> ()) -> NFData a
rnf :: ErrorCodes -> ()
$crnf :: ErrorCodes -> ()
NFData, Eq ErrorCodes
Int -> ErrorCodes -> Int
ErrorCodes -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: ErrorCodes -> Int
$chash :: ErrorCodes -> Int
hashWithSalt :: Int -> ErrorCodes -> Int
$chashWithSalt :: Int -> ErrorCodes -> Int
Hashable)
deriving ( [ErrorCodes] -> Encoding
[ErrorCodes] -> Value
ErrorCodes -> Encoding
ErrorCodes -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [ErrorCodes] -> Encoding
$ctoEncodingList :: [ErrorCodes] -> Encoding
toJSONList :: [ErrorCodes] -> Value
$ctoJSONList :: [ErrorCodes] -> Value
toEncoding :: ErrorCodes -> Encoding
$ctoEncoding :: ErrorCodes -> Encoding
toJSON :: ErrorCodes -> Value
$ctoJSON :: ErrorCodes -> Value
Aeson.ToJSON
, Value -> Parser [ErrorCodes]
Value -> Parser ErrorCodes
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [ErrorCodes]
$cparseJSONList :: Value -> Parser [ErrorCodes]
parseJSON :: Value -> Parser ErrorCodes
$cparseJSON :: Value -> Parser ErrorCodes
Aeson.FromJSON ) via (Language.LSP.Protocol.Types.LspEnum.AsLspEnum ErrorCodes Language.LSP.Protocol.Types.Common.Int32)
deriving forall ann. [ErrorCodes] -> Doc ann
forall ann. ErrorCodes -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [ErrorCodes] -> Doc ann
$cprettyList :: forall ann. [ErrorCodes] -> Doc ann
pretty :: forall ann. ErrorCodes -> Doc ann
$cpretty :: forall ann. ErrorCodes -> Doc ann
Pretty via (ViaJSON ErrorCodes)
instance Language.LSP.Protocol.Types.LspEnum.LspEnum ErrorCodes where
knownValues :: Set ErrorCodes
knownValues = forall a. Ord a => [a] -> Set a
Data.Set.fromList [ErrorCodes
ErrorCodes_ParseError
,ErrorCodes
ErrorCodes_InvalidRequest
,ErrorCodes
ErrorCodes_MethodNotFound
,ErrorCodes
ErrorCodes_InvalidParams
,ErrorCodes
ErrorCodes_InternalError
,ErrorCodes
ErrorCodes_ServerNotInitialized
,ErrorCodes
ErrorCodes_UnknownErrorCode]
type EnumBaseType ErrorCodes = Language.LSP.Protocol.Types.Common.Int32
toEnumBaseType :: ErrorCodes -> EnumBaseType ErrorCodes
toEnumBaseType ErrorCodes
ErrorCodes_ParseError = Int32
-32700
toEnumBaseType ErrorCodes
ErrorCodes_InvalidRequest = Int32
-32600
toEnumBaseType ErrorCodes
ErrorCodes_MethodNotFound = Int32
-32601
toEnumBaseType ErrorCodes
ErrorCodes_InvalidParams = Int32
-32602
toEnumBaseType ErrorCodes
ErrorCodes_InternalError = Int32
-32603
toEnumBaseType ErrorCodes
ErrorCodes_ServerNotInitialized = Int32
-32002
toEnumBaseType ErrorCodes
ErrorCodes_UnknownErrorCode = Int32
-32001
toEnumBaseType (ErrorCodes_Custom Int32
arg) = Int32
arg
instance Language.LSP.Protocol.Types.LspEnum.LspOpenEnum ErrorCodes where
fromOpenEnumBaseType :: EnumBaseType ErrorCodes -> ErrorCodes
fromOpenEnumBaseType EnumBaseType ErrorCodes
-32700 = ErrorCodes
ErrorCodes_ParseError
fromOpenEnumBaseType EnumBaseType ErrorCodes
-32600 = ErrorCodes
ErrorCodes_InvalidRequest
fromOpenEnumBaseType EnumBaseType ErrorCodes
-32601 = ErrorCodes
ErrorCodes_MethodNotFound
fromOpenEnumBaseType EnumBaseType ErrorCodes
-32602 = ErrorCodes
ErrorCodes_InvalidParams
fromOpenEnumBaseType EnumBaseType ErrorCodes
-32603 = ErrorCodes
ErrorCodes_InternalError
fromOpenEnumBaseType EnumBaseType ErrorCodes
-32002 = ErrorCodes
ErrorCodes_ServerNotInitialized
fromOpenEnumBaseType EnumBaseType ErrorCodes
-32001 = ErrorCodes
ErrorCodes_UnknownErrorCode
fromOpenEnumBaseType EnumBaseType ErrorCodes
arg = Int32 -> ErrorCodes
ErrorCodes_Custom EnumBaseType ErrorCodes
arg