-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Loïc Mangeonjean
committed
Jun 9, 2023
1 parent
422664f
commit 26f9b96
Showing
6 changed files
with
375 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* 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/73524 | ||
|
||
/** | ||
* The parameters of a query for file search. | ||
*/ | ||
export interface FileSearchQuery { | ||
/** | ||
* The search pattern to match against file paths. | ||
*/ | ||
pattern: string; | ||
} | ||
|
||
/** | ||
* Options that apply to file search. | ||
*/ | ||
export interface FileSearchOptions extends SearchOptions { | ||
/** | ||
* The maximum number of results to be returned. | ||
*/ | ||
maxResults?: number; | ||
|
||
/** | ||
* A CancellationToken that represents the session for this search query. If the provider chooses to, this object can be used as the key for a cache, | ||
* and searches with the same session object can search the same cache. When the token is cancelled, the session is complete and the cache can be cleared. | ||
*/ | ||
session?: CancellationToken; | ||
} | ||
|
||
/** | ||
* A FileSearchProvider provides search results for files in the given folder that match a query string. It can be invoked by quickopen or other extensions. | ||
* | ||
* A FileSearchProvider is the more powerful of two ways to implement file search in the editor. Use a FileSearchProvider if you wish to search within a folder for | ||
* all files that match the user's query. | ||
* | ||
* The FileSearchProvider will be invoked on every keypress in quickopen. When `workspace.findFiles` is called, it will be invoked with an empty query string, | ||
* and in that case, every file in the folder should be returned. | ||
*/ | ||
export interface FileSearchProvider { | ||
/** | ||
* Provide the set of files that match a certain file path pattern. | ||
* @param query The parameters for this query. | ||
* @param options A set of options to consider while searching files. | ||
* @param token A cancellation token. | ||
*/ | ||
provideFileSearchResults(query: FileSearchQuery, options: FileSearchOptions, token: CancellationToken): ProviderResult<Uri[]>; | ||
} | ||
|
||
export namespace workspace { | ||
/** | ||
* Register a search provider. | ||
* | ||
* Only one provider can be registered per scheme. | ||
* | ||
* @param scheme The provider will be invoked for workspace folders that have this file scheme. | ||
* @param provider The provider. | ||
* @return A {@link Disposable} that unregisters this provider when being disposed. | ||
*/ | ||
export function registerFileSearchProvider(scheme: string, provider: FileSearchProvider): Disposable; | ||
} | ||
} |
Oops, something went wrong.