{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-unused-matches #-}
{-# OPTIONS_GHC -Wno-deprecations #-}
module Language.LSP.Protocol.Internal.Types.SymbolInformation 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.Internal.Types.Location
import qualified Language.LSP.Protocol.Internal.Types.SymbolKind
import qualified Language.LSP.Protocol.Internal.Types.SymbolTag
import qualified Language.LSP.Protocol.Types.Common
data SymbolInformation = SymbolInformation
{
SymbolInformation -> Text
_name :: Data.Text.Text
,
SymbolInformation -> SymbolKind
_kind :: Language.LSP.Protocol.Internal.Types.SymbolKind.SymbolKind
,
SymbolInformation -> Maybe [SymbolTag]
_tags :: (Maybe [Language.LSP.Protocol.Internal.Types.SymbolTag.SymbolTag])
,
SymbolInformation -> Maybe Text
_containerName :: (Maybe Data.Text.Text)
,
SymbolInformation -> Maybe Bool
_deprecated :: (Maybe Bool)
,
SymbolInformation -> Location
_location :: Language.LSP.Protocol.Internal.Types.Location.Location
}
deriving stock (Int -> SymbolInformation -> ShowS
[SymbolInformation] -> ShowS
SymbolInformation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SymbolInformation] -> ShowS
$cshowList :: [SymbolInformation] -> ShowS
show :: SymbolInformation -> String
$cshow :: SymbolInformation -> String
showsPrec :: Int -> SymbolInformation -> ShowS
$cshowsPrec :: Int -> SymbolInformation -> ShowS
Show, SymbolInformation -> SymbolInformation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SymbolInformation -> SymbolInformation -> Bool
$c/= :: SymbolInformation -> SymbolInformation -> Bool
== :: SymbolInformation -> SymbolInformation -> Bool
$c== :: SymbolInformation -> SymbolInformation -> Bool
Eq, Eq SymbolInformation
SymbolInformation -> SymbolInformation -> Bool
SymbolInformation -> SymbolInformation -> Ordering
SymbolInformation -> SymbolInformation -> SymbolInformation
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 :: SymbolInformation -> SymbolInformation -> SymbolInformation
$cmin :: SymbolInformation -> SymbolInformation -> SymbolInformation
max :: SymbolInformation -> SymbolInformation -> SymbolInformation
$cmax :: SymbolInformation -> SymbolInformation -> SymbolInformation
>= :: SymbolInformation -> SymbolInformation -> Bool
$c>= :: SymbolInformation -> SymbolInformation -> Bool
> :: SymbolInformation -> SymbolInformation -> Bool
$c> :: SymbolInformation -> SymbolInformation -> Bool
<= :: SymbolInformation -> SymbolInformation -> Bool
$c<= :: SymbolInformation -> SymbolInformation -> Bool
< :: SymbolInformation -> SymbolInformation -> Bool
$c< :: SymbolInformation -> SymbolInformation -> Bool
compare :: SymbolInformation -> SymbolInformation -> Ordering
$ccompare :: SymbolInformation -> SymbolInformation -> Ordering
Ord, forall x. Rep SymbolInformation x -> SymbolInformation
forall x. SymbolInformation -> Rep SymbolInformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SymbolInformation x -> SymbolInformation
$cfrom :: forall x. SymbolInformation -> Rep SymbolInformation x
Generic)
deriving anyclass (SymbolInformation -> ()
forall a. (a -> ()) -> NFData a
rnf :: SymbolInformation -> ()
$crnf :: SymbolInformation -> ()
NFData, Eq SymbolInformation
Int -> SymbolInformation -> Int
SymbolInformation -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: SymbolInformation -> Int
$chash :: SymbolInformation -> Int
hashWithSalt :: Int -> SymbolInformation -> Int
$chashWithSalt :: Int -> SymbolInformation -> Int
Hashable)
deriving forall ann. [SymbolInformation] -> Doc ann
forall ann. SymbolInformation -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [SymbolInformation] -> Doc ann
$cprettyList :: forall ann. [SymbolInformation] -> Doc ann
pretty :: forall ann. SymbolInformation -> Doc ann
$cpretty :: forall ann. SymbolInformation -> Doc ann
Pretty via (ViaJSON SymbolInformation)
instance Aeson.ToJSON SymbolInformation where
toJSON :: SymbolInformation -> Value
toJSON (SymbolInformation Text
arg0 SymbolKind
arg1 Maybe [SymbolTag]
arg2 Maybe Text
arg3 Maybe Bool
arg4 Location
arg5) = [Pair] -> Value
Aeson.object forall a b. (a -> b) -> a -> b
$ forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall a b. (a -> b) -> a -> b
$ [[Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Text
arg0]
,[Key
"kind" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= SymbolKind
arg1]
,String
"tags" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe [SymbolTag]
arg2
,String
"containerName" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg3
,String
"deprecated" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg4
,[Key
"location" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Location
arg5]]
instance Aeson.FromJSON SymbolInformation where
parseJSON :: Value -> Parser SymbolInformation
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"SymbolInformation" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Text
-> SymbolKind
-> Maybe [SymbolTag]
-> Maybe Text
-> Maybe Bool
-> Location
-> SymbolInformation
SymbolInformation forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"name" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"kind" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"tags" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"containerName" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"deprecated" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"location"