Skip to content

Commit 441226e

Browse files
authored
Use vscode.workspace.fs.readFile() (#872)
1 parent 8765d5e commit 441226e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/providers/FileSystemProvider/TextSearchProvider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,15 @@ export class TextSearchProvider implements vscode.TextSearchProvider {
6969
if (token.isCancellationRequested) {
7070
return;
7171
}
72+
const decoder = new TextDecoder();
7273
const result = await Promise.allSettled(
7374
files.map(
7475
throttleRequests(async (file: SearchResult) => {
7576
if (token.isCancellationRequested) {
7677
throw new vscode.CancellationError();
7778
}
7879
const uri = DocumentContentProvider.getUri(file.doc, "", "", true, options.folder);
79-
const content = await api.getDoc(file.doc).then((data) => <string[]>data.result.content);
80+
const content = decoder.decode(await vscode.workspace.fs.readFile(uri)).split("\n");
8081
// Find all lines that we have matches on
8182
const lines = file.matches
8283
.map((match: SearchMatch) => {

0 commit comments

Comments
 (0)