Skip to content

Commit 3458360

Browse files
author
Andy
authored
Prefer getValidSourceFile over Debug.assertDefined(program.getSourceFile(*)) (microsoft#28242)
1 parent 65ba8d9 commit 3458360

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/services.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1533,7 +1533,7 @@ namespace ts {
15331533
const normalizedFileName = normalizePath(fileName);
15341534
Debug.assert(filesToSearch.some(f => normalizePath(f) === normalizedFileName));
15351535
synchronizeHostData();
1536-
const sourceFilesToSearch = map(filesToSearch, f => Debug.assertDefined(program.getSourceFile(f)));
1536+
const sourceFilesToSearch = filesToSearch.map(getValidSourceFile);
15371537
const sourceFile = getValidSourceFile(fileName);
15381538
return DocumentHighlights.getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch);
15391539
}

0 commit comments

Comments
 (0)