Change:
Testing From the API: What is the behavior supposed to be in the following cases: The pattern contains . The pattern contains and is false. The pattern is a regex and is false. The pattern contains whitespace and is true.
If regex is not on, it just looks for literally. I believe that this actually acts as if is true (if I'm interpreting code correctly). Any time that you have regex enabled and explicitly match a newline, it will be multi-line. I should probably document this. Any characters in the regex will also match the other case. ie: should also match all characters, not just lowercase letters. It will look for the whitespace, and will look for line boundaries on either side of the search string.
I can also add extra examples for corner cases so that this is more clear.

Discussion:
* Search text in files across all {@link workspace.workspaceFolders workspace folders} in the workspace. * @param query The query parameters for the search - the search string, whether it's case-sensitive, or a regex, or matches whole words. * @param options An optional set of query options. <del> * @param callback A callback, called for each result </del> <ins> * @param callback A callback, called for each {@link TextSearchResultNew result}. This can be a direct match, or context that surrounds a match. </ins> * @param token A token that can be used to signal cancellation to the underlying search engine. * @return A thenable that resolves when the search is complete. */

// https://github.com/microsoft/vscode/issues/59921 /** <del> * The parameters of a query for text search. </del> <ins> * The parameters of a query for text search. All optional booleans default to `false`. </ins> */ export interface TextSearchQueryNew { /** * The text pattern to search for. <ins> * * If explicitly contains a newline character (`n`), the default search behavior * will automatically enable {@link isMultiline}. </ins> */ pattern: string; /** * Whether or not `pattern` should match multiple lines of text. <ins> * * If using the default search provider, this will be interpreted as `true` if * `pattern` contains a newline character (`n`). </ins> */ isMultiline?: boolean; /** * Whether or not `pattern` should be interpreted as a regular expression. <ins> * * If using the default search provider, this will be interpreted case-insensitively * if {@link isCaseSensitive} is `false` or not set. </ins> */ isRegExp?: boolean; /** * Whether or not the search should be case-sensitive. <ins> * * If using the default search provider, this can be affected by the `search.smartCase` setting. * See the setting description for more information. </ins> */ isCaseSensitive?: boolean; /** * Whether or not to search for whole word matches only. <ins> * * If enabled, the default search provider will check for boundary characters * (regex pattern `b`) surrounding the {@link pattern} to see whether something * is a word match. </ins> */ isWordMatch?: boolean; }

} /** <del> * The main match information for a {@link TextSearchResultNew}. </del> <ins> * A query match instance in a file. * * For example, consider this excerpt: * * ```ts * const bar = 1; * console.log(bar); * const foo = bar; * ``` * * If the query is `log`, then the line `console.log(bar);` should be represented using a {@link TextSearchMatchNew}. </ins> */ export class TextSearchMatchNew { /**

} /** <del> * The potential context information for a {@link TextSearchResultNew}. </del> <ins> * The context lines of text that are not a part of a match, * but that surround a match line of type {@link TextSearchMatchNew}. * * For example, consider this excerpt: * * ```ts * const bar = 1; * console.log(bar); * const foo = bar; * ``` * * If the query is `log`, then the lines `const bar = 1;` and `const foo = bar;` * should be represented using two separate {@link TextSearchContextNew} for the search instance. * This example assumes that the finder requests one line of surrounding context. </ins> */ export class TextSearchContextNew { /**

} /** <del> * A result payload for a text search, pertaining to matches within a single file. </del> <ins> * A result payload for a text search, pertaining to {@link TextSearchMatchNew matches} * and its associated {@link TextSearchContextNew context} within a single file. </ins> */ export type TextSearchResultNew = TextSearchMatchNew | TextSearchContextNew;

* Provide results that match the given text pattern. * @param query The parameters for this query. * @param options A set of options to consider while searching. <del> * @param progress A progress callback that must be invoked for all results. </del> <ins> * @param progress A progress callback that must be invoked for all {@link TextSearchResultNew results}. * These results can be direct matches, or context that surrounds matches. </ins> * @param token A cancellation token. */ provideTextSearchResults(query: TextSearchQueryNew, options: TextSearchProviderOptions, progress: Progress<TextSearchResultNew>, token: CancellationToken): ProviderResult<TextSearchCompleteNew>;