FigGeneratorContext class

Context passed to generator FigCustomGeneratorCallback. Aligns with Fig.GeneratorContext (ShellContext & { isDangerous?, searchTerm }). adapter is provided so custom generators can access the file system (e.g. CompleteAdapter.listDirectory) without using dart:io. Environment variables are read lazily from adapter when getEnv, getEnvs, or environmentVariables is accessed.

Inheritance

Constructors

FigGeneratorContext({required String currentWorkingDirectory, String currentProcess = '', String sshPrefix = '', bool? isDangerous, String searchTerm = '', required CompleteAdapter adapter})

Properties

adapter → CompleteAdapter
Adapter for path resolution and directory listing. Use adapter.listDirectory and map to FigSuggestion for filepath suggestions.
final
currentProcess → String
finalinherited
currentWorkingDirectory → String
finalinherited
environmentVariables → Map<String, String>
Lazily resolved from adapter.getEnvs() when first accessed. Shadows super FigShellContext.environmentVariables so generators never pay for env until used.
no setter
getEnvs → Map<String, String>
All environment variables (from adapter.getEnvs(), called when accessed).
no setter
hashCode → int
The hash code for this object.
no setterinherited
isDangerous → bool?
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
searchTerm → String
final
sshPrefix → String
finalinherited

Methods

getEnv(String envKey) → String?
One env by envKey. Use getEnvs for the full map. Resolved from adapter on demand.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited