Skip to content

Commit

Permalink
fix: Fix an issue which broke pinned files on Windows
Browse files Browse the repository at this point in the history
The drive letter would be URI encoded (e.g., `c%3A`) preventing the URI
from being parsed.
  • Loading branch information
dustinbyrne committed Jan 24, 2025
1 parent 0767468 commit d7ff974
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/webviews/chatSearchWebview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ export default class ChatSearchWebview {
let contentLength = r.content?.length;
if (!r.content) {
assert(r.uri, `doPinFiles, ${r.name}: no content, no uri`);
const u: vscode.Uri = vscode.Uri.file(r.uri.toString().replace(/file:\/\//g, ''));
const fsPath = decodeURIComponent(r.uri.toString()).replace(/file:\/\//g, '');
const u: vscode.Uri = vscode.Uri.file(fsPath);
const stat = await vscode.workspace.fs.stat(u);
contentLength = stat.size;
if (contentLength < maxPinnedFileSize) {
Expand Down

0 comments on commit d7ff974

Please sign in to comment.