java.lang.Object
org.eclipse.lemminx.extensions.relaxng.grammar.rnc.codelens.RNCCodeLenses

public class RNCCodeLenses extends Object
Provides code lenses for RNC (RELAX NG Compact Syntax) documents.

Two kinds of lenses:

  1. Workspace "N references" lens (line 0): Shows how many XML files in the workspace reference this RNC file via href, include, xsi:noNamespaceSchemaLocation, etc. Computed via WorkspaceIndexCodeLensSupport (shared with the XSD/DTD/RNG participant). Only appears when WorkspaceIndex is populated and the RNC file is referenced by at least one workspace file.
  2. Per-define "N references" lens: Shows how many times each define pattern is used within the same RNC document (or across included files). Clicking triggers "Find All References" for that define.

Use case — workspace lens:

 2 references   ← XML files referencing this .rnc via href="schema.rnc"
 # schema.rnc

 3 references   ← define 'root' used 3 times in this file/includes
 root = element root { ... }
 
See Also:
  • Constructor Details

    • RNCCodeLenses

      public RNCCodeLenses()
  • Method Details

    • getCodeLens

      public List<org.eclipse.lsp4j.CodeLens> getCodeLens(RNCDocument rncDocument, boolean supportedByClient, WorkspaceIndex workspaceIndex, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)
      Computes code lenses for all defines in the given RNC document, plus a workspace "N references" lens at the top of the file.

      Workspace lens use case: workspaceIndex is non-null when the workspace Bloom index is enabled. The lens at position (0,0) shows how many XML files reference this RNC file. If workspaceIndex is null (index disabled or not yet initialized), only the per-define lenses are returned.

      Parameters:
      rncDocument - the parsed RNC document containing defines.
      supportedByClient - true if the client supports the editor.action.showReferences command.
      workspaceIndex - the populated workspace index, or null if the workspace index feature is disabled.
      cancelChecker - used to abort computation if the document changes.
      Returns:
      a list of CodeLens objects: one workspace lens (if references are found) followed by per-define lenses.