Skip to content

Commit

Permalink
Fix to reading local files
Browse files Browse the repository at this point in the history
  • Loading branch information
worksofliam committed Feb 7, 2022
1 parent da011fa commit 288ff59
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/language/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,15 @@ module.exports = class Parser {
}

if (possibleFile) {
content = (await vscode.workspace.fs.readFile(possibleFile[0])).toString();
content = (await vscode.workspace.fs.readFile(possibleFile)).toString();
lines = content.replace(new RegExp(`\\\r`, `g`), ``).split(`\n`);
} else {
lines = [`// NOT FOUND: ${getPath}`];
lines = [];
}
break;
}
} catch (e) {
lines = [`// ERROR: ${getPath}`];
lines = [];
}

//const hrend = process.hrtime(hrstart);
Expand Down Expand Up @@ -242,6 +242,7 @@ module.exports = class Parser {

//Now the real work
for (const file in files) {
if (files[file].length === 0) continue;
lineNumber = -1;

isFullyFree = files[file][0].toUpperCase().startsWith(`**FREE`);
Expand Down

0 comments on commit 288ff59

Please sign in to comment.