mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Simplify calculation of sourceFiles for getReferences (#24475)
This commit is contained in:
parent
e99be8c47d
commit
f411164483
@ -1735,17 +1735,9 @@ namespace ts {
|
||||
synchronizeHostData();
|
||||
|
||||
// Exclude default library when renaming as commonly user don't want to change that file.
|
||||
let sourceFiles: SourceFile[] = [];
|
||||
if (options && options.isForRename) {
|
||||
for (const sourceFile of program.getSourceFiles()) {
|
||||
if (!program.isSourceFileDefaultLibrary(sourceFile)) {
|
||||
sourceFiles.push(sourceFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
sourceFiles = program.getSourceFiles().slice();
|
||||
}
|
||||
const sourceFiles = options && options.isForRename
|
||||
? program.getSourceFiles().filter(sourceFile => !program.isSourceFileDefaultLibrary(sourceFile))
|
||||
: program.getSourceFiles();
|
||||
|
||||
return FindAllReferences.findReferencedEntries(program, cancellationToken, sourceFiles, getValidSourceFile(fileName), position, options);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user