Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/Scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ export class Scope {
}

const key = path.isAbsolute(filePath) ? 'srcPath' : 'pkgPath';
let map = this.cache.getOrAdd('fileMaps-srcPath', () => {
let map = this.cache.getOrAdd(`fileMaps-${key}`, () => {
const result = new Map<string, BscFile>();
for (const file of this.getAllFiles()) {
result.set(file[key].toLowerCase(), file);
Expand Down Expand Up @@ -1206,12 +1206,7 @@ export class Scope {
if (!relativePath) {
return;
}
let files = this.getAllFiles();
for (let file of files) {
if (file.pkgPath.toLowerCase() === relativePath.toLowerCase()) {
return file;
}
}
return this.getFile(relativePath, false);
}

/**
Expand Down