JetbrainsBridge class

High-level bridge to a JetBrains IDE plugin.

Wraps BridgeProtocol with typed methods for all JetBrains interactions: editor, project, inspections, refactoring, VCS, actions, and events.

Constructors

JetbrainsBridge({BridgeProtocol? protocol})

Properties

hashCode int
The hash code for this object.
no setterinherited
ideType JetbrainsIdeType?
no setter
isConnected bool
no setter
onBuildCompleted Stream<Map<String, dynamic>>
Fires when a build completes. Emits build result info.
no setter
onFileEdited Stream<String>
Fires when a file is edited. Emits the file path.
no setter
onInspectionCompleted Stream<List<JetbrainsInspectionResult>>
Fires when an inspection run completes.
no setter
onRunConfigurationFinished Stream<Map<String, dynamic>>
Fires when a run configuration finishes.
no setter
onVcsFileChanged Stream<JetbrainsVcsFileStatus>
Fires when a VCS file status changes.
no setter
projectPath String?
no setter
protocol BridgeProtocol
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

closeFile(String filePath) Future<BridgeResponse>
Close a file tab.
commitChanges({required String message, List<String>? filePaths, bool amend = false}) Future<BridgeResponse>
Commit changes with a message.
connect(String projectPath, {JetbrainsIdeType? ideType}) Future<void>
Connect to a JetBrains IDE plugin for the given project.
disconnect() Future<void>
Disconnect from the JetBrains IDE.
dispose() → void
Dispose all resources.
extractMethod({required String filePath, required int startOffset, required int endOffset, required String methodName, String visibility = 'private'}) Future<BridgeResponse>
Extract a method from a selected range.
findUsages({String? filePath, int? offset}) Future<List<Map<String, dynamic>>>
Find usages of a symbol at the current caret position.
getActiveFile() Future<String?>
Get the active editor file path.
getInspectionProfiles() Future<List<String>>
Get available inspection profiles.
getModules() Future<List<JetbrainsModule>>
Get project modules.
getOpenFiles() Future<List<String>>
Get all open file paths.
getProjectStructure() Future<Map<String, dynamic>>
Get the project file/directory structure.
getRunConfigurations() Future<List<JetbrainsRunConfiguration>>
Get available run/debug configurations.
getSelection() Future<Map<String, dynamic>?>
Get the current selection text and range.
getVcsStatus() Future<List<JetbrainsVcsFileStatus>>
Get VCS status for all changed files.
inlineVariable({required String filePath, required int offset}) Future<BridgeResponse>
Inline a variable at the caret position.
insertText(String text) Future<BridgeResponse>
Insert text at the current caret position.
moveFile({required String sourcePath, required String targetDirectory}) Future<BridgeResponse>
Move a file to a new location with refactoring.
Navigate to a symbol by fully qualified name.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openFile(String filePath, {int? line, int? column, bool focusEditor = true}) Future<BridgeResponse>
Open a file in the editor.
registerAction(JetbrainsAction action) → void
Register an action that the IDE can invoke.
rename({required String filePath, required int offset, required String newName}) Future<BridgeResponse>
Rename a symbol at a given location.
replaceRange({required int startOffset, required int endOffset, required String newText}) Future<BridgeResponse>
Replace a range of text in the active editor.
runConfiguration(String name, {bool debug = false}) Future<BridgeResponse>
Run a named run/debug configuration.
runInspection({required String inspectionId, String? filePath, String? scope}) Future<List<JetbrainsInspectionResult>>
Run a specific inspection on a file or scope.
showDiff({String? filePath}) Future<BridgeResponse>
Show diff for a file (or all changes if no path given).
suppressInspection({required String inspectionId, required String filePath, required int line, String suppressionType = 'line'}) Future<BridgeResponse>
Suppress an inspection at a specific location.
toString() String
A string representation of this object.
inherited
unregisterAction(String actionId) → void
Unregister an action.

Operators

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