java.lang.Object
org.eclipse.lemminx.extensions.relaxng.grammar.rnc.codeaction.RNCCodeActions

public class RNCCodeActions extends Object
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

    Constructors
    Constructor
    Description
    Creates the code action dispatcher and registers all built-in participants.
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    org.eclipse.lsp4j.CodeAction
    resolveCodeAction(RNCDocument rncDocument, org.eclipse.lsp4j.CodeAction unresolved, boolean snippetSupported)
    Resolves a deferred code action by computing its workspace edit.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RNCCodeActions

      public RNCCodeActions(IRNCDocumentProvider documentProvider)
      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 - true if the client supports snippet syntax.
      resolveSupported - true if 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 - true if the client supports snippet syntax.
      Returns:
      the resolved code action with its edit populated.