Class RNCSelectionRanges
java.lang.Object
org.eclipse.lemminx.extensions.relaxng.grammar.rnc.selectionrange.RNCSelectionRanges
Computes
textDocument/selectionRange responses for RNC documents.
For each cursor position, finds the deepest AST node and walks up the
parent chain, adding a SelectionRange for each node. The innermost
range is the word under the cursor, then intermediate sub-node ranges
(define name, element/attribute body content), then the full node range,
up to the document root.
Special handling for defines and starts: the parser only assigns these
nodes a range that covers their name = portion. The actual pattern
body (element/attribute alternatives or simple patterns) is represented by
sibling nodes or is not in the AST at all. This class computes the
logical range of a declaration by scanning siblings, mirroring the
logic in RNCDefine.getText().
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<org.eclipse.lsp4j.SelectionRange> getSelectionRanges(RNCDocument rncDocument, List<org.eclipse.lsp4j.Position> positions, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)
-
Constructor Details
-
RNCSelectionRanges
public RNCSelectionRanges()
-
-
Method Details
-
getSelectionRanges
public List<org.eclipse.lsp4j.SelectionRange> getSelectionRanges(RNCDocument rncDocument, List<org.eclipse.lsp4j.Position> positions, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)
-