hls-plugin-api-2.1.0.0: Haskell Language Server API for plugin communication
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ide.Plugin.Resolve

Synopsis

Documentation

mkCodeActionHandlerWithResolve :: forall ideState a. FromJSON a => Recorder (WithPriority Log) -> PluginMethodHandler ideState 'Method_TextDocumentCodeAction -> ResolveFunction ideState a 'Method_CodeActionResolve -> PluginHandlers ideState Source #

When provided with both a codeAction provider and an affiliated codeAction resolve provider, this function creates a handler that automatically uses your resolve provider to fill out you original codeAction if the client doesn't have codeAction resolve support. This means you don't have to check whether the client supports resolve and act accordingly in your own providers.

mkCodeActionWithResolveAndCommand :: forall ideState a. FromJSON a => Recorder (WithPriority Log) -> PluginId -> PluginMethodHandler ideState 'Method_TextDocumentCodeAction -> ResolveFunction ideState a 'Method_CodeActionResolve -> ([PluginCommand ideState], PluginHandlers ideState) Source #

When provided with both a codeAction provider with a data field and a resolve provider, this function creates a handler that creates a command that uses your resolve if the client doesn't have code action resolve support. This means you don't have to check whether the client supports resolve and act accordingly in your own providers. see Note [Code action resolve fallback to commands] Also: This helper only works with workspace edits, not commands. Any command set either in the original code action or in the resolve will be ignored.