DcliRepl class
DCLI REPL implementation.
This is the concrete implementation of D4rtReplBase for the dcli tool, providing only dcli package bridges.
- Inheritance
-
- Object
- D4rtReplBase
- DcliRepl
- Mixed-in types
Constructors
- DcliRepl()
Properties
- dataDirectory → String
-
The data directory for sessions, history, etc.
Default is
~/.tom/<toolname>. Override for custom location.no setterinherited - dataDirectoryShort → String
-
The short form of dataDirectory for display in help (e.g.,
~/.tom/dcli)no setterinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- hasVSCodeIntegration → bool
-
Whether to include VS Code integration commands (override in extended tools)
no setterinherited
- initSourceFileName → String
-
The init source file name (e.g., dcli_init_source.dart)
no setterinherited
-
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 setterinherited - 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 setterinherited
- toolName → String
-
The name of the tool (shown in prompt and help)
no setteroverride
- toolVersion → String
-
The version string for the tool
no setteroverride
- vscodePort ↔ int
-
VS Code server port (default: 19900)
getter/setter pairinherited
Methods
-
checkVSCodeAvailability(
) → Future< void> -
Check VS Code availability and print status.
Call this in onReplStartup.
inherited
-
createReplState(
) → ReplState -
Create a new ReplState instance.
Override to use a custom state class.
override
-
getAdditionalHelpSections(
) → List< String> -
Get additional help sections for tool-specific features.
Returns a list of help section strings.
override
-
getBridgesHelp(
[D4rt? d4rt]) → String -
Get the bridges help section describing available bridges.
If
d4rtis provided, generates dynamic content from configuration.override -
getCliExamplesHelp(
) → String -
Returns the CLI examples section (for --help).
inherited
-
getCliOptionsHelp(
) → String -
Returns the CLI-specific options section (for --help).
inherited
-
getImportBlock(
) → String -
Get the import block for script initialization.
Extended tools should call super and append their imports.
override
-
getPackageNames(
D4rt d4rt) → List< String> -
Get sorted list of unique package names from D4rt configuration.
inherited
-
getVersionBanner(
) → String -
Get the version banner shown at startup and with --version.
inherited
-
getVSCodeIntegrationHelp(
) → String -
Returns the VS Code integration help section.
inherited
-
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.
override
-
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.
inherited
-
handleVSCodeCommands(
ReplState state, String line, {bool silent = false}) → Future< bool> -
Handle VS Code commands.
Returns true if the command was handled.
inherited
-
handleVSCodeMultilineEnd(
ReplState state, MultilineMode mode, String code, {bool silent = false}) → Future< bool> -
Handle VS Code multiline mode endings.
Returns true if the mode was handled.
inherited
-
initVSCodeIntegration(
{void onStatusMessage(String)?, void onErrorMessage(String)?}) → void -
Initialize VS Code integration with lazy adapter.
Call this in createReplState.
inherited
-
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.
inherited
-
printAllPackagesInfo(
D4rt d4rt) → void -
Print all registered packages with their contents (for bridges help).
inherited
-
printReplHelp(
[D4rt? d4rt]) → void -
Prints detailed REPL help (for help command).
inherited
-
printUsage(
) → void -
Print CLI usage information (for --help).
inherited
-
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.
inherited
-
registerBridges(
D4rt d4rt) → void -
Register bridges with the D4rt interpreter.
Extended tools should call super and add their bridges.
override
-
run(
List< String> arguments) → Future<void> -
Main entry point for the REPL.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited