IdeBridge class

A single IDE bridge connection.

Manages the WebSocket or stdin/stdout transport to an IDE extension, handles message serialization, request-response correlation, and keepalive heartbeats.

Constructors

IdeBridge({String? connectionId, required IdeType ideType, IdeCapabilities capabilities = const IdeCapabilities(), Duration heartbeatInterval = const Duration(seconds: 30), Duration requestTimeout = const Duration(seconds: 10)})

Properties

capabilities IdeCapabilities
getter/setter pair
connectionId String
final
hashCode int
The hash code for this object.
no setterinherited
heartbeatInterval Duration
Heartbeat interval.
final
ideType IdeType
final
isConnected bool
no setter
messages Stream<BridgeMessage>
no setter
requestTimeout Duration
Request timeout.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state BridgeConnectionState
no setter
stateChanges Stream<BridgeConnectionState>
no setter

Methods

applyEdit(EditRequest edit) Future<BridgeMessage>
Apply a text edit in the IDE.
applyEdits(List<EditRequest> edits) Future<List<BridgeMessage>>
Apply multiple edits atomically (if the IDE supports it).
attachWebSocket(WebSocket socket) → void
Attach to an existing WebSocket (from server accepting a connection).
connectWebSocket(String url) Future<void>
Connect to an IDE extension via WebSocket.
disconnect() Future<void>
Disconnect from the IDE.
dispose() Future<void>
Dispose of all resources.
getDiagnostics({String? filePath}) Future<List<IdeDiagnostic>>
Get diagnostics (errors, warnings) from the IDE.
getOpenFiles() Future<List<String>>
Get the list of currently open files.
getSelection() Future<EditorSelection?>
Get the current editor selection.
Navigate to a symbol or position in the IDE.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openFile(String filePath, {int? line, int? column}) Future<BridgeMessage>
Open a file in the IDE editor.
request(BridgeMessage message) Future<BridgeMessage>
Send a request and await a correlated response.
runCommand(String command, {String? cwd}) Future<BridgeMessage>
Run a terminal command in the IDE.
send(BridgeMessage message) → void
Send a message to the IDE.
showDiff(DiffRequest diff) Future<BridgeMessage>
Show a diff in the IDE.
toString() String
A string representation of this object.
inherited

Operators

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