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

Commit ea0c6a9

Browse files
authored
Merge pull request #499 from peterzhu2118/locate-bugfix
Fix bug in locate.js
2 parents 5ef63bb + a4f43d8 commit ea0c6a9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/locate/locate.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ export class Locate {
7070
this.parseQueue = async.queue((task, callback) => task().then(() => callback()), SINGLE_FILE_PARSE_CONCURRENCY);
7171
}
7272
listInFile(absPath) {
73-
const waitForParse = (absPath in this.tree) ? Promise.resolve() : this.parse(absPath);
74-
return waitForParse.then(() => _.clone(this.tree[absPath] || []));
73+
if (!absPath in this.tree)
74+
this.parse(absPath);
75+
76+
return Promise.resolve(_.clone(this.tree[absPath] || []));
7577
}
7678
find(name) {
7779
return this._waitForWalk().then(() => this._find(name));

0 commit comments

Comments
 (0)