Skip to content

Commit

Permalink
Fix for files directly inside the lib folder
Browse files Browse the repository at this point in the history
  • Loading branch information
luanpotter committed Jul 12, 2018
1 parent 110dab1 commit a0d6348
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ export async function activate(context: vscode.ExtensionContext) {
}

const currentPath = editor.document.fileName.replace(/\/[^\/]*.dart$/, '');
const libFolder = packageInfo.projectRoot + '/lib/';
const libFolder = packageInfo.projectRoot + '/lib';
if (!currentPath.startsWith(libFolder)) {
vscode.window.showErrorMessage('Current file is not on project root or not on lib folder? File must be on $root/lib.');
return;
}
const relativePath = currentPath.substring(libFolder.length);
const relativePath = currentPath.substring(libFolder.length + 1);
let count = 0;
for (let currentLine = 0;; currentLine++) {
const line : vscode.TextLine = editor.document.lineAt(currentLine);
Expand Down

0 comments on commit a0d6348

Please # to comment.