Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjust API shape for providers #223984

Merged
merged 2 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 1 addition & 85 deletions src/vscode-dts/vscode.proposed.aiTextSearchProviderNew.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,90 +4,6 @@
*--------------------------------------------------------------------------------------------*/

declare module 'vscode' {
/**
* Options that apply to AI text search.
*/
export interface AITextSearchOptionsNew {

folderOptions: {
/**
* The root folder to search within.
*/
folder: Uri;

/**
* Files that match an `includes` glob pattern should be included in the search.
*/
includes: string[];

/**
* Files that match an `excludes` glob pattern should be excluded from the search.
*/
excludes: GlobPattern[];

/**
* Whether symlinks should be followed while searching.
* For more info, see the setting description for `search.followSymlinks`.
*/
followSymlinks: boolean;

/**
* Which file locations we should look for ignore (.gitignore or .ignore) files to respect.
*/
useIgnoreFiles: {
/**
* Use ignore files at the current workspace root.
*/
local: boolean;
/**
* Use ignore files at the parent directory. If set, {@link TextSearchProviderOptionsNew.useIgnoreFiles.local} should also be `true`.
*/
parent: boolean;
/**
* Use global ignore files. If set, {@link TextSearchProviderOptionsNew.useIgnoreFiles.local} should also be `true`.
*/
global: boolean;
};
}[];

/**
* The maximum number of results to be returned.
*/
maxResults: number;

/**
* Options to specify the size of the result text preview.
*/
previewOptions: {
/**
* The maximum number of lines in the preview.
* Only search providers that support multiline search will ever return more than one line in the match.
*/
matchLines: number;

/**
* The maximum number of characters included per line.
*/
charsPerLine: number;
};

/**
* Exclude files larger than `maxFileSize` in bytes.
*/
maxFileSize: number;

/**
* Interpret files using this encoding.
* See the vscode setting `"files.encoding"`
*/
encoding: string;

/**
* Number of lines of context to include before and after each match.
*/
surroundingContext: number;
}

/**
* An AITextSearchProvider provides additional AI text search results in the workspace.
*/
Expand All @@ -101,7 +17,7 @@ declare module 'vscode' {
* @param progress A progress callback that must be invoked for all results.
* @param token A cancellation token.
*/
provideAITextSearchResults(query: string, options: AITextSearchOptionsNew, progress: Progress<TextSearchResultNew>, token: CancellationToken): ProviderResult<TextSearchCompleteNew>;
provideAITextSearchResults(query: string, options: TextSearchProviderOptions, progress: Progress<TextSearchResultNew>, token: CancellationToken): ProviderResult<TextSearchCompleteNew>;
}

export namespace workspace {
Expand Down
8 changes: 4 additions & 4 deletions src/vscode-dts/vscode.proposed.fileSearchProviderNew.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ declare module 'vscode' {
/**
* Options that apply to file search.
*/
export interface FileSearchProviderOptionsNew {
export interface FileSearchProviderOptions {
folderOptions: {
/**
* The root folder to search within.
Expand Down Expand Up @@ -42,11 +42,11 @@ declare module 'vscode' {
*/
local: boolean;
/**
* Use ignore files at the parent directory. If set, {@link FileSearchProviderOptionsNew.useIgnoreFiles.local} should also be `true`.
* Use ignore files at the parent directory. If set, {@link FileSearchProviderOptions.useIgnoreFiles.local} should also be `true`.
*/
parent: boolean;
/**
* Use global ignore files. If set, {@link FileSearchProviderOptionsNew.useIgnoreFiles.local} should also be `true`.
* Use global ignore files. If set, {@link FileSearchProviderOptions.useIgnoreFiles.local} should also be `true`.
*/
global: boolean;
};
Expand Down Expand Up @@ -81,7 +81,7 @@ declare module 'vscode' {
* @param options A set of options to consider while searching files.
* @param token A cancellation token.
*/
provideFileSearchResults(pattern: string, options: FileSearchProviderOptionsNew, token: CancellationToken): ProviderResult<Uri[]>;
provideFileSearchResults(pattern: string, options: FileSearchProviderOptions, token: CancellationToken): ProviderResult<Uri[]>;
}

export namespace workspace {
Expand Down
10 changes: 1 addition & 9 deletions src/vscode-dts/vscode.proposed.textSearchCompleteNew.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ declare module 'vscode' {
/**
* The message type, this affects how the message will be rendered.
*/
type: TextSearchCompleteMessageTypeNew;
}

/**
* Represents the severity of a TextSearchComplete message.
*/
export enum TextSearchCompleteMessageTypeNew {
Information = 1,
Warning = 2,
type: TextSearchCompleteMessageType;
}
}
22 changes: 11 additions & 11 deletions src/vscode-dts/vscode.proposed.textSearchProviderNew.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ declare module 'vscode' {
/**
* Options that apply to text search.
*/
export interface TextSearchProviderOptionsNew {
export interface TextSearchProviderOptions {

folderOptions: {
/**
Expand Down Expand Up @@ -73,14 +73,20 @@ declare module 'vscode' {
*/
local: boolean;
/**
* Use ignore files at the parent directory. If set, {@link TextSearchProviderOptionsNew.useIgnoreFiles.local} should also be `true`.
* Use ignore files at the parent directory. If set, {@link TextSearchProviderOptions.useIgnoreFiles.local} should also be `true`.
*/
parent: boolean;
/**
* Use global ignore files. If set, {@link TextSearchProviderOptionsNew.useIgnoreFiles.local} should also be `true`.
* Use global ignore files. If set, {@link TextSearchProviderOptions.useIgnoreFiles.local} should also be `true`.
*/
global: boolean;
};

/**
* Interpret files using this encoding.
* See the vscode setting `"files.encoding"`
*/
encoding: string;
}[];

/**
Expand Down Expand Up @@ -111,12 +117,6 @@ declare module 'vscode' {
*/
maxFileSize: number;

/**
* Interpret files using this encoding.
* See the vscode setting `"files.encoding"`
*/
encoding: string;

/**
* Number of lines of context to include before and after each match.
*/
Expand All @@ -129,7 +129,7 @@ declare module 'vscode' {
export interface TextSearchCompleteNew {
/**
* Whether the search hit the limit on the maximum number of search results.
* `maxResults` on {@linkcode TextSearchProviderOptionsNew} specifies the max number of results.
* `maxResults` on {@linkcode TextSearchProviderOptions} specifies the max number of results.
* - If exactly that number of matches exist, this should be false.
* - If `maxResults` matches are returned and more exist, this should be true.
* - If search hits an internal limit which is less than `maxResults`, this should be true.
Expand Down Expand Up @@ -216,7 +216,7 @@ declare module 'vscode' {
* @param progress A progress callback that must be invoked for all results.
* @param token A cancellation token.
*/
provideTextSearchResults(query: TextSearchQueryNew, options: TextSearchProviderOptionsNew, progress: Progress<TextSearchResultNew>, token: CancellationToken): ProviderResult<TextSearchCompleteNew>;
provideTextSearchResults(query: TextSearchQueryNew, options: TextSearchProviderOptions, progress: Progress<TextSearchResultNew>, token: CancellationToken): ProviderResult<TextSearchCompleteNew>;
}

export namespace workspace {
Expand Down
Loading