{- 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.WorkspaceSymbol where

import Control.DeepSeq
import Data.Hashable
import GHC.Generics
import Language.LSP.Protocol.Utils.Misc
import Prettyprinter
import qualified Data.Aeson
import qualified Data.Aeson as Aeson
import qualified Data.Row as Row
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
import qualified Language.LSP.Protocol.Types.Uri

{-|
A special workspace symbol that supports locations without a range.

See also SymbolInformation.

@since 3.17.0
-}
data WorkspaceSymbol = WorkspaceSymbol 
  { {-|
  The name of this symbol.
  -}
  WorkspaceSymbol -> Text
_name :: Data.Text.Text
  , {-|
  The kind of this symbol.
  -}
  WorkspaceSymbol -> SymbolKind
_kind :: Language.LSP.Protocol.Internal.Types.SymbolKind.SymbolKind
  , {-|
  Tags for this symbol.

  @since 3.16.0
  -}
  WorkspaceSymbol -> Maybe [SymbolTag]
_tags :: (Maybe [Language.LSP.Protocol.Internal.Types.SymbolTag.SymbolTag])
  , {-|
  The name of the symbol containing this symbol. This information is for
  user interface purposes (e.g. to render a qualifier in the user interface
  if necessary). It can't be used to re-infer a hierarchy for the document
  symbols.
  -}
  WorkspaceSymbol -> Maybe Text
_containerName :: (Maybe Data.Text.Text)
  , {-|
  The location of the symbol. Whether a server is allowed to
  return a location without a range depends on the client
  capability `workspace.symbol.resolveSupport`.

  See SymbolInformation#location for more details.
  -}
  WorkspaceSymbol
-> Location |? Rec (Extend "uri" Uri ('R '[]) .+ 'R '[])
_location :: (Language.LSP.Protocol.Internal.Types.Location.Location Language.LSP.Protocol.Types.Common.|? (Row.Rec ("uri" Row..== Language.LSP.Protocol.Types.Uri.Uri Row..+ Row.Empty)))
  , {-|
  A data entry field that is preserved on a workspace symbol between a
  workspace symbol request and a workspace symbol resolve request.
  -}
  WorkspaceSymbol -> Maybe Value
_data_ :: (Maybe Data.Aeson.Value)
  }
  deriving stock (Int -> WorkspaceSymbol -> ShowS
[WorkspaceSymbol] -> ShowS
WorkspaceSymbol -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkspaceSymbol] -> ShowS
$cshowList :: [WorkspaceSymbol] -> ShowS
show :: WorkspaceSymbol -> String
$cshow :: WorkspaceSymbol -> String
showsPrec :: Int -> WorkspaceSymbol -> ShowS
$cshowsPrec :: Int -> WorkspaceSymbol -> ShowS
Show, WorkspaceSymbol -> WorkspaceSymbol -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkspaceSymbol -> WorkspaceSymbol -> Bool
$c/= :: WorkspaceSymbol -> WorkspaceSymbol -> Bool
== :: WorkspaceSymbol -> WorkspaceSymbol -> Bool
$c== :: WorkspaceSymbol -> WorkspaceSymbol -> Bool
Eq, Eq WorkspaceSymbol
WorkspaceSymbol -> WorkspaceSymbol -> Bool
WorkspaceSymbol -> WorkspaceSymbol -> Ordering
WorkspaceSymbol -> WorkspaceSymbol -> WorkspaceSymbol
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 :: WorkspaceSymbol -> WorkspaceSymbol -> WorkspaceSymbol
$cmin :: WorkspaceSymbol -> WorkspaceSymbol -> WorkspaceSymbol
max :: WorkspaceSymbol -> WorkspaceSymbol -> WorkspaceSymbol
$cmax :: WorkspaceSymbol -> WorkspaceSymbol -> WorkspaceSymbol
>= :: WorkspaceSymbol -> WorkspaceSymbol -> Bool
$c>= :: WorkspaceSymbol -> WorkspaceSymbol -> Bool
> :: WorkspaceSymbol -> WorkspaceSymbol -> Bool
$c> :: WorkspaceSymbol -> WorkspaceSymbol -> Bool
<= :: WorkspaceSymbol -> WorkspaceSymbol -> Bool
$c<= :: WorkspaceSymbol -> WorkspaceSymbol -> Bool
< :: WorkspaceSymbol -> WorkspaceSymbol -> Bool
$c< :: WorkspaceSymbol -> WorkspaceSymbol -> Bool
compare :: WorkspaceSymbol -> WorkspaceSymbol -> Ordering
$ccompare :: WorkspaceSymbol -> WorkspaceSymbol -> Ordering
Ord, forall x. Rep WorkspaceSymbol x -> WorkspaceSymbol
forall x. WorkspaceSymbol -> Rep WorkspaceSymbol x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkspaceSymbol x -> WorkspaceSymbol
$cfrom :: forall x. WorkspaceSymbol -> Rep WorkspaceSymbol x
Generic)
  deriving anyclass (WorkspaceSymbol -> ()
forall a. (a -> ()) -> NFData a
rnf :: WorkspaceSymbol -> ()
$crnf :: WorkspaceSymbol -> ()
NFData, Eq WorkspaceSymbol
Int -> WorkspaceSymbol -> Int
WorkspaceSymbol -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: WorkspaceSymbol -> Int
$chash :: WorkspaceSymbol -> Int
hashWithSalt :: Int -> WorkspaceSymbol -> Int
$chashWithSalt :: Int -> WorkspaceSymbol -> Int
Hashable)
  deriving forall ann. [WorkspaceSymbol] -> Doc ann
forall ann. WorkspaceSymbol -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [WorkspaceSymbol] -> Doc ann
$cprettyList :: forall ann. [WorkspaceSymbol] -> Doc ann
pretty :: forall ann. WorkspaceSymbol -> Doc ann
$cpretty :: forall ann. WorkspaceSymbol -> Doc ann
Pretty via (ViaJSON WorkspaceSymbol)

instance Aeson.ToJSON WorkspaceSymbol where
  toJSON :: WorkspaceSymbol -> Value
toJSON (WorkspaceSymbol Text
arg0 SymbolKind
arg1 Maybe [SymbolTag]
arg2 Maybe Text
arg3 Location |? Rec (Extend "uri" Uri ('R '[]) .+ 'R '[])
arg4 Maybe Value
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
    ,[Key
"location" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Location |? Rec (Extend "uri" Uri ('R '[]) .+ 'R '[])
arg4]
    ,String
"data" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Value
arg5]

instance Aeson.FromJSON WorkspaceSymbol where
  parseJSON :: Value -> Parser WorkspaceSymbol
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"WorkspaceSymbol" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Text
-> SymbolKind
-> Maybe [SymbolTag]
-> Maybe Text
-> (Location |? Rec (Extend "uri" Uri ('R '[]) .+ 'R '[]))
-> Maybe Value
-> WorkspaceSymbol
WorkspaceSymbol 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 a
Aeson..: Key
"location" 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
"data"