{-# 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
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]
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
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
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]
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
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
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]
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
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
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]
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
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