{- 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.PositionEncodingKind 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 Data.Text
import qualified Language.LSP.Protocol.Types.LspEnum

{-|
A set of predefined position encoding kinds.

@since 3.17.0
-}
data PositionEncodingKind = 
    {-|
  Character offsets count UTF-8 code units.
  -}
  PositionEncodingKind_UTF8
  | {-|
  Character offsets count UTF-16 code units.

  This is the default and must always be supported
  by servers
  -}
  PositionEncodingKind_UTF16
  | {-|
  Character offsets count UTF-32 code units.

  Implementation note: these are the same as Unicode code points,
  so this `PositionEncodingKind` may also be used for an
  encoding-agnostic representation of character offsets.
  -}
  PositionEncodingKind_UTF32
  | PositionEncodingKind_Custom Data.Text.Text
  deriving stock (Int -> PositionEncodingKind -> ShowS
[PositionEncodingKind] -> ShowS
PositionEncodingKind -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PositionEncodingKind] -> ShowS
$cshowList :: [PositionEncodingKind] -> ShowS
show :: PositionEncodingKind -> String
$cshow :: PositionEncodingKind -> String
showsPrec :: Int -> PositionEncodingKind -> ShowS
$cshowsPrec :: Int -> PositionEncodingKind -> ShowS
Show, PositionEncodingKind -> PositionEncodingKind -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PositionEncodingKind -> PositionEncodingKind -> Bool
$c/= :: PositionEncodingKind -> PositionEncodingKind -> Bool
== :: PositionEncodingKind -> PositionEncodingKind -> Bool
$c== :: PositionEncodingKind -> PositionEncodingKind -> Bool
Eq, Eq PositionEncodingKind
PositionEncodingKind -> PositionEncodingKind -> Bool
PositionEncodingKind -> PositionEncodingKind -> Ordering
PositionEncodingKind
-> PositionEncodingKind -> PositionEncodingKind
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 :: PositionEncodingKind
-> PositionEncodingKind -> PositionEncodingKind
$cmin :: PositionEncodingKind
-> PositionEncodingKind -> PositionEncodingKind
max :: PositionEncodingKind
-> PositionEncodingKind -> PositionEncodingKind
$cmax :: PositionEncodingKind
-> PositionEncodingKind -> PositionEncodingKind
>= :: PositionEncodingKind -> PositionEncodingKind -> Bool
$c>= :: PositionEncodingKind -> PositionEncodingKind -> Bool
> :: PositionEncodingKind -> PositionEncodingKind -> Bool
$c> :: PositionEncodingKind -> PositionEncodingKind -> Bool
<= :: PositionEncodingKind -> PositionEncodingKind -> Bool
$c<= :: PositionEncodingKind -> PositionEncodingKind -> Bool
< :: PositionEncodingKind -> PositionEncodingKind -> Bool
$c< :: PositionEncodingKind -> PositionEncodingKind -> Bool
compare :: PositionEncodingKind -> PositionEncodingKind -> Ordering
$ccompare :: PositionEncodingKind -> PositionEncodingKind -> Ordering
Ord, forall x. Rep PositionEncodingKind x -> PositionEncodingKind
forall x. PositionEncodingKind -> Rep PositionEncodingKind x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PositionEncodingKind x -> PositionEncodingKind
$cfrom :: forall x. PositionEncodingKind -> Rep PositionEncodingKind x
Generic)
  deriving anyclass (PositionEncodingKind -> ()
forall a. (a -> ()) -> NFData a
rnf :: PositionEncodingKind -> ()
$crnf :: PositionEncodingKind -> ()
NFData, Eq PositionEncodingKind
Int -> PositionEncodingKind -> Int
PositionEncodingKind -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: PositionEncodingKind -> Int
$chash :: PositionEncodingKind -> Int
hashWithSalt :: Int -> PositionEncodingKind -> Int
$chashWithSalt :: Int -> PositionEncodingKind -> Int
Hashable)
  deriving ( [PositionEncodingKind] -> Encoding
[PositionEncodingKind] -> Value
PositionEncodingKind -> Encoding
PositionEncodingKind -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [PositionEncodingKind] -> Encoding
$ctoEncodingList :: [PositionEncodingKind] -> Encoding
toJSONList :: [PositionEncodingKind] -> Value
$ctoJSONList :: [PositionEncodingKind] -> Value
toEncoding :: PositionEncodingKind -> Encoding
$ctoEncoding :: PositionEncodingKind -> Encoding
toJSON :: PositionEncodingKind -> Value
$ctoJSON :: PositionEncodingKind -> Value
Aeson.ToJSON
  , Value -> Parser [PositionEncodingKind]
Value -> Parser PositionEncodingKind
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [PositionEncodingKind]
$cparseJSONList :: Value -> Parser [PositionEncodingKind]
parseJSON :: Value -> Parser PositionEncodingKind
$cparseJSON :: Value -> Parser PositionEncodingKind
Aeson.FromJSON
  , String -> PositionEncodingKind
forall a. (String -> a) -> IsString a
fromString :: String -> PositionEncodingKind
$cfromString :: String -> PositionEncodingKind
Data.String.IsString ) via (Language.LSP.Protocol.Types.LspEnum.AsLspEnum PositionEncodingKind Data.Text.Text)
  deriving forall ann. [PositionEncodingKind] -> Doc ann
forall ann. PositionEncodingKind -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [PositionEncodingKind] -> Doc ann
$cprettyList :: forall ann. [PositionEncodingKind] -> Doc ann
pretty :: forall ann. PositionEncodingKind -> Doc ann
$cpretty :: forall ann. PositionEncodingKind -> Doc ann
Pretty via (ViaJSON PositionEncodingKind)

instance Language.LSP.Protocol.Types.LspEnum.LspEnum PositionEncodingKind where
  knownValues :: Set PositionEncodingKind
knownValues = forall a. Ord a => [a] -> Set a
Data.Set.fromList [PositionEncodingKind
PositionEncodingKind_UTF8
    ,PositionEncodingKind
PositionEncodingKind_UTF16
    ,PositionEncodingKind
PositionEncodingKind_UTF32]
  type EnumBaseType PositionEncodingKind = Data.Text.Text
  toEnumBaseType :: PositionEncodingKind -> EnumBaseType PositionEncodingKind
toEnumBaseType PositionEncodingKind
PositionEncodingKind_UTF8 = Text
"utf-8"
  toEnumBaseType PositionEncodingKind
PositionEncodingKind_UTF16 = Text
"utf-16"
  toEnumBaseType PositionEncodingKind
PositionEncodingKind_UTF32 = Text
"utf-32"
  toEnumBaseType (PositionEncodingKind_Custom Text
arg) = Text
arg

instance Language.LSP.Protocol.Types.LspEnum.LspOpenEnum PositionEncodingKind where
  fromOpenEnumBaseType :: EnumBaseType PositionEncodingKind -> PositionEncodingKind
fromOpenEnumBaseType EnumBaseType PositionEncodingKind
"utf-8" = PositionEncodingKind
PositionEncodingKind_UTF8
  fromOpenEnumBaseType EnumBaseType PositionEncodingKind
"utf-16" = PositionEncodingKind
PositionEncodingKind_UTF16
  fromOpenEnumBaseType EnumBaseType PositionEncodingKind
"utf-32" = PositionEncodingKind
PositionEncodingKind_UTF32
  fromOpenEnumBaseType EnumBaseType PositionEncodingKind
arg = Text -> PositionEncodingKind
PositionEncodingKind_Custom EnumBaseType PositionEncodingKind
arg