{-# LANGUAGE TemplateHaskell            #-}
{-# LANGUAGE DuplicateRecordFields      #-}
module Language.LSP.Types.DocumentSymbol where

import           Data.Aeson
import           Data.Aeson.TH
import           Data.Scientific
import           Data.Text                                      (Text)

import           Language.LSP.Types.TextDocument
import           Language.LSP.Types.Common
import           Language.LSP.Types.Location
import           Language.LSP.Types.Progress
import           Language.LSP.Types.Utils

-- ---------------------------------------------------------------------

makeExtendingDatatype "DocumentSymbolOptions"
  [''WorkDoneProgressOptions]
  [ ("_label", [t| Maybe Bool |])]
deriveJSON lspOptions ''DocumentSymbolOptions

makeExtendingDatatype "DocumentSymbolRegistrationOptions"
  [ ''TextDocumentRegistrationOptions
  , ''DocumentSymbolOptions
  ] []
deriveJSON lspOptions ''DocumentSymbolRegistrationOptions

-- ---------------------------------------------------------------------

makeExtendingDatatype "DocumentSymbolParams"
  [ ''WorkDoneProgressParams
  , ''PartialResultParams
  ]
  [ ("_textDocument", [t| TextDocumentIdentifier |])]
deriveJSON lspOptions ''DocumentSymbolParams

-- -------------------------------------

data SymbolKind
    = SkFile
    | SkModule
    | SkNamespace
    | SkPackage
    | SkClass
    | SkMethod
    | SkProperty
    | SkField
    | SkConstructor
    | SkEnum
    | SkInterface
    | SkFunction
    | SkVariable
    | SkConstant
    | SkString
    | SkNumber
    | SkBoolean
    | SkArray
    | SkObject
    | SkKey
    | SkNull
    | SkEnumMember
    | SkStruct
    | SkEvent
    | SkOperator
    | SkTypeParameter
    | SkUnknown Scientific
    deriving (ReadPrec [SymbolKind]
ReadPrec SymbolKind
Int -> ReadS SymbolKind
ReadS [SymbolKind]
(Int -> ReadS SymbolKind)
-> ReadS [SymbolKind]
-> ReadPrec SymbolKind
-> ReadPrec [SymbolKind]
-> Read SymbolKind
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SymbolKind]
$creadListPrec :: ReadPrec [SymbolKind]
readPrec :: ReadPrec SymbolKind
$creadPrec :: ReadPrec SymbolKind
readList :: ReadS [SymbolKind]
$creadList :: ReadS [SymbolKind]
readsPrec :: Int -> ReadS SymbolKind
$creadsPrec :: Int -> ReadS SymbolKind
Read,Int -> SymbolKind -> ShowS
[SymbolKind] -> ShowS
SymbolKind -> String
(Int -> SymbolKind -> ShowS)
-> (SymbolKind -> String)
-> ([SymbolKind] -> ShowS)
-> Show SymbolKind
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SymbolKind] -> ShowS
$cshowList :: [SymbolKind] -> ShowS
show :: SymbolKind -> String
$cshow :: SymbolKind -> String
showsPrec :: Int -> SymbolKind -> ShowS
$cshowsPrec :: Int -> SymbolKind -> ShowS
Show,SymbolKind -> SymbolKind -> Bool
(SymbolKind -> SymbolKind -> Bool)
-> (SymbolKind -> SymbolKind -> Bool) -> Eq SymbolKind
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SymbolKind -> SymbolKind -> Bool
$c/= :: SymbolKind -> SymbolKind -> Bool
== :: SymbolKind -> SymbolKind -> Bool
$c== :: SymbolKind -> SymbolKind -> Bool
Eq)

instance ToJSON SymbolKind where
  toJSON :: SymbolKind -> Value
toJSON SymbolKind
SkFile          = Scientific -> Value
Number Scientific
1
  toJSON SymbolKind
SkModule        = Scientific -> Value
Number Scientific
2
  toJSON SymbolKind
SkNamespace     = Scientific -> Value
Number Scientific
3
  toJSON SymbolKind
SkPackage       = Scientific -> Value
Number Scientific
4
  toJSON SymbolKind
SkClass         = Scientific -> Value
Number Scientific
5
  toJSON SymbolKind
SkMethod        = Scientific -> Value
Number Scientific
6
  toJSON SymbolKind
SkProperty      = Scientific -> Value
Number Scientific
7
  toJSON SymbolKind
SkField         = Scientific -> Value
Number Scientific
8
  toJSON SymbolKind
SkConstructor   = Scientific -> Value
Number Scientific
9
  toJSON SymbolKind
SkEnum          = Scientific -> Value
Number Scientific
10
  toJSON SymbolKind
SkInterface     = Scientific -> Value
Number Scientific
11
  toJSON SymbolKind
SkFunction      = Scientific -> Value
Number Scientific
12
  toJSON SymbolKind
SkVariable      = Scientific -> Value
Number Scientific
13
  toJSON SymbolKind
SkConstant      = Scientific -> Value
Number Scientific
14
  toJSON SymbolKind
SkString        = Scientific -> Value
Number Scientific
15
  toJSON SymbolKind
SkNumber        = Scientific -> Value
Number Scientific
16
  toJSON SymbolKind
SkBoolean       = Scientific -> Value
Number Scientific
17
  toJSON SymbolKind
SkArray         = Scientific -> Value
Number Scientific
18
  toJSON SymbolKind
SkObject        = Scientific -> Value
Number Scientific
19
  toJSON SymbolKind
SkKey           = Scientific -> Value
Number Scientific
20
  toJSON SymbolKind
SkNull          = Scientific -> Value
Number Scientific
21
  toJSON SymbolKind
SkEnumMember    = Scientific -> Value
Number Scientific
22
  toJSON SymbolKind
SkStruct        = Scientific -> Value
Number Scientific
23
  toJSON SymbolKind
SkEvent         = Scientific -> Value
Number Scientific
24
  toJSON SymbolKind
SkOperator      = Scientific -> Value
Number Scientific
25
  toJSON SymbolKind
SkTypeParameter = Scientific -> Value
Number Scientific
26
  toJSON (SkUnknown Scientific
x)   = Scientific -> Value
Number Scientific
x

instance FromJSON SymbolKind where
  parseJSON :: Value -> Parser SymbolKind
parseJSON (Number  Scientific
1) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkFile
  parseJSON (Number  Scientific
2) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkModule
  parseJSON (Number  Scientific
3) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkNamespace
  parseJSON (Number  Scientific
4) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkPackage
  parseJSON (Number  Scientific
5) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkClass
  parseJSON (Number  Scientific
6) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkMethod
  parseJSON (Number  Scientific
7) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkProperty
  parseJSON (Number  Scientific
8) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkField
  parseJSON (Number  Scientific
9) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkConstructor
  parseJSON (Number Scientific
10) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkEnum
  parseJSON (Number Scientific
11) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkInterface
  parseJSON (Number Scientific
12) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkFunction
  parseJSON (Number Scientific
13) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkVariable
  parseJSON (Number Scientific
14) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkConstant
  parseJSON (Number Scientific
15) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkString
  parseJSON (Number Scientific
16) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkNumber
  parseJSON (Number Scientific
17) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkBoolean
  parseJSON (Number Scientific
18) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkArray
  parseJSON (Number Scientific
19) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkObject
  parseJSON (Number Scientific
20) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkKey
  parseJSON (Number Scientific
21) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkNull
  parseJSON (Number Scientific
22) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkEnumMember
  parseJSON (Number Scientific
23) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkStruct
  parseJSON (Number Scientific
24) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkEvent
  parseJSON (Number Scientific
25) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkOperator
  parseJSON (Number Scientific
26) = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolKind
SkTypeParameter
  parseJSON (Number Scientific
x)  = SymbolKind -> Parser SymbolKind
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Scientific -> SymbolKind
SkUnknown Scientific
x)
  parseJSON Value
_           = Parser SymbolKind
forall a. Monoid a => a
mempty

{-|
Symbol tags are extra annotations that tweak the rendering of a symbol.

@since 3.16.0
-}
data SymbolTag =
  StDeprecated -- ^ Render a symbol as obsolete, usually using a strike-out.
  | StUnknown Scientific
  deriving (ReadPrec [SymbolTag]
ReadPrec SymbolTag
Int -> ReadS SymbolTag
ReadS [SymbolTag]
(Int -> ReadS SymbolTag)
-> ReadS [SymbolTag]
-> ReadPrec SymbolTag
-> ReadPrec [SymbolTag]
-> Read SymbolTag
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SymbolTag]
$creadListPrec :: ReadPrec [SymbolTag]
readPrec :: ReadPrec SymbolTag
$creadPrec :: ReadPrec SymbolTag
readList :: ReadS [SymbolTag]
$creadList :: ReadS [SymbolTag]
readsPrec :: Int -> ReadS SymbolTag
$creadsPrec :: Int -> ReadS SymbolTag
Read, Int -> SymbolTag -> ShowS
[SymbolTag] -> ShowS
SymbolTag -> String
(Int -> SymbolTag -> ShowS)
-> (SymbolTag -> String)
-> ([SymbolTag] -> ShowS)
-> Show SymbolTag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SymbolTag] -> ShowS
$cshowList :: [SymbolTag] -> ShowS
show :: SymbolTag -> String
$cshow :: SymbolTag -> String
showsPrec :: Int -> SymbolTag -> ShowS
$cshowsPrec :: Int -> SymbolTag -> ShowS
Show, SymbolTag -> SymbolTag -> Bool
(SymbolTag -> SymbolTag -> Bool)
-> (SymbolTag -> SymbolTag -> Bool) -> Eq SymbolTag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SymbolTag -> SymbolTag -> Bool
$c/= :: SymbolTag -> SymbolTag -> Bool
== :: SymbolTag -> SymbolTag -> Bool
$c== :: SymbolTag -> SymbolTag -> Bool
Eq)

instance ToJSON SymbolTag where
  toJSON :: SymbolTag -> Value
toJSON SymbolTag
StDeprecated          = Scientific -> Value
Number Scientific
1
  toJSON (StUnknown Scientific
x)   = Scientific -> Value
Number Scientific
x

instance FromJSON SymbolTag where
  parseJSON :: Value -> Parser SymbolTag
parseJSON (Number  Scientific
1) = SymbolTag -> Parser SymbolTag
forall (f :: * -> *) a. Applicative f => a -> f a
pure SymbolTag
StDeprecated
  parseJSON (Number Scientific
x)  = SymbolTag -> Parser SymbolTag
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Scientific -> SymbolTag
StUnknown Scientific
x)
  parseJSON Value
_           = Parser SymbolTag
forall a. Monoid a => a
mempty
  
-- -------------------------------------

data DocumentSymbolKindClientCapabilities =
  DocumentSymbolKindClientCapabilities
    { -- | The symbol kind values the client supports. When this
      --  property exists the client also guarantees that it will
      --  handle values outside its set gracefully and falls back
      --  to a default value when unknown.
      --
      --  If this property is not present the client only supports
      --  the symbol kinds from `File` to `Array` as defined in
      --  the initial version of the protocol.
      DocumentSymbolKindClientCapabilities -> Maybe (List SymbolKind)
_valueSet :: Maybe (List SymbolKind)
    }
  deriving (Int -> DocumentSymbolKindClientCapabilities -> ShowS
[DocumentSymbolKindClientCapabilities] -> ShowS
DocumentSymbolKindClientCapabilities -> String
(Int -> DocumentSymbolKindClientCapabilities -> ShowS)
-> (DocumentSymbolKindClientCapabilities -> String)
-> ([DocumentSymbolKindClientCapabilities] -> ShowS)
-> Show DocumentSymbolKindClientCapabilities
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocumentSymbolKindClientCapabilities] -> ShowS
$cshowList :: [DocumentSymbolKindClientCapabilities] -> ShowS
show :: DocumentSymbolKindClientCapabilities -> String
$cshow :: DocumentSymbolKindClientCapabilities -> String
showsPrec :: Int -> DocumentSymbolKindClientCapabilities -> ShowS
$cshowsPrec :: Int -> DocumentSymbolKindClientCapabilities -> ShowS
Show, ReadPrec [DocumentSymbolKindClientCapabilities]
ReadPrec DocumentSymbolKindClientCapabilities
Int -> ReadS DocumentSymbolKindClientCapabilities
ReadS [DocumentSymbolKindClientCapabilities]
(Int -> ReadS DocumentSymbolKindClientCapabilities)
-> ReadS [DocumentSymbolKindClientCapabilities]
-> ReadPrec DocumentSymbolKindClientCapabilities
-> ReadPrec [DocumentSymbolKindClientCapabilities]
-> Read DocumentSymbolKindClientCapabilities
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DocumentSymbolKindClientCapabilities]
$creadListPrec :: ReadPrec [DocumentSymbolKindClientCapabilities]
readPrec :: ReadPrec DocumentSymbolKindClientCapabilities
$creadPrec :: ReadPrec DocumentSymbolKindClientCapabilities
readList :: ReadS [DocumentSymbolKindClientCapabilities]
$creadList :: ReadS [DocumentSymbolKindClientCapabilities]
readsPrec :: Int -> ReadS DocumentSymbolKindClientCapabilities
$creadsPrec :: Int -> ReadS DocumentSymbolKindClientCapabilities
Read, DocumentSymbolKindClientCapabilities
-> DocumentSymbolKindClientCapabilities -> Bool
(DocumentSymbolKindClientCapabilities
 -> DocumentSymbolKindClientCapabilities -> Bool)
-> (DocumentSymbolKindClientCapabilities
    -> DocumentSymbolKindClientCapabilities -> Bool)
-> Eq DocumentSymbolKindClientCapabilities
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocumentSymbolKindClientCapabilities
-> DocumentSymbolKindClientCapabilities -> Bool
$c/= :: DocumentSymbolKindClientCapabilities
-> DocumentSymbolKindClientCapabilities -> Bool
== :: DocumentSymbolKindClientCapabilities
-> DocumentSymbolKindClientCapabilities -> Bool
$c== :: DocumentSymbolKindClientCapabilities
-> DocumentSymbolKindClientCapabilities -> Bool
Eq)

deriveJSON lspOptions ''DocumentSymbolKindClientCapabilities

data DocumentSymbolTagClientCapabilities =
  DocumentSymbolTagClientCapabilities
    { -- | The tags supported by the client.
      DocumentSymbolTagClientCapabilities -> Maybe (List SymbolTag)
_valueSet :: Maybe (List SymbolTag)
    }
  deriving (Int -> DocumentSymbolTagClientCapabilities -> ShowS
[DocumentSymbolTagClientCapabilities] -> ShowS
DocumentSymbolTagClientCapabilities -> String
(Int -> DocumentSymbolTagClientCapabilities -> ShowS)
-> (DocumentSymbolTagClientCapabilities -> String)
-> ([DocumentSymbolTagClientCapabilities] -> ShowS)
-> Show DocumentSymbolTagClientCapabilities
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocumentSymbolTagClientCapabilities] -> ShowS
$cshowList :: [DocumentSymbolTagClientCapabilities] -> ShowS
show :: DocumentSymbolTagClientCapabilities -> String
$cshow :: DocumentSymbolTagClientCapabilities -> String
showsPrec :: Int -> DocumentSymbolTagClientCapabilities -> ShowS
$cshowsPrec :: Int -> DocumentSymbolTagClientCapabilities -> ShowS
Show, ReadPrec [DocumentSymbolTagClientCapabilities]
ReadPrec DocumentSymbolTagClientCapabilities
Int -> ReadS DocumentSymbolTagClientCapabilities
ReadS [DocumentSymbolTagClientCapabilities]
(Int -> ReadS DocumentSymbolTagClientCapabilities)
-> ReadS [DocumentSymbolTagClientCapabilities]
-> ReadPrec DocumentSymbolTagClientCapabilities
-> ReadPrec [DocumentSymbolTagClientCapabilities]
-> Read DocumentSymbolTagClientCapabilities
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DocumentSymbolTagClientCapabilities]
$creadListPrec :: ReadPrec [DocumentSymbolTagClientCapabilities]
readPrec :: ReadPrec DocumentSymbolTagClientCapabilities
$creadPrec :: ReadPrec DocumentSymbolTagClientCapabilities
readList :: ReadS [DocumentSymbolTagClientCapabilities]
$creadList :: ReadS [DocumentSymbolTagClientCapabilities]
readsPrec :: Int -> ReadS DocumentSymbolTagClientCapabilities
$creadsPrec :: Int -> ReadS DocumentSymbolTagClientCapabilities
Read, DocumentSymbolTagClientCapabilities
-> DocumentSymbolTagClientCapabilities -> Bool
(DocumentSymbolTagClientCapabilities
 -> DocumentSymbolTagClientCapabilities -> Bool)
-> (DocumentSymbolTagClientCapabilities
    -> DocumentSymbolTagClientCapabilities -> Bool)
-> Eq DocumentSymbolTagClientCapabilities
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocumentSymbolTagClientCapabilities
-> DocumentSymbolTagClientCapabilities -> Bool
$c/= :: DocumentSymbolTagClientCapabilities
-> DocumentSymbolTagClientCapabilities -> Bool
== :: DocumentSymbolTagClientCapabilities
-> DocumentSymbolTagClientCapabilities -> Bool
$c== :: DocumentSymbolTagClientCapabilities
-> DocumentSymbolTagClientCapabilities -> Bool
Eq)

deriveJSON lspOptions ''DocumentSymbolTagClientCapabilities

data DocumentSymbolClientCapabilities =
  DocumentSymbolClientCapabilities
    { -- | Whether document symbol supports dynamic registration.
      DocumentSymbolClientCapabilities -> Maybe Bool
_dynamicRegistration :: Maybe Bool
      -- | Specific capabilities for the `SymbolKind`.
    , DocumentSymbolClientCapabilities
-> Maybe DocumentSymbolKindClientCapabilities
_symbolKind :: Maybe DocumentSymbolKindClientCapabilities
    , DocumentSymbolClientCapabilities -> Maybe Bool
_hierarchicalDocumentSymbolSupport :: Maybe Bool
      -- | The client supports tags on `SymbolInformation`.
      -- Clients supporting tags have to handle unknown tags gracefully.
      --
      -- @since 3.16.0
    , DocumentSymbolClientCapabilities
-> Maybe DocumentSymbolTagClientCapabilities
_tagSupport :: Maybe DocumentSymbolTagClientCapabilities
      -- | The client supports an additional label presented in the UI when
      -- registering a document symbol provider.
      --
      -- @since 3.16.0
    , DocumentSymbolClientCapabilities -> Maybe Bool
_labelSupport :: Maybe Bool
    } deriving (Int -> DocumentSymbolClientCapabilities -> ShowS
[DocumentSymbolClientCapabilities] -> ShowS
DocumentSymbolClientCapabilities -> String
(Int -> DocumentSymbolClientCapabilities -> ShowS)
-> (DocumentSymbolClientCapabilities -> String)
-> ([DocumentSymbolClientCapabilities] -> ShowS)
-> Show DocumentSymbolClientCapabilities
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocumentSymbolClientCapabilities] -> ShowS
$cshowList :: [DocumentSymbolClientCapabilities] -> ShowS
show :: DocumentSymbolClientCapabilities -> String
$cshow :: DocumentSymbolClientCapabilities -> String
showsPrec :: Int -> DocumentSymbolClientCapabilities -> ShowS
$cshowsPrec :: Int -> DocumentSymbolClientCapabilities -> ShowS
Show, ReadPrec [DocumentSymbolClientCapabilities]
ReadPrec DocumentSymbolClientCapabilities
Int -> ReadS DocumentSymbolClientCapabilities
ReadS [DocumentSymbolClientCapabilities]
(Int -> ReadS DocumentSymbolClientCapabilities)
-> ReadS [DocumentSymbolClientCapabilities]
-> ReadPrec DocumentSymbolClientCapabilities
-> ReadPrec [DocumentSymbolClientCapabilities]
-> Read DocumentSymbolClientCapabilities
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DocumentSymbolClientCapabilities]
$creadListPrec :: ReadPrec [DocumentSymbolClientCapabilities]
readPrec :: ReadPrec DocumentSymbolClientCapabilities
$creadPrec :: ReadPrec DocumentSymbolClientCapabilities
readList :: ReadS [DocumentSymbolClientCapabilities]
$creadList :: ReadS [DocumentSymbolClientCapabilities]
readsPrec :: Int -> ReadS DocumentSymbolClientCapabilities
$creadsPrec :: Int -> ReadS DocumentSymbolClientCapabilities
Read, DocumentSymbolClientCapabilities
-> DocumentSymbolClientCapabilities -> Bool
(DocumentSymbolClientCapabilities
 -> DocumentSymbolClientCapabilities -> Bool)
-> (DocumentSymbolClientCapabilities
    -> DocumentSymbolClientCapabilities -> Bool)
-> Eq DocumentSymbolClientCapabilities
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocumentSymbolClientCapabilities
-> DocumentSymbolClientCapabilities -> Bool
$c/= :: DocumentSymbolClientCapabilities
-> DocumentSymbolClientCapabilities -> Bool
== :: DocumentSymbolClientCapabilities
-> DocumentSymbolClientCapabilities -> Bool
$c== :: DocumentSymbolClientCapabilities
-> DocumentSymbolClientCapabilities -> Bool
Eq)

deriveJSON lspOptions ''DocumentSymbolClientCapabilities

-- ---------------------------------------------------------------------

-- | Represents programming constructs like variables, classes, interfaces etc.
-- that appear in a document. Document symbols can be hierarchical and they
-- have two ranges: one that encloses its definition and one that points to its
-- most interesting range, e.g. the range of an identifier.
data DocumentSymbol =
  DocumentSymbol
    { DocumentSymbol -> Text
_name           :: Text -- ^ The name of this symbol.
    -- | More detail for this symbol, e.g the signature of a function. If not
    -- provided the name is used.
    , DocumentSymbol -> Maybe Text
_detail         :: Maybe Text
    , DocumentSymbol -> SymbolKind
_kind           :: SymbolKind -- ^ The kind of this symbol.
    , DocumentSymbol -> Maybe (List SymbolTag)
_tags           :: Maybe (List SymbolTag) -- ^ Tags for this document symbol.
    , DocumentSymbol -> Maybe Bool
_deprecated     :: Maybe Bool -- ^ Indicates if this symbol is deprecated. Deprecated, use tags instead.
    -- | The range enclosing this symbol not including leading/trailing
    -- whitespace but everything else like comments. This information is
    -- typically used to determine if the the clients cursor is inside the symbol
    -- to reveal in the symbol in the UI.
    , DocumentSymbol -> Range
_range          :: Range
    -- | The range that should be selected and revealed when this symbol is being
    -- picked, e.g the name of a function. Must be contained by the the '_range'.
    , DocumentSymbol -> Range
_selectionRange :: Range
    -- | Children of this symbol, e.g. properties of a class.
    , DocumentSymbol -> Maybe (List DocumentSymbol)
_children       :: Maybe (List DocumentSymbol)
    } deriving (ReadPrec [DocumentSymbol]
ReadPrec DocumentSymbol
Int -> ReadS DocumentSymbol
ReadS [DocumentSymbol]
(Int -> ReadS DocumentSymbol)
-> ReadS [DocumentSymbol]
-> ReadPrec DocumentSymbol
-> ReadPrec [DocumentSymbol]
-> Read DocumentSymbol
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DocumentSymbol]
$creadListPrec :: ReadPrec [DocumentSymbol]
readPrec :: ReadPrec DocumentSymbol
$creadPrec :: ReadPrec DocumentSymbol
readList :: ReadS [DocumentSymbol]
$creadList :: ReadS [DocumentSymbol]
readsPrec :: Int -> ReadS DocumentSymbol
$creadsPrec :: Int -> ReadS DocumentSymbol
Read,Int -> DocumentSymbol -> ShowS
[DocumentSymbol] -> ShowS
DocumentSymbol -> String
(Int -> DocumentSymbol -> ShowS)
-> (DocumentSymbol -> String)
-> ([DocumentSymbol] -> ShowS)
-> Show DocumentSymbol
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
(DocumentSymbol -> DocumentSymbol -> Bool)
-> (DocumentSymbol -> DocumentSymbol -> Bool) -> Eq DocumentSymbol
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)

deriveJSON lspOptions ''DocumentSymbol

-- ---------------------------------------------------------------------

-- | Represents information about programming constructs like variables, classes,
-- interfaces etc.
data SymbolInformation =
  SymbolInformation
    { SymbolInformation -> Text
_name          :: Text -- ^ The name of this symbol.
    , SymbolInformation -> SymbolKind
_kind          :: SymbolKind -- ^ The kind of this symbol.
    , SymbolInformation -> Maybe (List SymbolTag)
_tags          :: Maybe (List SymbolTag) -- ^ Tags for this symbol.
    , SymbolInformation -> Maybe Bool
_deprecated    :: Maybe Bool -- ^ Indicates if this symbol is deprecated. Deprecated, use tags instead.
    -- | The location of this symbol. The location's range is used by a tool
    -- to reveal the location in the editor. If the symbol is selected in the
    -- tool the range's start information is used to position the cursor. So
    -- the range usually spans more then the actual symbol's name and does
    -- normally include things like visibility modifiers.
    --
    -- The range doesn't have to denote a node range in the sense of a abstract
    -- syntax tree. It can therefore not be used to re-construct a hierarchy of
    -- the symbols.
    , SymbolInformation -> Location
_location      :: Location
    -- | 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.
    , SymbolInformation -> Maybe Text
_containerName :: Maybe Text
    } deriving (ReadPrec [SymbolInformation]
ReadPrec SymbolInformation
Int -> ReadS SymbolInformation
ReadS [SymbolInformation]
(Int -> ReadS SymbolInformation)
-> ReadS [SymbolInformation]
-> ReadPrec SymbolInformation
-> ReadPrec [SymbolInformation]
-> Read SymbolInformation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SymbolInformation]
$creadListPrec :: ReadPrec [SymbolInformation]
readPrec :: ReadPrec SymbolInformation
$creadPrec :: ReadPrec SymbolInformation
readList :: ReadS [SymbolInformation]
$creadList :: ReadS [SymbolInformation]
readsPrec :: Int -> ReadS SymbolInformation
$creadsPrec :: Int -> ReadS SymbolInformation
Read,Int -> SymbolInformation -> ShowS
[SymbolInformation] -> ShowS
SymbolInformation -> String
(Int -> SymbolInformation -> ShowS)
-> (SymbolInformation -> String)
-> ([SymbolInformation] -> ShowS)
-> Show SymbolInformation
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
(SymbolInformation -> SymbolInformation -> Bool)
-> (SymbolInformation -> SymbolInformation -> Bool)
-> Eq SymbolInformation
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)
{-# DEPRECATED _deprecated "Use tags instead" #-}

deriveJSON lspOptions ''SymbolInformation