D4rtReplBase class abstract
Base class for D4rt REPL tools.
Extended tools should:
- Override toolName and toolVersion for branding
- Override registerBridges to add additional bridges
- Override getImportBlock to include bridge imports
- Override getBridgesHelp to list available bridges in help
- Override getAdditionalHelpSections to add tool-specific help
- Override handleAdditionalCommands to add tool-specific commands
- Implementers
Constructors
Properties
- dataDirectory → String
-
The data directory for sessions, history, etc.
Default is
~/.tom/<toolname>. Override for custom location.no setter - dataDirectoryShort → String
-
The short form of dataDirectory for display in help (e.g.,
~/.tom/dcli)no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- hasVSCodeIntegration → bool
-
Whether to include VS Code integration commands (override in extended tools)
no setter
- initSourceFileName → String
-
The init source file name (e.g., dcli_init_source.dart)
no setter
-
replayFilePatterns
→ List<
String> -
Returns the list of file patterns to match when listing replay files.
Override in subclasses to add tool-specific extensions (e.g., '.d4rt').
Default returns
'.replay.txt', '.<toolExtension>'(e.g., '.dcli')no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- toolExtension → String
-
The file extension for replay files (e.g., 'dcli' for *.dcli files)
Override in subclasses (e.g., 'd4rt' for *.d4rt files)
no setter
- toolName → String
-
The name of the tool (shown in prompt and help)
no setter
- toolVersion → String
-
The version string for the tool
no setter
Methods
-
createReplState(
) → ReplState - Create a new ReplState instance. Override to use a custom state class.
-
getAdditionalHelpSections(
) → List< String> - Get additional help sections for tool-specific features. Returns a list of help section strings.
-
getBridgesHelp(
[D4rt? d4rt]) → String -
Get the bridges help section describing available bridges.
If
d4rtis provided, generates dynamic content from configuration. -
getCliExamplesHelp(
) → String - Returns the CLI examples section (for --help).
-
getCliOptionsHelp(
) → String - Returns the CLI-specific options section (for --help).
-
getImportBlock(
) → String - Get the import block for script initialization. Extended tools should call super and append their imports.
-
getPackageNames(
D4rt d4rt) → List< String> - Get sorted list of unique package names from D4rt configuration.
-
getVersionBanner(
) → String - Get the version banner shown at startup and with --version.
-
handleAdditionalCommands(
D4rt d4rt, ReplState state, String line, {bool silent = false}) → Future< bool> - Handle additional tool-specific commands. Returns true if the command was handled, false to continue with default processing.
-
handleAdditionalMultilineEnd(
D4rt d4rt, ReplState state, MultilineMode mode, String code, {bool silent = false}) → Future< bool> - Handle additional multiline mode endings. Called when .end is entered for a multiline mode not handled by the base class. Returns true if the mode was handled, false otherwise.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onReplStartup(
D4rt d4rt, ReplState state) → Future< void> - Called when starting the REPL, after printing the banner. Override to add tool-specific startup logic.
-
printAllPackagesInfo(
D4rt d4rt) → void - Print all registered packages with their contents (for bridges help).
-
printReplHelp(
[D4rt? d4rt]) → void - Prints detailed REPL help (for help command).
-
printUsage(
) → void - Print CLI usage information (for --help).
-
processInput(
D4rt d4rt, ReplState state, String input, {bool silent = false}) → Future< bool> - Process a single line of input. Returns false if the REPL should exit.
-
registerBridges(
D4rt d4rt) → void - Register bridges with the D4rt interpreter. Extended tools should call super and add their bridges.
-
run(
List< String> arguments) → Future<void> - Main entry point for the REPL.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited