java.lang.Object
org.eclipse.lemminx.extensions.relaxng.grammar.rnc.hover.RNCHover

public class RNCHover extends Object
Provides hover information for RNC (RELAX NG Compact Syntax) identifiers and keywords.

Two types of hover are supported:

  • Define hover — when hovering over a define reference, the full definition text is displayed in a fenced code block.
  • Keyword hover — when hovering over an RNC keyword, detailed documentation from the RELAX NG specification is displayed, loaded from a bundled JSON resource file.
  • Constructor Details

  • Method Details

    • doHover

      public org.eclipse.lsp4j.Hover doHover(RNCDocument rncDocument, org.eclipse.lsp4j.Position position, SharedSettings sharedSettings, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)
      Computes hover information for the word at the given position.

      Checks, in order: define references (showing the define text), datatype references (e.g. xsd:integer), include keywords (showing definitions from the included file), and RNC keywords (showing specification docs).

      Parameters:
      rncDocument - the parsed RNC document.
      position - the cursor position where hover was triggered.
      sharedSettings - settings used to determine Markdown support.
      cancelChecker - used to check if the operation has been canceled.
      Returns:
      a Hover with documentation content, or null if no hover information is available.
    • getKeywordDocumentation

      public org.eclipse.lsp4j.MarkupContent getKeywordDocumentation(String keyword, boolean supportsMarkdown)
      Returns the documentation for the given keyword as a MarkupContent, selecting Markdown or plaintext based on client capability.
      Parameters:
      keyword - the RNC keyword name.
      supportsMarkdown - whether the client supports Markdown.
      Returns:
      the documentation content, or null if the keyword is unknown.