-
Notifications
You must be signed in to change notification settings - Fork 30.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API: Allow to use the file watcher for aribitrary folders (#3025)
- Loading branch information
Showing
6 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
declare module 'vscode' { | ||
|
||
// https://github.com/microsoft/vscode/issues/3025 | ||
|
||
export interface FileSystem2 extends FileSystem { | ||
|
||
/** | ||
* Subscribe to file change events in the file or folder denoted by `uri`. For folders, | ||
* the option `recursive` indicates whether subfolders, sub-subfolders, etc. should | ||
* be watched for file changes as well. | ||
* | ||
* The `excludes` array is used to indicate paths that should be excluded from file | ||
* watching. Each entry can be be: | ||
* - the absolute path to exclude | ||
* - a relative path to exclude (for example `build/output`) | ||
* - a simple glob pattern (for example `**\build`, `output/**`) | ||
* | ||
* File events will be delivered via {@linkcode workspace.createFileSystemWatcher createFileSystemWatcher}. | ||
* | ||
* @param uri The uri of the file or folder to be watched. | ||
* @param options Configures the watch. | ||
* @returns A disposable that tells the provider to stop watching the `uri`. | ||
*/ | ||
watch(uri: Uri, options?: { recursive: boolean; excludes: string[] }): Disposable; | ||
} | ||
|
||
export namespace workspace { | ||
|
||
/** | ||
* A {@link FileSystem file system} instance that allows to interact with local and remote | ||
* files, e.g. `vscode.workspace.fs.readDirectory(someUri)` allows to retrieve all entries | ||
* of a directory or `vscode.workspace.fs.stat(anotherUri)` returns the meta data for a | ||
* file. | ||
*/ | ||
export const fs2: FileSystem2; | ||
} | ||
} |