Class RNCCodeActions
java.lang.Object
org.eclipse.lemminx.extensions.relaxng.grammar.rnc.codeaction.RNCCodeActions
Dispatches RNC code actions to the appropriate
IRNCCodeActionParticipant based on the diagnostic's error code.
Maintains a registry of code action participants, one per
RNCErrorCode. When the editor requests code actions for a
diagnostic, this class looks up the matching participant and delegates
to it.
Use case: the user sees a diagnostic "unclosed-block" and requests
quick fixes. This class finds the unclosed_blockCodeAction
participant and invokes it to generate the "Add closing '}'" action.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRNCCodeActions(IRNCDocumentProvider documentProvider) Creates the code action dispatcher and registers all built-in participants. -
Method Summary
Modifier and TypeMethodDescriptionList<org.eclipse.lsp4j.CodeAction> doCodeActions(RNCDocument rncDocument, org.eclipse.lsp4j.Range range, org.eclipse.lsp4j.CodeActionContext context, boolean snippetSupported, boolean resolveSupported, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker) Computes code actions for the given range and diagnostic context.org.eclipse.lsp4j.CodeActionresolveCodeAction(RNCDocument rncDocument, org.eclipse.lsp4j.CodeAction unresolved, boolean snippetSupported) Resolves a deferred code action by computing its workspace edit.
-
Constructor Details
-
RNCCodeActions
Creates the code action dispatcher and registers all built-in participants.
-
-
Method Details
-
doCodeActions
public List<org.eclipse.lsp4j.CodeAction> doCodeActions(RNCDocument rncDocument, org.eclipse.lsp4j.Range range, org.eclipse.lsp4j.CodeActionContext context, boolean snippetSupported, boolean resolveSupported, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker) Computes code actions for the given range and diagnostic context.- Parameters:
rncDocument- the parsed RNC document.range- the selected range in the document.context- the code action context containing diagnostics.snippetSupported-trueif the client supports snippet syntax.resolveSupported-trueif the client supports lazy code action resolve.cancelChecker- the cancel checker.- Returns:
- the list of applicable code actions.
-
resolveCodeAction
public org.eclipse.lsp4j.CodeAction resolveCodeAction(RNCDocument rncDocument, org.eclipse.lsp4j.CodeAction unresolved, boolean snippetSupported) Resolves a deferred code action by computing its workspace edit.- Parameters:
rncDocument- the parsed RNC document.unresolved- the code action to resolve.snippetSupported-trueif the client supports snippet syntax.- Returns:
- the resolved code action with its edit populated.
-