{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-unused-matches #-}
{-# OPTIONS_GHC -Wno-deprecations #-}
module Language.LSP.Protocol.Internal.Types.SemanticTokensLegend 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
data SemanticTokensLegend = SemanticTokensLegend
{
SemanticTokensLegend -> [Text]
_tokenTypes :: [Data.Text.Text]
,
SemanticTokensLegend -> [Text]
_tokenModifiers :: [Data.Text.Text]
}
deriving stock (Int -> SemanticTokensLegend -> ShowS
[SemanticTokensLegend] -> ShowS
SemanticTokensLegend -> String
(Int -> SemanticTokensLegend -> ShowS)
-> (SemanticTokensLegend -> String)
-> ([SemanticTokensLegend] -> ShowS)
-> Show SemanticTokensLegend
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SemanticTokensLegend -> ShowS
showsPrec :: Int -> SemanticTokensLegend -> ShowS
$cshow :: SemanticTokensLegend -> String
show :: SemanticTokensLegend -> String
$cshowList :: [SemanticTokensLegend] -> ShowS
showList :: [SemanticTokensLegend] -> ShowS
Show, SemanticTokensLegend -> SemanticTokensLegend -> Bool
(SemanticTokensLegend -> SemanticTokensLegend -> Bool)
-> (SemanticTokensLegend -> SemanticTokensLegend -> Bool)
-> Eq SemanticTokensLegend
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SemanticTokensLegend -> SemanticTokensLegend -> Bool
== :: SemanticTokensLegend -> SemanticTokensLegend -> Bool
$c/= :: SemanticTokensLegend -> SemanticTokensLegend -> Bool
/= :: SemanticTokensLegend -> SemanticTokensLegend -> Bool
Eq, Eq SemanticTokensLegend
Eq SemanticTokensLegend =>
(SemanticTokensLegend -> SemanticTokensLegend -> Ordering)
-> (SemanticTokensLegend -> SemanticTokensLegend -> Bool)
-> (SemanticTokensLegend -> SemanticTokensLegend -> Bool)
-> (SemanticTokensLegend -> SemanticTokensLegend -> Bool)
-> (SemanticTokensLegend -> SemanticTokensLegend -> Bool)
-> (SemanticTokensLegend
-> SemanticTokensLegend -> SemanticTokensLegend)
-> (SemanticTokensLegend
-> SemanticTokensLegend -> SemanticTokensLegend)
-> Ord SemanticTokensLegend
SemanticTokensLegend -> SemanticTokensLegend -> Bool
SemanticTokensLegend -> SemanticTokensLegend -> Ordering
SemanticTokensLegend
-> SemanticTokensLegend -> SemanticTokensLegend
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 :: SemanticTokensLegend -> SemanticTokensLegend -> Ordering
compare :: SemanticTokensLegend -> SemanticTokensLegend -> Ordering
$c< :: SemanticTokensLegend -> SemanticTokensLegend -> Bool
< :: SemanticTokensLegend -> SemanticTokensLegend -> Bool
$c<= :: SemanticTokensLegend -> SemanticTokensLegend -> Bool
<= :: SemanticTokensLegend -> SemanticTokensLegend -> Bool
$c> :: SemanticTokensLegend -> SemanticTokensLegend -> Bool
> :: SemanticTokensLegend -> SemanticTokensLegend -> Bool
$c>= :: SemanticTokensLegend -> SemanticTokensLegend -> Bool
>= :: SemanticTokensLegend -> SemanticTokensLegend -> Bool
$cmax :: SemanticTokensLegend
-> SemanticTokensLegend -> SemanticTokensLegend
max :: SemanticTokensLegend
-> SemanticTokensLegend -> SemanticTokensLegend
$cmin :: SemanticTokensLegend
-> SemanticTokensLegend -> SemanticTokensLegend
min :: SemanticTokensLegend
-> SemanticTokensLegend -> SemanticTokensLegend
Ord, (forall x. SemanticTokensLegend -> Rep SemanticTokensLegend x)
-> (forall x. Rep SemanticTokensLegend x -> SemanticTokensLegend)
-> Generic SemanticTokensLegend
forall x. Rep SemanticTokensLegend x -> SemanticTokensLegend
forall x. SemanticTokensLegend -> Rep SemanticTokensLegend x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SemanticTokensLegend -> Rep SemanticTokensLegend x
from :: forall x. SemanticTokensLegend -> Rep SemanticTokensLegend x
$cto :: forall x. Rep SemanticTokensLegend x -> SemanticTokensLegend
to :: forall x. Rep SemanticTokensLegend x -> SemanticTokensLegend
Generic)
deriving anyclass (SemanticTokensLegend -> ()
(SemanticTokensLegend -> ()) -> NFData SemanticTokensLegend
forall a. (a -> ()) -> NFData a
$crnf :: SemanticTokensLegend -> ()
rnf :: SemanticTokensLegend -> ()
NFData, Eq SemanticTokensLegend
Eq SemanticTokensLegend =>
(Int -> SemanticTokensLegend -> Int)
-> (SemanticTokensLegend -> Int) -> Hashable SemanticTokensLegend
Int -> SemanticTokensLegend -> Int
SemanticTokensLegend -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> SemanticTokensLegend -> Int
hashWithSalt :: Int -> SemanticTokensLegend -> Int
$chash :: SemanticTokensLegend -> Int
hash :: SemanticTokensLegend -> Int
Hashable)
deriving (forall ann. SemanticTokensLegend -> Doc ann)
-> (forall ann. [SemanticTokensLegend] -> Doc ann)
-> Pretty SemanticTokensLegend
forall ann. [SemanticTokensLegend] -> Doc ann
forall ann. SemanticTokensLegend -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. SemanticTokensLegend -> Doc ann
pretty :: forall ann. SemanticTokensLegend -> Doc ann
$cprettyList :: forall ann. [SemanticTokensLegend] -> Doc ann
prettyList :: forall ann. [SemanticTokensLegend] -> Doc ann
Pretty via (ViaJSON SemanticTokensLegend)
instance Aeson.ToJSON SemanticTokensLegend where
toJSON :: SemanticTokensLegend -> Value
toJSON (SemanticTokensLegend [Text]
arg0 [Text]
arg1) = [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
"tokenTypes" Key -> [Text] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= [Text]
arg0]
,[Key
"tokenModifiers" 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]]
instance Aeson.FromJSON SemanticTokensLegend where
parseJSON :: Value -> Parser SemanticTokensLegend
parseJSON = String
-> (Object -> Parser SemanticTokensLegend)
-> Value
-> Parser SemanticTokensLegend
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"SemanticTokensLegend" ((Object -> Parser SemanticTokensLegend)
-> Value -> Parser SemanticTokensLegend)
-> (Object -> Parser SemanticTokensLegend)
-> Value
-> Parser SemanticTokensLegend
forall a b. (a -> b) -> a -> b
$ \Object
arg -> [Text] -> [Text] -> SemanticTokensLegend
SemanticTokensLegend ([Text] -> [Text] -> SemanticTokensLegend)
-> Parser [Text] -> Parser ([Text] -> SemanticTokensLegend)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser [Text]
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"tokenTypes" Parser ([Text] -> SemanticTokensLegend)
-> Parser [Text] -> Parser SemanticTokensLegend
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
"tokenModifiers"