VSCodeWorkspace class

Wrapper for vscode.workspace API Provides access to workspace-related functionality

Constructors

VSCodeWorkspace(VSCodeAdapter _adapter)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

deleteFile(String path) Future<bool>
Delete file
fileExists(String path) Future<bool>
Check if file exists
findFilePaths({required String include, String? exclude, int? maxResults, int timeoutSeconds = 60}) Future<List<String>>
Find files in the workspace (returns file paths as strings)
findFiles(String include, {String? exclude, int? maxResults, int timeoutSeconds = 60}) Future<List<VSCodeUri>>
Find files in the workspace
getConfiguration(String section, {String? scope, int timeoutSeconds = 60}) Future
Get workspace configuration
getRootPath() Future<String?>
Get workspace root path
getWorkspaceFolder(VSCodeUri uri, {int timeoutSeconds = 30}) Future<WorkspaceFolder?>
Get workspace folder for a given URI
getWorkspaceFolders({int timeoutSeconds = 30}) Future<List<WorkspaceFolder>>
Get all workspace folders
getWorkspaceName() Future<String?>
Get workspace name
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openTextDocument(String path, {int timeoutSeconds = 60}) Future<TextDocument?>
Open a text document
readFile(String path) Future<String>
Read file content
saveTextDocument(String path, {int timeoutSeconds = 60}) Future<bool>
Save a text document
toString() String
A string representation of this object.
inherited
updateConfiguration(String section, String key, dynamic value, {bool global = false, int timeoutSeconds = 60}) Future<bool>
Update workspace configuration
writeFile(String path, String content) Future<bool>
Write file content

Operators

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