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