{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DuplicateRecordFields #-}
module Language.LSP.Types.DocumentColor where
import Data.Aeson.TH
import Data.Text (Text)
import Language.LSP.Types.Common
import Language.LSP.Types.Location
import Language.LSP.Types.Progress
import Language.LSP.Types.StaticRegistrationOptions
import Language.LSP.Types.TextDocument
import Language.LSP.Types.Utils
import Language.LSP.Types.WorkspaceEdit
data DocumentColorClientCapabilities =
DocumentColorClientCapabilities
{
_dynamicRegistration :: Maybe Bool
} deriving (Read, Show, Eq)
deriveJSON lspOptions ''DocumentColorClientCapabilities
makeExtendingDatatype "DocumentColorOptions" [''WorkDoneProgressOptions] []
deriveJSON lspOptions ''DocumentColorOptions
makeExtendingDatatype "DocumentColorRegistrationOptions"
[ ''TextDocumentRegistrationOptions
, ''StaticRegistrationOptions
, ''DocumentColorOptions
] []
deriveJSON lspOptions ''DocumentColorRegistrationOptions
makeExtendingDatatype "DocumentColorParams"
[ ''WorkDoneProgressParams
, ''PartialResultParams
]
[("_textDocument", [t| TextDocumentIdentifier |])]
deriveJSON lspOptions ''DocumentColorParams
data Color =
Color
{ _red :: Int
, _green :: Int
, _blue :: Int
, _alpha :: Int
} deriving (Read, Show, Eq)
deriveJSON lspOptions ''Color
data ColorInformation =
ColorInformation
{ _range :: Range
, _color :: Color
} deriving (Read, Show, Eq)
deriveJSON lspOptions ''ColorInformation
makeExtendingDatatype "ColorPresentationParams"
[ ''WorkDoneProgressParams
, ''PartialResultParams
]
[ ("_textDocument", [t| TextDocumentIdentifier |])
, ("_color", [t| Color |])
, ("_range", [t| Range |])
]
deriveJSON lspOptions ''ColorPresentationParams
data ColorPresentation =
ColorPresentation
{
_label :: Text
, _textEdit :: Maybe TextEdit
, _additionalTextEdits :: Maybe (List TextEdit)
} deriving (Read, Show, Eq)
deriveJSON lspOptions ''ColorPresentation