{-# 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
(Int -> ReferencesClientCapabilities -> ShowS)
-> (ReferencesClientCapabilities -> String)
-> ([ReferencesClientCapabilities] -> ShowS)
-> Show ReferencesClientCapabilities
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ReferencesClientCapabilities -> ShowS
showsPrec :: Int -> ReferencesClientCapabilities -> ShowS
$cshow :: ReferencesClientCapabilities -> String
show :: ReferencesClientCapabilities -> String
$cshowList :: [ReferencesClientCapabilities] -> ShowS
showList :: [ReferencesClientCapabilities] -> ShowS
Show, ReadPrec [ReferencesClientCapabilities]
ReadPrec ReferencesClientCapabilities
Int -> ReadS ReferencesClientCapabilities
ReadS [ReferencesClientCapabilities]
(Int -> ReadS ReferencesClientCapabilities)
-> ReadS [ReferencesClientCapabilities]
-> ReadPrec ReferencesClientCapabilities
-> ReadPrec [ReferencesClientCapabilities]
-> Read ReferencesClientCapabilities
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS ReferencesClientCapabilities
readsPrec :: Int -> ReadS ReferencesClientCapabilities
$creadList :: ReadS [ReferencesClientCapabilities]
readList :: ReadS [ReferencesClientCapabilities]
$creadPrec :: ReadPrec ReferencesClientCapabilities
readPrec :: ReadPrec ReferencesClientCapabilities
$creadListPrec :: ReadPrec [ReferencesClientCapabilities]
readListPrec :: ReadPrec [ReferencesClientCapabilities]
Read, ReferencesClientCapabilities
-> ReferencesClientCapabilities -> Bool
(ReferencesClientCapabilities
 -> ReferencesClientCapabilities -> Bool)
-> (ReferencesClientCapabilities
    -> ReferencesClientCapabilities -> Bool)
-> Eq ReferencesClientCapabilities
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ReferencesClientCapabilities
-> ReferencesClientCapabilities -> Bool
== :: ReferencesClientCapabilities
-> ReferencesClientCapabilities -> Bool
$c/= :: ReferencesClientCapabilities
-> ReferencesClientCapabilities -> Bool
/= :: 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]
(Int -> ReadS ReferenceContext)
-> ReadS [ReferenceContext]
-> ReadPrec ReferenceContext
-> ReadPrec [ReferenceContext]
-> Read ReferenceContext
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS ReferenceContext
readsPrec :: Int -> ReadS ReferenceContext
$creadList :: ReadS [ReferenceContext]
readList :: ReadS [ReferenceContext]
$creadPrec :: ReadPrec ReferenceContext
readPrec :: ReadPrec ReferenceContext
$creadListPrec :: ReadPrec [ReferenceContext]
readListPrec :: ReadPrec [ReferenceContext]
Read,Int -> ReferenceContext -> ShowS
[ReferenceContext] -> ShowS
ReferenceContext -> String
(Int -> ReferenceContext -> ShowS)
-> (ReferenceContext -> String)
-> ([ReferenceContext] -> ShowS)
-> Show ReferenceContext
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ReferenceContext -> ShowS
showsPrec :: Int -> ReferenceContext -> ShowS
$cshow :: ReferenceContext -> String
show :: ReferenceContext -> String
$cshowList :: [ReferenceContext] -> ShowS
showList :: [ReferenceContext] -> ShowS
Show,ReferenceContext -> ReferenceContext -> Bool
(ReferenceContext -> ReferenceContext -> Bool)
-> (ReferenceContext -> ReferenceContext -> Bool)
-> Eq ReferenceContext
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ReferenceContext -> ReferenceContext -> Bool
== :: ReferenceContext -> ReferenceContext -> Bool
$c/= :: ReferenceContext -> ReferenceContext -> Bool
/= :: ReferenceContext -> ReferenceContext -> Bool
Eq)
deriveJSON lspOptions ''ReferenceContext

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