Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Fix Add Import location discovery
Browse files Browse the repository at this point in the history
Fixes #160.
  • Loading branch information
lukehoban committed Dec 16, 2015
1 parent a7ca66a commit c14dfb2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ export function parseFilePrelude(text: string): Prelude {
ret.imports.push({kind: "single", start: i, end: i});
}
if (line.match(/^(\s)*\)/)) {
ret.imports[ret.imports.length - 1].end = i;
if(ret.imports[ret.imports.length - 1].end == -1) {
ret.imports[ret.imports.length - 1].end = i;
}
}
if (line.match(/^(\s)(func|const|type|var)/)) {
if (line.match(/^(\s)*(func|const|type|var)/)) {
break;
}
}
Expand Down

0 comments on commit c14dfb2

Please sign in to comment.