{-# LANGUAGE TemplateHaskell       #-}
{-# LANGUAGE DuplicateRecordFields #-}
-- | Find References Request
-- https://microsoft.github.io/language-server-protocol/specifications/specification-3-15/#textDocument_references
module Language.LSP.Types.References where

import Data.Aeson.TH

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

data ReferencesClientCapabilities =
  ReferencesClientCapabilities
    { -- | Whether references supports dynamic registration.
      ReferencesClientCapabilities -> Maybe Bool
_dynamicRegistration :: Maybe Bool
    } deriving (Int -> ReferencesClientCapabilities -> ShowS
[ReferencesClientCapabilities] -> ShowS
ReferencesClientCapabilities -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReferencesClientCapabilities] -> ShowS
$cshowList :: [ReferencesClientCapabilities] -> ShowS
show :: ReferencesClientCapabilities -> String
$cshow :: ReferencesClientCapabilities -> String
showsPrec :: Int -> ReferencesClientCapabilities -> ShowS
$cshowsPrec :: Int -> ReferencesClientCapabilities -> ShowS
Show, ReadPrec [ReferencesClientCapabilities]
ReadPrec ReferencesClientCapabilities
Int -> ReadS ReferencesClientCapabilities
ReadS [ReferencesClientCapabilities]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReferencesClientCapabilities]
$creadListPrec :: ReadPrec [ReferencesClientCapabilities]
readPrec :: ReadPrec ReferencesClientCapabilities
$creadPrec :: ReadPrec ReferencesClientCapabilities
readList :: ReadS [ReferencesClientCapabilities]
$creadList :: ReadS [ReferencesClientCapabilities]
readsPrec :: Int -> ReadS ReferencesClientCapabilities
$creadsPrec :: Int -> ReadS ReferencesClientCapabilities
Read, ReferencesClientCapabilities
-> ReferencesClientCapabilities -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReferencesClientCapabilities
-> ReferencesClientCapabilities -> Bool
$c/= :: ReferencesClientCapabilities
-> ReferencesClientCapabilities -> Bool
== :: ReferencesClientCapabilities
-> ReferencesClientCapabilities -> Bool
$c== :: ReferencesClientCapabilities
-> ReferencesClientCapabilities -> Bool
Eq)
deriveJSON lspOptions ''ReferencesClientCapabilities

makeExtendingDatatype "ReferenceOptions" [''WorkDoneProgressOptions] []
deriveJSON lspOptions ''ReferenceOptions

makeExtendingDatatype "ReferenceRegistrationOptions"
  [ ''TextDocumentRegistrationOptions
  , ''ReferenceOptions
  ]
  []
deriveJSON lspOptions ''ReferenceRegistrationOptions

data ReferenceContext =
  ReferenceContext
    { -- | Include the declaration of the current symbol.
      ReferenceContext -> Bool
_includeDeclaration :: Bool
    } deriving (ReadPrec [ReferenceContext]
ReadPrec ReferenceContext
Int -> ReadS ReferenceContext
ReadS [ReferenceContext]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReferenceContext]
$creadListPrec :: ReadPrec [ReferenceContext]
readPrec :: ReadPrec ReferenceContext
$creadPrec :: ReadPrec ReferenceContext
readList :: ReadS [ReferenceContext]
$creadList :: ReadS [ReferenceContext]
readsPrec :: Int -> ReadS ReferenceContext
$creadsPrec :: Int -> ReadS ReferenceContext
Read,Int -> ReferenceContext -> ShowS
[ReferenceContext] -> ShowS
ReferenceContext -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReferenceContext] -> ShowS
$cshowList :: [ReferenceContext] -> ShowS
show :: ReferenceContext -> String
$cshow :: ReferenceContext -> String
showsPrec :: Int -> ReferenceContext -> ShowS
$cshowsPrec :: Int -> ReferenceContext -> ShowS
Show,ReferenceContext -> ReferenceContext -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReferenceContext -> ReferenceContext -> Bool
$c/= :: ReferenceContext -> ReferenceContext -> Bool
== :: ReferenceContext -> ReferenceContext -> Bool
$c== :: ReferenceContext -> ReferenceContext -> Bool
Eq)
deriveJSON lspOptions ''ReferenceContext

makeExtendingDatatype "ReferenceParams"
  [ ''TextDocumentPositionParams
  , ''WorkDoneProgressParams
  , ''PartialResultParams
  ]
  [("_context", [t| ReferenceContext |])]
deriveJSON lspOptions ''ReferenceParams