java.lang.Object
org.eclipse.lemminx.extensions.relaxng.grammar.rnc.AbstractRNCRequest
org.eclipse.lemminx.extensions.relaxng.grammar.rnc.completion.RNCCompletionRequest
All Implemented Interfaces:
ISharedSettingsRequest

public class RNCCompletionRequest extends AbstractRNCRequest
Encapsulates all context needed to compute RNC completion items.

Created once per completion request, this class resolves the cursor offset, document text, line separator, and replacement range. It also exposes client capabilities (snippet support, trigger-suggest, markdown) via ISharedSettingsRequest.

Use case: RNCCompletions.doComplete(org.eclipse.lemminx.extensions.relaxng.grammar.rnc.RNCDocument, org.eclipse.lsp4j.Position, org.eclipse.lemminx.settings.SharedSettings, org.eclipse.lsp4j.jsonrpc.CancelChecker) creates a request and passes it to the various collect* methods, avoiding the need to thread individual parameters through every call.

  • Constructor Details

    • RNCCompletionRequest

      public RNCCompletionRequest(RNCDocument rncDocument, org.eclipse.lsp4j.Position position, SharedSettings sharedSettings) throws BadLocationException
      Creates a new completion request.
      Parameters:
      rncDocument - the parsed RNC document.
      position - the cursor position.
      sharedSettings - the shared client settings.
      Throws:
      BadLocationException - if the position cannot be converted to an offset.
  • Method Details

    • getOffset

      public int getOffset()
      Overrides:
      getOffset in class AbstractRNCRequest
    • getLineSeparator

      public String getLineSeparator()
    • getReplaceRange

      public org.eclipse.lsp4j.Range getReplaceRange()
    • isSnippetsSupported

      public boolean isSnippetsSupported()
      Overrides:
      isSnippetsSupported in class AbstractRNCRequest
    • isTriggerSuggestSupported

      public boolean isTriggerSuggestSupported()
    • canSupportMarkupKind

      public boolean canSupportMarkupKind(String kind)
      Description copied from interface: ISharedSettingsRequest
      Returns true if the client can support the given Markup kind for documentation and false otherwise.
      Parameters:
      kind - the markup kind
      Returns:
      true if the client can support the given Markup kind for documentation and false otherwise.