mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Watch files through the host
Call `this.projectService.host.watchFile`, rather than `ts.sys.watchFile` so that it gets mocked correctly in the unit tests. Repair two failing tests.
This commit is contained in:
@@ -631,7 +631,7 @@ namespace ts.server {
|
||||
// Missing files that are not yet watched should be added to the map.
|
||||
missingFilePaths.forEach(p => {
|
||||
if (!this.missingFilesMap.contains(p)) {
|
||||
const fileWatcher = ts.sys.watchFile(p, (_filename: string, removed?: boolean) => {
|
||||
const fileWatcher = this.projectService.host.watchFile(p, (_filename: string, removed?: boolean) => {
|
||||
// removed = deleted ? true : (added ? false : undefined)
|
||||
if (removed === false && this.missingFilesMap.contains(p)) {
|
||||
fileWatcher.close();
|
||||
|
||||
Reference in New Issue
Block a user