Skip to content

Commit a0d6348

Browse files
committed
Fix for files directly inside the lib folder
1 parent 110dab1 commit a0d6348

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/extension.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ export async function activate(context: vscode.ExtensionContext) {
5858
}
5959

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

0 commit comments

Comments
 (0)