{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Language.LSP.Types.CodeAction where
import Data.Aeson.TH
import Data.Aeson.Types
import Data.Default
import Data.String
import Data.Text ( Text )
import qualified Data.Text as T
import Language.LSP.Types.Command
import Language.LSP.Types.Diagnostic
import Language.LSP.Types.Common
import Language.LSP.Types.Location
import Language.LSP.Types.Progress
import Language.LSP.Types.TextDocument
import Language.LSP.Types.Utils
import Language.LSP.Types.WorkspaceEdit
data CodeActionKind
=
CodeActionEmpty
|
CodeActionQuickFix
|
CodeActionRefactor
|
|
CodeActionRefactorInline
|
CodeActionRefactorRewrite
|
CodeActionSource
|
CodeActionSourceOrganizeImports
| CodeActionUnknown Text
deriving (ReadPrec [CodeActionKind]
ReadPrec CodeActionKind
Int -> ReadS CodeActionKind
ReadS [CodeActionKind]
(Int -> ReadS CodeActionKind)
-> ReadS [CodeActionKind]
-> ReadPrec CodeActionKind
-> ReadPrec [CodeActionKind]
-> Read CodeActionKind
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS CodeActionKind
readsPrec :: Int -> ReadS CodeActionKind
$creadList :: ReadS [CodeActionKind]
readList :: ReadS [CodeActionKind]
$creadPrec :: ReadPrec CodeActionKind
readPrec :: ReadPrec CodeActionKind
$creadListPrec :: ReadPrec [CodeActionKind]
readListPrec :: ReadPrec [CodeActionKind]
Read, Int -> CodeActionKind -> ShowS
[CodeActionKind] -> ShowS
CodeActionKind -> String
(Int -> CodeActionKind -> ShowS)
-> (CodeActionKind -> String)
-> ([CodeActionKind] -> ShowS)
-> Show CodeActionKind
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CodeActionKind -> ShowS
showsPrec :: Int -> CodeActionKind -> ShowS
$cshow :: CodeActionKind -> String
show :: CodeActionKind -> String
$cshowList :: [CodeActionKind] -> ShowS
showList :: [CodeActionKind] -> ShowS
Show, CodeActionKind -> CodeActionKind -> Bool
(CodeActionKind -> CodeActionKind -> Bool)
-> (CodeActionKind -> CodeActionKind -> Bool) -> Eq CodeActionKind
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CodeActionKind -> CodeActionKind -> Bool
== :: CodeActionKind -> CodeActionKind -> Bool
$c/= :: CodeActionKind -> CodeActionKind -> Bool
/= :: CodeActionKind -> CodeActionKind -> Bool
Eq)
fromHierarchicalString :: Text -> CodeActionKind
fromHierarchicalString :: Text -> CodeActionKind
fromHierarchicalString Text
t = case Text
t of
Text
"" -> CodeActionKind
CodeActionEmpty
Text
"quickfix" -> CodeActionKind
CodeActionQuickFix
Text
"refactor" -> CodeActionKind
CodeActionRefactor
Text
"refactor.extract" -> CodeActionKind
CodeActionRefactorExtract
Text
"refactor.inline" -> CodeActionKind
CodeActionRefactorInline
Text
"refactor.rewrite" -> CodeActionKind
CodeActionRefactorRewrite
Text
"source" -> CodeActionKind
CodeActionSource
Text
"source.organizeImports" -> CodeActionKind
CodeActionSourceOrganizeImports
Text
s -> Text -> CodeActionKind
CodeActionUnknown Text
s
toHierarchicalString :: CodeActionKind -> Text
toHierarchicalString :: CodeActionKind -> Text
toHierarchicalString CodeActionKind
k = case CodeActionKind
k of
CodeActionKind
CodeActionEmpty -> Text
""
CodeActionKind
CodeActionQuickFix -> Text
"quickfix"
CodeActionKind
CodeActionRefactor -> Text
"refactor"
CodeActionKind
CodeActionRefactorExtract -> Text
"refactor.extract"
CodeActionKind
CodeActionRefactorInline -> Text
"refactor.inline"
CodeActionKind
CodeActionRefactorRewrite -> Text
"refactor.rewrite"
CodeActionKind
CodeActionSource -> Text
"source"
CodeActionKind
CodeActionSourceOrganizeImports -> Text
"source.organizeImports"
(CodeActionUnknown Text
s) -> Text
s
instance IsString CodeActionKind where
fromString :: String -> CodeActionKind
fromString = Text -> CodeActionKind
fromHierarchicalString (Text -> CodeActionKind)
-> (String -> Text) -> String -> CodeActionKind
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Text
T.pack
instance ToJSON CodeActionKind where
toJSON :: CodeActionKind -> Value
toJSON = Text -> Value
String (Text -> Value)
-> (CodeActionKind -> Text) -> CodeActionKind -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CodeActionKind -> Text
toHierarchicalString
instance FromJSON CodeActionKind where
parseJSON :: Value -> Parser CodeActionKind
parseJSON (String Text
s) = CodeActionKind -> Parser CodeActionKind
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CodeActionKind -> Parser CodeActionKind)
-> CodeActionKind -> Parser CodeActionKind
forall a b. (a -> b) -> a -> b
$ Text -> CodeActionKind
fromHierarchicalString Text
s
parseJSON Value
_ = String -> Parser CodeActionKind
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail String
"CodeActionKind"
codeActionKindSubsumes :: CodeActionKind -> CodeActionKind -> Bool
codeActionKindSubsumes :: CodeActionKind -> CodeActionKind -> Bool
codeActionKindSubsumes CodeActionKind
parent CodeActionKind
child = CodeActionKind -> Text
toHierarchicalString CodeActionKind
parent Text -> Text -> Bool
`T.isPrefixOf` CodeActionKind -> Text
toHierarchicalString CodeActionKind
child
specCodeActionKinds :: [CodeActionKind]
specCodeActionKinds :: [CodeActionKind]
specCodeActionKinds = [
CodeActionKind
CodeActionQuickFix
, CodeActionKind
CodeActionRefactor
, CodeActionKind
CodeActionRefactorExtract
, CodeActionKind
CodeActionRefactorInline
, CodeActionKind
CodeActionRefactorRewrite
, CodeActionKind
CodeActionSource
, CodeActionKind
CodeActionSourceOrganizeImports
]
data CodeActionKindClientCapabilities =
CodeActionKindClientCapabilities
{
CodeActionKindClientCapabilities -> List CodeActionKind
_valueSet :: List CodeActionKind
} deriving (Int -> CodeActionKindClientCapabilities -> ShowS
[CodeActionKindClientCapabilities] -> ShowS
CodeActionKindClientCapabilities -> String
(Int -> CodeActionKindClientCapabilities -> ShowS)
-> (CodeActionKindClientCapabilities -> String)
-> ([CodeActionKindClientCapabilities] -> ShowS)
-> Show CodeActionKindClientCapabilities
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CodeActionKindClientCapabilities -> ShowS
showsPrec :: Int -> CodeActionKindClientCapabilities -> ShowS
$cshow :: CodeActionKindClientCapabilities -> String
show :: CodeActionKindClientCapabilities -> String
$cshowList :: [CodeActionKindClientCapabilities] -> ShowS
showList :: [CodeActionKindClientCapabilities] -> ShowS
Show, ReadPrec [CodeActionKindClientCapabilities]
ReadPrec CodeActionKindClientCapabilities
Int -> ReadS CodeActionKindClientCapabilities
ReadS [CodeActionKindClientCapabilities]
(Int -> ReadS CodeActionKindClientCapabilities)
-> ReadS [CodeActionKindClientCapabilities]
-> ReadPrec CodeActionKindClientCapabilities
-> ReadPrec [CodeActionKindClientCapabilities]
-> Read CodeActionKindClientCapabilities
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS CodeActionKindClientCapabilities
readsPrec :: Int -> ReadS CodeActionKindClientCapabilities
$creadList :: ReadS [CodeActionKindClientCapabilities]
readList :: ReadS [CodeActionKindClientCapabilities]
$creadPrec :: ReadPrec CodeActionKindClientCapabilities
readPrec :: ReadPrec CodeActionKindClientCapabilities
$creadListPrec :: ReadPrec [CodeActionKindClientCapabilities]
readListPrec :: ReadPrec [CodeActionKindClientCapabilities]
Read, CodeActionKindClientCapabilities
-> CodeActionKindClientCapabilities -> Bool
(CodeActionKindClientCapabilities
-> CodeActionKindClientCapabilities -> Bool)
-> (CodeActionKindClientCapabilities
-> CodeActionKindClientCapabilities -> Bool)
-> Eq CodeActionKindClientCapabilities
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CodeActionKindClientCapabilities
-> CodeActionKindClientCapabilities -> Bool
== :: CodeActionKindClientCapabilities
-> CodeActionKindClientCapabilities -> Bool
$c/= :: CodeActionKindClientCapabilities
-> CodeActionKindClientCapabilities -> Bool
/= :: CodeActionKindClientCapabilities
-> CodeActionKindClientCapabilities -> Bool
Eq)
deriveJSON lspOptions ''CodeActionKindClientCapabilities
instance Default CodeActionKindClientCapabilities where
def :: CodeActionKindClientCapabilities
def = List CodeActionKind -> CodeActionKindClientCapabilities
CodeActionKindClientCapabilities ([CodeActionKind] -> List CodeActionKind
forall a. [a] -> List a
List [CodeActionKind]
specCodeActionKinds)
data CodeActionLiteralSupport =
CodeActionLiteralSupport
{ CodeActionLiteralSupport -> CodeActionKindClientCapabilities
_codeActionKind :: CodeActionKindClientCapabilities
} deriving (Int -> CodeActionLiteralSupport -> ShowS
[CodeActionLiteralSupport] -> ShowS
CodeActionLiteralSupport -> String
(Int -> CodeActionLiteralSupport -> ShowS)
-> (CodeActionLiteralSupport -> String)
-> ([CodeActionLiteralSupport] -> ShowS)
-> Show CodeActionLiteralSupport
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CodeActionLiteralSupport -> ShowS
showsPrec :: Int -> CodeActionLiteralSupport -> ShowS
$cshow :: CodeActionLiteralSupport -> String
show :: CodeActionLiteralSupport -> String
$cshowList :: [CodeActionLiteralSupport] -> ShowS
showList :: [CodeActionLiteralSupport] -> ShowS
Show, ReadPrec [CodeActionLiteralSupport]
ReadPrec CodeActionLiteralSupport
Int -> ReadS CodeActionLiteralSupport
ReadS [CodeActionLiteralSupport]
(Int -> ReadS CodeActionLiteralSupport)
-> ReadS [CodeActionLiteralSupport]
-> ReadPrec CodeActionLiteralSupport
-> ReadPrec [CodeActionLiteralSupport]
-> Read CodeActionLiteralSupport
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS CodeActionLiteralSupport
readsPrec :: Int -> ReadS CodeActionLiteralSupport
$creadList :: ReadS [CodeActionLiteralSupport]
readList :: ReadS [CodeActionLiteralSupport]
$creadPrec :: ReadPrec CodeActionLiteralSupport
readPrec :: ReadPrec CodeActionLiteralSupport
$creadListPrec :: ReadPrec [CodeActionLiteralSupport]
readListPrec :: ReadPrec [CodeActionLiteralSupport]
Read, CodeActionLiteralSupport -> CodeActionLiteralSupport -> Bool
(CodeActionLiteralSupport -> CodeActionLiteralSupport -> Bool)
-> (CodeActionLiteralSupport -> CodeActionLiteralSupport -> Bool)
-> Eq CodeActionLiteralSupport
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CodeActionLiteralSupport -> CodeActionLiteralSupport -> Bool
== :: CodeActionLiteralSupport -> CodeActionLiteralSupport -> Bool
$c/= :: CodeActionLiteralSupport -> CodeActionLiteralSupport -> Bool
/= :: CodeActionLiteralSupport -> CodeActionLiteralSupport -> Bool
Eq)
deriveJSON lspOptions ''CodeActionLiteralSupport
data CodeActionResolveClientCapabilities =
CodeActionResolveClientCapabilities
{ CodeActionResolveClientCapabilities -> List Text
_properties :: List Text
} deriving (Int -> CodeActionResolveClientCapabilities -> ShowS
[CodeActionResolveClientCapabilities] -> ShowS
CodeActionResolveClientCapabilities -> String
(Int -> CodeActionResolveClientCapabilities -> ShowS)
-> (CodeActionResolveClientCapabilities -> String)
-> ([CodeActionResolveClientCapabilities] -> ShowS)
-> Show CodeActionResolveClientCapabilities
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CodeActionResolveClientCapabilities -> ShowS
showsPrec :: Int -> CodeActionResolveClientCapabilities -> ShowS
$cshow :: CodeActionResolveClientCapabilities -> String
show :: CodeActionResolveClientCapabilities -> String
$cshowList :: [CodeActionResolveClientCapabilities] -> ShowS
showList :: [CodeActionResolveClientCapabilities] -> ShowS
Show, ReadPrec [CodeActionResolveClientCapabilities]
ReadPrec CodeActionResolveClientCapabilities
Int -> ReadS CodeActionResolveClientCapabilities
ReadS [CodeActionResolveClientCapabilities]
(Int -> ReadS CodeActionResolveClientCapabilities)
-> ReadS [CodeActionResolveClientCapabilities]
-> ReadPrec CodeActionResolveClientCapabilities
-> ReadPrec [CodeActionResolveClientCapabilities]
-> Read CodeActionResolveClientCapabilities
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS CodeActionResolveClientCapabilities
readsPrec :: Int -> ReadS CodeActionResolveClientCapabilities
$creadList :: ReadS [CodeActionResolveClientCapabilities]
readList :: ReadS [CodeActionResolveClientCapabilities]
$creadPrec :: ReadPrec CodeActionResolveClientCapabilities
readPrec :: ReadPrec CodeActionResolveClientCapabilities
$creadListPrec :: ReadPrec [CodeActionResolveClientCapabilities]
readListPrec :: ReadPrec [CodeActionResolveClientCapabilities]
Read, CodeActionResolveClientCapabilities
-> CodeActionResolveClientCapabilities -> Bool
(CodeActionResolveClientCapabilities
-> CodeActionResolveClientCapabilities -> Bool)
-> (CodeActionResolveClientCapabilities
-> CodeActionResolveClientCapabilities -> Bool)
-> Eq CodeActionResolveClientCapabilities
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CodeActionResolveClientCapabilities
-> CodeActionResolveClientCapabilities -> Bool
== :: CodeActionResolveClientCapabilities
-> CodeActionResolveClientCapabilities -> Bool
$c/= :: CodeActionResolveClientCapabilities
-> CodeActionResolveClientCapabilities -> Bool
/= :: CodeActionResolveClientCapabilities
-> CodeActionResolveClientCapabilities -> Bool
Eq)
deriveJSON lspOptions ''CodeActionResolveClientCapabilities
data CodeActionClientCapabilities = CodeActionClientCapabilities
{
CodeActionClientCapabilities -> Maybe Bool
_dynamicRegistration :: Maybe Bool,
CodeActionClientCapabilities -> Maybe CodeActionLiteralSupport
_codeActionLiteralSupport :: Maybe CodeActionLiteralSupport,
CodeActionClientCapabilities -> Maybe Bool
_isPreferredSupport :: Maybe Bool,
CodeActionClientCapabilities -> Maybe Bool
_disabledSupport :: Maybe Bool,
CodeActionClientCapabilities -> Maybe Bool
_dataSupport :: Maybe Bool,
CodeActionClientCapabilities
-> Maybe CodeActionResolveClientCapabilities
_resolveSupport :: Maybe CodeActionResolveClientCapabilities,
CodeActionClientCapabilities -> Maybe Bool
_honorsChangeAnnotations :: Maybe Bool
}
deriving (Int -> CodeActionClientCapabilities -> ShowS
[CodeActionClientCapabilities] -> ShowS
CodeActionClientCapabilities -> String
(Int -> CodeActionClientCapabilities -> ShowS)
-> (CodeActionClientCapabilities -> String)
-> ([CodeActionClientCapabilities] -> ShowS)
-> Show CodeActionClientCapabilities
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CodeActionClientCapabilities -> ShowS
showsPrec :: Int -> CodeActionClientCapabilities -> ShowS
$cshow :: CodeActionClientCapabilities -> String
show :: CodeActionClientCapabilities -> String
$cshowList :: [CodeActionClientCapabilities] -> ShowS
showList :: [CodeActionClientCapabilities] -> ShowS
Show, ReadPrec [CodeActionClientCapabilities]
ReadPrec CodeActionClientCapabilities
Int -> ReadS CodeActionClientCapabilities
ReadS [CodeActionClientCapabilities]
(Int -> ReadS CodeActionClientCapabilities)
-> ReadS [CodeActionClientCapabilities]
-> ReadPrec CodeActionClientCapabilities
-> ReadPrec [CodeActionClientCapabilities]
-> Read CodeActionClientCapabilities
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS CodeActionClientCapabilities
readsPrec :: Int -> ReadS CodeActionClientCapabilities
$creadList :: ReadS [CodeActionClientCapabilities]
readList :: ReadS [CodeActionClientCapabilities]
$creadPrec :: ReadPrec CodeActionClientCapabilities
readPrec :: ReadPrec CodeActionClientCapabilities
$creadListPrec :: ReadPrec [CodeActionClientCapabilities]
readListPrec :: ReadPrec [CodeActionClientCapabilities]
Read, CodeActionClientCapabilities
-> CodeActionClientCapabilities -> Bool
(CodeActionClientCapabilities
-> CodeActionClientCapabilities -> Bool)
-> (CodeActionClientCapabilities
-> CodeActionClientCapabilities -> Bool)
-> Eq CodeActionClientCapabilities
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CodeActionClientCapabilities
-> CodeActionClientCapabilities -> Bool
== :: CodeActionClientCapabilities
-> CodeActionClientCapabilities -> Bool
$c/= :: CodeActionClientCapabilities
-> CodeActionClientCapabilities -> Bool
/= :: CodeActionClientCapabilities
-> CodeActionClientCapabilities -> Bool
Eq)
deriveJSON lspOptions ''CodeActionClientCapabilities
makeExtendingDatatype "CodeActionOptions" [''WorkDoneProgressOptions]
[("_codeActionKinds", [t| Maybe (List CodeActionKind) |]), ("_resolveProvider", [t| Maybe Bool |]) ]
deriveJSON lspOptions ''CodeActionOptions
makeExtendingDatatype "CodeActionRegistrationOptions"
[ ''TextDocumentRegistrationOptions
, ''CodeActionOptions
] []
deriveJSON lspOptions ''CodeActionRegistrationOptions
data CodeActionContext = CodeActionContext
{
CodeActionContext -> List Diagnostic
_diagnostics :: List Diagnostic
, CodeActionContext -> Maybe (List CodeActionKind)
_only :: Maybe (List CodeActionKind)
}
deriving (ReadPrec [CodeActionContext]
ReadPrec CodeActionContext
Int -> ReadS CodeActionContext
ReadS [CodeActionContext]
(Int -> ReadS CodeActionContext)
-> ReadS [CodeActionContext]
-> ReadPrec CodeActionContext
-> ReadPrec [CodeActionContext]
-> Read CodeActionContext
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS CodeActionContext
readsPrec :: Int -> ReadS CodeActionContext
$creadList :: ReadS [CodeActionContext]
readList :: ReadS [CodeActionContext]
$creadPrec :: ReadPrec CodeActionContext
readPrec :: ReadPrec CodeActionContext
$creadListPrec :: ReadPrec [CodeActionContext]
readListPrec :: ReadPrec [CodeActionContext]
Read, Int -> CodeActionContext -> ShowS
[CodeActionContext] -> ShowS
CodeActionContext -> String
(Int -> CodeActionContext -> ShowS)
-> (CodeActionContext -> String)
-> ([CodeActionContext] -> ShowS)
-> Show CodeActionContext
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CodeActionContext -> ShowS
showsPrec :: Int -> CodeActionContext -> ShowS
$cshow :: CodeActionContext -> String
show :: CodeActionContext -> String
$cshowList :: [CodeActionContext] -> ShowS
showList :: [CodeActionContext] -> ShowS
Show, CodeActionContext -> CodeActionContext -> Bool
(CodeActionContext -> CodeActionContext -> Bool)
-> (CodeActionContext -> CodeActionContext -> Bool)
-> Eq CodeActionContext
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CodeActionContext -> CodeActionContext -> Bool
== :: CodeActionContext -> CodeActionContext -> Bool
$c/= :: CodeActionContext -> CodeActionContext -> Bool
/= :: CodeActionContext -> CodeActionContext -> Bool
Eq)
deriveJSON lspOptions ''CodeActionContext
makeExtendingDatatype "CodeActionParams"
[ ''WorkDoneProgressParams
, ''PartialResultParams
]
[ ("_textDocument", [t|TextDocumentIdentifier|]),
("_range", [t|Range|]),
("_context", [t|CodeActionContext|])
]
deriveJSON lspOptions ''CodeActionParams
newtype Reason = Reason {Reason -> Text
_reason :: Text}
deriving (ReadPrec [Reason]
ReadPrec Reason
Int -> ReadS Reason
ReadS [Reason]
(Int -> ReadS Reason)
-> ReadS [Reason]
-> ReadPrec Reason
-> ReadPrec [Reason]
-> Read Reason
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS Reason
readsPrec :: Int -> ReadS Reason
$creadList :: ReadS [Reason]
readList :: ReadS [Reason]
$creadPrec :: ReadPrec Reason
readPrec :: ReadPrec Reason
$creadListPrec :: ReadPrec [Reason]
readListPrec :: ReadPrec [Reason]
Read, Int -> Reason -> ShowS
[Reason] -> ShowS
Reason -> String
(Int -> Reason -> ShowS)
-> (Reason -> String) -> ([Reason] -> ShowS) -> Show Reason
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Reason -> ShowS
showsPrec :: Int -> Reason -> ShowS
$cshow :: Reason -> String
show :: Reason -> String
$cshowList :: [Reason] -> ShowS
showList :: [Reason] -> ShowS
Show, Reason -> Reason -> Bool
(Reason -> Reason -> Bool)
-> (Reason -> Reason -> Bool) -> Eq Reason
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Reason -> Reason -> Bool
== :: Reason -> Reason -> Bool
$c/= :: Reason -> Reason -> Bool
/= :: Reason -> Reason -> Bool
Eq)
deriveJSON lspOptions ''Reason
data CodeAction =
CodeAction
{
CodeAction -> Text
_title :: Text,
CodeAction -> Maybe CodeActionKind
_kind :: Maybe CodeActionKind,
CodeAction -> Maybe (List Diagnostic)
_diagnostics :: Maybe (List Diagnostic),
CodeAction -> Maybe Bool
_isPreferred :: Maybe Bool,
CodeAction -> Maybe Reason
_disabled :: Maybe Reason,
CodeAction -> Maybe WorkspaceEdit
_edit :: Maybe WorkspaceEdit,
CodeAction -> Maybe Command
_command :: Maybe Command,
CodeAction -> Maybe Value
_xdata :: Maybe Value
}
deriving (ReadPrec [CodeAction]
ReadPrec CodeAction
Int -> ReadS CodeAction
ReadS [CodeAction]
(Int -> ReadS CodeAction)
-> ReadS [CodeAction]
-> ReadPrec CodeAction
-> ReadPrec [CodeAction]
-> Read CodeAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS CodeAction
readsPrec :: Int -> ReadS CodeAction
$creadList :: ReadS [CodeAction]
readList :: ReadS [CodeAction]
$creadPrec :: ReadPrec CodeAction
readPrec :: ReadPrec CodeAction
$creadListPrec :: ReadPrec [CodeAction]
readListPrec :: ReadPrec [CodeAction]
Read, Int -> CodeAction -> ShowS
[CodeAction] -> ShowS
CodeAction -> String
(Int -> CodeAction -> ShowS)
-> (CodeAction -> String)
-> ([CodeAction] -> ShowS)
-> Show CodeAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CodeAction -> ShowS
showsPrec :: Int -> CodeAction -> ShowS
$cshow :: CodeAction -> String
show :: CodeAction -> String
$cshowList :: [CodeAction] -> ShowS
showList :: [CodeAction] -> ShowS
Show, CodeAction -> CodeAction -> Bool
(CodeAction -> CodeAction -> Bool)
-> (CodeAction -> CodeAction -> Bool) -> Eq CodeAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CodeAction -> CodeAction -> Bool
== :: CodeAction -> CodeAction -> Bool
$c/= :: CodeAction -> CodeAction -> Bool
/= :: CodeAction -> CodeAction -> Bool
Eq)
deriveJSON lspOptions ''CodeAction