pyfcstm.entry.simulate.completer

Auto-completion support for the simulation REPL.

This module provides comprehensive command and argument completion using prompt_toolkit’s completion framework. It supports context-aware completion for all commands including their arguments and values.

SimulationCompleter

class pyfcstm.entry.simulate.completer.SimulationCompleter(runtime)[source]

Completer for simulation REPL commands and arguments.

This class provides comprehensive context-aware completion for: - Command names (with partial matching) - Event names for cycle command (both full-path and short names) - Count values for cycle and history commands - Setting keys and values for setting command - Log levels for log_level setting

Parameters:

runtime (SimulationRuntime) – The simulation runtime instance

Variables:
  • COMMANDS (list) – List of available commands

  • LOG_LEVELS (list) – List of available log levels

__init__(runtime)[source]

Initialize the completer.

Parameters:

runtime (SimulationRuntime) – The simulation runtime instance

get_completions(document: Document, complete_event) Iterable[Completion][source]

Generate completions for the current input.

Parameters:
  • document (Document) – The current document

  • complete_event – The completion event

Returns:

Iterator of completion suggestions

Return type:

Iterable[Completion]