Support testing document highlights with "filesToSearch" (#21640)

* Support testing document highlights with "filesToSearch"

* Fix lint
This commit is contained in:
Andy
2018-02-05 14:02:50 -08:00
committed by GitHub
parent d584f4d97b
commit 48c0af5d43
3 changed files with 15 additions and 13 deletions

View File

@@ -1582,7 +1582,7 @@ namespace ts {
function getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): DocumentHighlights[] {
synchronizeHostData();
const sourceFilesToSearch = map(filesToSearch, f => program.getSourceFile(f));
const sourceFilesToSearch = map(filesToSearch, f => Debug.assertDefined(program.getSourceFile(f)));
const sourceFile = getValidSourceFile(fileName);
return DocumentHighlights.getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch);
}