Class BifTabProvider

java.lang.Object
ortus.boxlang.runtime.cli.providers.AbstractTabProvider
ortus.boxlang.runtime.cli.providers.BifTabProvider
All Implemented Interfaces:
ITabProvider

public class BifTabProvider extends AbstractTabProvider
Tab completion provider for BoxLang Built-in Functions (BIFs). This provider handles completions for function calls in BoxLang code. It matches against available BIF names from the runtime and provides intelligent completion for function names.

Completion Examples:

  • "arrayL" + TAB → completes to "arrayLen("
  • "writeO" + TAB → completes to "writeOutput("
  • "structK" + TAB → completes to "structKeyExists("
  • Constructor Details

    • BifTabProvider

      public BifTabProvider(Set<String> bifNames)
      Constructor with BIF names.
      Parameters:
      bifNames - Set of available BIF names (case-insensitive)
  • Method Details

    • canProvideCompletions

      public boolean canProvideCompletions(String input, int cursorPosition)
      Can this provider handle completions for the given input? It handles function name completions when the current word starts with a letter and is not a component declaration (bx:).
      Parameters:
      input - The input string to check.
      cursorPosition - The cursor position in the input.
      Returns:
      true if this provider can provide completions.
    • getCompletions

      public List<TabCompletion> getCompletions(String input, int cursorPosition)
      Get completions for the given input at the cursor position.
      Parameters:
      input - The current input line
      cursorPosition - The position of the cursor in the input (0-based)
      Returns:
      A list of completion suggestions, or empty list if none available
    • getPriority

      public int getPriority()
      Description copied from interface: ITabProvider
      Returns the priority of this provider (higher numbers = higher priority). When multiple providers can handle the same input, the one with highest priority is used.
      Returns:
      Priority value (default: 100)