Class undefined_patternCodeAction
java.lang.Object
org.eclipse.lemminx.extensions.relaxng.grammar.rnc.codeaction.undefined_patternCodeAction
- All Implemented Interfaces:
IRNCCodeActionParticipant
Code action for the
undefined-pattern error — offers "Did you mean"
suggestions and "Create define" quick fixes.
Generates up to three types of code actions:
- "Did you mean" — suggests similar define names
(using Levenshtein distance) and built-in keywords (
text,empty, etc.) when the undefined name is a likely typo. - "Create define as element" — generates a new element definition at the end of the document.
- "Create define as attribute" — generates a new attribute definition.
- "Create define" — generates a free-form definition with a placeholder for the pattern body.
Use case: the user writes start = roo (typo for root).
The code action offers "Did you mean 'root'?" as the first quick fix.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoCodeAction(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) Generates "Did you mean" suggestions for similar defines and built-in keywords, plus "Create define" code actions to define the missing pattern.
-
Constructor Details
-
undefined_patternCodeAction
public undefined_patternCodeAction()
-
-
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) Generates "Did you mean" suggestions for similar defines and built-in keywords, plus "Create define" code actions to define the missing pattern.- Specified by:
doCodeActionin interfaceIRNCCodeActionParticipant
-