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

import Data.Aeson
import Data.Aeson.TH
import Data.Text (Text)
import Language.LSP.Types.Common
import Language.LSP.Types.Utils

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

data DidChangeConfigurationClientCapabilities =
  DidChangeConfigurationClientCapabilities
    { DidChangeConfigurationClientCapabilities -> Maybe Bool
_dynamicRegistration :: Maybe Bool -- ^Did change configuration
                                         -- notification supports dynamic
                                         -- registration.
    } deriving (Int -> DidChangeConfigurationClientCapabilities -> ShowS
[DidChangeConfigurationClientCapabilities] -> ShowS
DidChangeConfigurationClientCapabilities -> String
(Int -> DidChangeConfigurationClientCapabilities -> ShowS)
-> (DidChangeConfigurationClientCapabilities -> String)
-> ([DidChangeConfigurationClientCapabilities] -> ShowS)
-> Show DidChangeConfigurationClientCapabilities
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DidChangeConfigurationClientCapabilities] -> ShowS
$cshowList :: [DidChangeConfigurationClientCapabilities] -> ShowS
show :: DidChangeConfigurationClientCapabilities -> String
$cshow :: DidChangeConfigurationClientCapabilities -> String
showsPrec :: Int -> DidChangeConfigurationClientCapabilities -> ShowS
$cshowsPrec :: Int -> DidChangeConfigurationClientCapabilities -> ShowS
Show, ReadPrec [DidChangeConfigurationClientCapabilities]
ReadPrec DidChangeConfigurationClientCapabilities
Int -> ReadS DidChangeConfigurationClientCapabilities
ReadS [DidChangeConfigurationClientCapabilities]
(Int -> ReadS DidChangeConfigurationClientCapabilities)
-> ReadS [DidChangeConfigurationClientCapabilities]
-> ReadPrec DidChangeConfigurationClientCapabilities
-> ReadPrec [DidChangeConfigurationClientCapabilities]
-> Read DidChangeConfigurationClientCapabilities
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DidChangeConfigurationClientCapabilities]
$creadListPrec :: ReadPrec [DidChangeConfigurationClientCapabilities]
readPrec :: ReadPrec DidChangeConfigurationClientCapabilities
$creadPrec :: ReadPrec DidChangeConfigurationClientCapabilities
readList :: ReadS [DidChangeConfigurationClientCapabilities]
$creadList :: ReadS [DidChangeConfigurationClientCapabilities]
readsPrec :: Int -> ReadS DidChangeConfigurationClientCapabilities
$creadsPrec :: Int -> ReadS DidChangeConfigurationClientCapabilities
Read, DidChangeConfigurationClientCapabilities
-> DidChangeConfigurationClientCapabilities -> Bool
(DidChangeConfigurationClientCapabilities
 -> DidChangeConfigurationClientCapabilities -> Bool)
-> (DidChangeConfigurationClientCapabilities
    -> DidChangeConfigurationClientCapabilities -> Bool)
-> Eq DidChangeConfigurationClientCapabilities
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DidChangeConfigurationClientCapabilities
-> DidChangeConfigurationClientCapabilities -> Bool
$c/= :: DidChangeConfigurationClientCapabilities
-> DidChangeConfigurationClientCapabilities -> Bool
== :: DidChangeConfigurationClientCapabilities
-> DidChangeConfigurationClientCapabilities -> Bool
$c== :: DidChangeConfigurationClientCapabilities
-> DidChangeConfigurationClientCapabilities -> Bool
Eq)

deriveJSON lspOptions ''DidChangeConfigurationClientCapabilities

data DidChangeConfigurationParams =
  DidChangeConfigurationParams
  { DidChangeConfigurationParams -> Value
_settings :: Value -- ^ The actual changed settings
  } deriving (Int -> DidChangeConfigurationParams -> ShowS
[DidChangeConfigurationParams] -> ShowS
DidChangeConfigurationParams -> String
(Int -> DidChangeConfigurationParams -> ShowS)
-> (DidChangeConfigurationParams -> String)
-> ([DidChangeConfigurationParams] -> ShowS)
-> Show DidChangeConfigurationParams
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DidChangeConfigurationParams] -> ShowS
$cshowList :: [DidChangeConfigurationParams] -> ShowS
show :: DidChangeConfigurationParams -> String
$cshow :: DidChangeConfigurationParams -> String
showsPrec :: Int -> DidChangeConfigurationParams -> ShowS
$cshowsPrec :: Int -> DidChangeConfigurationParams -> ShowS
Show, ReadPrec [DidChangeConfigurationParams]
ReadPrec DidChangeConfigurationParams
Int -> ReadS DidChangeConfigurationParams
ReadS [DidChangeConfigurationParams]
(Int -> ReadS DidChangeConfigurationParams)
-> ReadS [DidChangeConfigurationParams]
-> ReadPrec DidChangeConfigurationParams
-> ReadPrec [DidChangeConfigurationParams]
-> Read DidChangeConfigurationParams
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DidChangeConfigurationParams]
$creadListPrec :: ReadPrec [DidChangeConfigurationParams]
readPrec :: ReadPrec DidChangeConfigurationParams
$creadPrec :: ReadPrec DidChangeConfigurationParams
readList :: ReadS [DidChangeConfigurationParams]
$creadList :: ReadS [DidChangeConfigurationParams]
readsPrec :: Int -> ReadS DidChangeConfigurationParams
$creadsPrec :: Int -> ReadS DidChangeConfigurationParams
Read, DidChangeConfigurationParams
-> DidChangeConfigurationParams -> Bool
(DidChangeConfigurationParams
 -> DidChangeConfigurationParams -> Bool)
-> (DidChangeConfigurationParams
    -> DidChangeConfigurationParams -> Bool)
-> Eq DidChangeConfigurationParams
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DidChangeConfigurationParams
-> DidChangeConfigurationParams -> Bool
$c/= :: DidChangeConfigurationParams
-> DidChangeConfigurationParams -> Bool
== :: DidChangeConfigurationParams
-> DidChangeConfigurationParams -> Bool
$c== :: DidChangeConfigurationParams
-> DidChangeConfigurationParams -> Bool
Eq)

deriveJSON lspOptions ''DidChangeConfigurationParams

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

data ConfigurationItem =
  ConfigurationItem
    { ConfigurationItem -> Maybe Text
_scopeUri :: Maybe Text -- ^ The scope to get the configuration section for.
    , ConfigurationItem -> Maybe Text
_section  :: Maybe Text -- ^ The configuration section asked for.
    } deriving (Int -> ConfigurationItem -> ShowS
[ConfigurationItem] -> ShowS
ConfigurationItem -> String
(Int -> ConfigurationItem -> ShowS)
-> (ConfigurationItem -> String)
-> ([ConfigurationItem] -> ShowS)
-> Show ConfigurationItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConfigurationItem] -> ShowS
$cshowList :: [ConfigurationItem] -> ShowS
show :: ConfigurationItem -> String
$cshow :: ConfigurationItem -> String
showsPrec :: Int -> ConfigurationItem -> ShowS
$cshowsPrec :: Int -> ConfigurationItem -> ShowS
Show, ReadPrec [ConfigurationItem]
ReadPrec ConfigurationItem
Int -> ReadS ConfigurationItem
ReadS [ConfigurationItem]
(Int -> ReadS ConfigurationItem)
-> ReadS [ConfigurationItem]
-> ReadPrec ConfigurationItem
-> ReadPrec [ConfigurationItem]
-> Read ConfigurationItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConfigurationItem]
$creadListPrec :: ReadPrec [ConfigurationItem]
readPrec :: ReadPrec ConfigurationItem
$creadPrec :: ReadPrec ConfigurationItem
readList :: ReadS [ConfigurationItem]
$creadList :: ReadS [ConfigurationItem]
readsPrec :: Int -> ReadS ConfigurationItem
$creadsPrec :: Int -> ReadS ConfigurationItem
Read, ConfigurationItem -> ConfigurationItem -> Bool
(ConfigurationItem -> ConfigurationItem -> Bool)
-> (ConfigurationItem -> ConfigurationItem -> Bool)
-> Eq ConfigurationItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConfigurationItem -> ConfigurationItem -> Bool
$c/= :: ConfigurationItem -> ConfigurationItem -> Bool
== :: ConfigurationItem -> ConfigurationItem -> Bool
$c== :: ConfigurationItem -> ConfigurationItem -> Bool
Eq)

deriveJSON lspOptions ''ConfigurationItem

data ConfigurationParams =
  ConfigurationParams
    { ConfigurationParams -> List ConfigurationItem
_items :: List ConfigurationItem
    } deriving (Int -> ConfigurationParams -> ShowS
[ConfigurationParams] -> ShowS
ConfigurationParams -> String
(Int -> ConfigurationParams -> ShowS)
-> (ConfigurationParams -> String)
-> ([ConfigurationParams] -> ShowS)
-> Show ConfigurationParams
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConfigurationParams] -> ShowS
$cshowList :: [ConfigurationParams] -> ShowS
show :: ConfigurationParams -> String
$cshow :: ConfigurationParams -> String
showsPrec :: Int -> ConfigurationParams -> ShowS
$cshowsPrec :: Int -> ConfigurationParams -> ShowS
Show, ReadPrec [ConfigurationParams]
ReadPrec ConfigurationParams
Int -> ReadS ConfigurationParams
ReadS [ConfigurationParams]
(Int -> ReadS ConfigurationParams)
-> ReadS [ConfigurationParams]
-> ReadPrec ConfigurationParams
-> ReadPrec [ConfigurationParams]
-> Read ConfigurationParams
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConfigurationParams]
$creadListPrec :: ReadPrec [ConfigurationParams]
readPrec :: ReadPrec ConfigurationParams
$creadPrec :: ReadPrec ConfigurationParams
readList :: ReadS [ConfigurationParams]
$creadList :: ReadS [ConfigurationParams]
readsPrec :: Int -> ReadS ConfigurationParams
$creadsPrec :: Int -> ReadS ConfigurationParams
Read, ConfigurationParams -> ConfigurationParams -> Bool
(ConfigurationParams -> ConfigurationParams -> Bool)
-> (ConfigurationParams -> ConfigurationParams -> Bool)
-> Eq ConfigurationParams
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConfigurationParams -> ConfigurationParams -> Bool
$c/= :: ConfigurationParams -> ConfigurationParams -> Bool
== :: ConfigurationParams -> ConfigurationParams -> Bool
$c== :: ConfigurationParams -> ConfigurationParams -> Bool
Eq)
deriveJSON lspOptions ''ConfigurationParams