java.lang.Object
org.eclipse.lemminx.extensions.relaxng.grammar.rnc.reference.RNCReferences

public class RNCReferences extends Object
Provides "Find References" support for RNC (RELAX NG Compact Syntax) documents.

Use case: the user places the cursor on a define name like inline and invokes "Find All References". This class locates all positions where inline is used as a pattern reference (excluding element/attribute names and the define declaration itself, unless requested).

Example: in this document, finding references for inline returns the reference at line 2 (inline*):

 start = element root {
   inline*
 }
 inline = element span { text }
 
See Also:
  • Constructor Details

    • RNCReferences

      public RNCReferences()
  • Method Details

    • findReferences

      public List<? extends org.eclipse.lsp4j.Location> findReferences(RNCDocument rncDocument, org.eclipse.lsp4j.Position position, org.eclipse.lsp4j.ReferenceContext context, WorkspaceIndex workspaceIndex, Function<String,String> openDocContent, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)
      Finds all references to the define name at the given cursor position.

      When the cursor is not on a define name and workspaceIndex is non-null, falls back to workspace cross-file references — the XML files in the workspace that reference this RNC grammar file. This handles the "N references" code lens click, which passes position (0,0) (not on any define), expecting cross-file results.

      Parameters:
      rncDocument - the parsed RNC document.
      position - the cursor position on the define name.
      context - the reference context; when ReferenceContext.isIncludeDeclaration() is true, the define declaration itself is included.
      workspaceIndex - the workspace Bloom index for cross-file lookup, or null if the workspace index feature is disabled.
      cancelChecker - used to check if the operation has been canceled.
      Returns:
      a list of Location for each reference found, or an empty list if the word is not a define name.