mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-10 21:07:52 -05:00
Address CR from 5127
This commit is contained in:
@@ -739,13 +739,12 @@ namespace ts {
|
||||
export function isSupportedSourceFileName(fileName: string) {
|
||||
if (!fileName) { return false; }
|
||||
|
||||
let dotIndex = fileName.lastIndexOf(".");
|
||||
if (dotIndex < 0) {
|
||||
return false;
|
||||
for (let extension of supportedExtensions) {
|
||||
if (fileExtensionIs(fileName, extension)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
let extension = fileName.slice(dotIndex, fileName.length);
|
||||
return supportedExtensions.indexOf(extension) >= 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
const extensionsToRemove = [".d.ts", ".ts", ".js", ".tsx", ".jsx"];
|
||||
@@ -846,7 +845,7 @@ namespace ts {
|
||||
export function copyListRemovingItem<T>(item: T, list: T[]) {
|
||||
let copiedList: T[] = [];
|
||||
for (var i = 0, len = list.length; i < len; i++) {
|
||||
if (list[i] != item) {
|
||||
if (list[i] !== item) {
|
||||
copiedList.push(list[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -735,7 +735,7 @@ namespace ts.server {
|
||||
if (!(--project.projectService.directoryWatchersRefCount[directory])) {
|
||||
this.log("Close directory watcher for: " + directory);
|
||||
project.projectService.directoryWatchersForTsconfig[directory].close();
|
||||
project.projectService.directoryWatchersForTsconfig[directory] = undefined;
|
||||
delete project.projectService.directoryWatchersForTsconfig[directory];
|
||||
}
|
||||
}
|
||||
this.inferredProjects = copyListRemovingItem(project, this.inferredProjects);
|
||||
|
||||
Reference in New Issue
Block a user