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