Class RNCCodeLenses
java.lang.Object
org.eclipse.lemminx.extensions.relaxng.grammar.rnc.codelens.RNCCodeLenses
Provides code lenses for RNC (RELAX NG Compact Syntax) documents.
Two kinds of lenses:
- 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 viaWorkspaceIndexCodeLensSupport(shared with the XSD/DTD/RNG participant). Only appears whenWorkspaceIndexis populated and the RNC file is referenced by at least one workspace file. - Per-define "N references" lens: Shows how many times each
definepattern 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<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.
-
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:
workspaceIndexis non-null when the workspace Bloom index is enabled. The lens at position(0,0)shows how many XML files reference this RNC file. IfworkspaceIndexisnull(index disabled or not yet initialized), only the per-define lenses are returned.- Parameters:
rncDocument- the parsed RNC document containing defines.supportedByClient-trueif the client supports theeditor.action.showReferencescommand.workspaceIndex- the populated workspace index, ornullif the workspace index feature is disabled.cancelChecker- used to abort computation if the document changes.- Returns:
- a list of
CodeLensobjects: one workspace lens (if references are found) followed by per-define lenses.
-