Class unclosed_blockCodeAction

java.lang.Object
org.eclipse.lemminx.extensions.relaxng.grammar.rnc.codeaction.unclosed_blockCodeAction
All Implemented Interfaces:
IRNCCodeActionParticipant

public class unclosed_blockCodeAction extends Object implements IRNCCodeActionParticipant
Code action for the unclosed-block error — inserts a closing } brace.

The insertion position is determined by examining the unclosed node's children: if a top-level construct (define, start, namespace, datatypes) is incorrectly nested inside the unclosed block, the closing brace is inserted before it. Otherwise, it is appended at the end of the document.

Use case: the user writes element foo { and forgets to close it before writing the next define. The code action inserts } at the correct position, separating the two definitions.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    doCodeAction(RNCDocument rncDocument, org.eclipse.lsp4j.Diagnostic diagnostic, org.eclipse.lsp4j.TextDocumentItem document, boolean snippetSupported, List<org.eclipse.lsp4j.CodeAction> codeActions, IRNCDocumentProvider documentProvider, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)
    Inserts a closing &#125; brace at the inferred position — before the next top-level construct, or at the end of the document.

    Methods inherited from class java.lang.Object

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

    • unclosed_blockCodeAction

      public unclosed_blockCodeAction()
  • Method Details

    • doCodeAction

      public void doCodeAction(RNCDocument rncDocument, org.eclipse.lsp4j.Diagnostic diagnostic, org.eclipse.lsp4j.TextDocumentItem document, boolean snippetSupported, List<org.eclipse.lsp4j.CodeAction> codeActions, IRNCDocumentProvider documentProvider, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)
      Inserts a closing &#125; brace at the inferred position — before the next top-level construct, or at the end of the document.
      Specified by:
      doCodeAction in interface IRNCCodeActionParticipant