Responding to PR feedback

This commit is contained in:
Richard Knoll 2016-06-17 17:11:13 -07:00
parent 86cde9e222
commit 95072aab82
4 changed files with 15 additions and 7 deletions

View File

@ -672,7 +672,7 @@ namespace ts {
// Skip over any minified JavaScript files (ending in ".min.js")
// Skip over dotted files and folders as well
const IgnoreFileNamePattern = /(\.min\.js$)|([\\/]\.[\w.])/;
const ignoreFileNamePattern = /(\.min\.js$)|([\\/]\.[\w.])/;
/**
* Parse the contents of a config file (tsconfig.json).
* @param json The contents of the config file to parse
@ -969,7 +969,7 @@ namespace ts {
continue;
}
if (IgnoreFileNamePattern.test(file)) {
if (ignoreFileNamePattern.test(file)) {
continue;
}
@ -1055,8 +1055,8 @@ namespace ts {
// Remove any subpaths under an existing recursively watched directory.
for (const key in wildcardDirectories) {
if (hasProperty(wildcardDirectories, key)) {
for (const recursiveKey in recursiveKeys) {
if (containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) {
for (const recursiveKey of recursiveKeys) {
if (key !== recursiveKey && containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) {
delete wildcardDirectories[key];
}
}

View File

@ -1211,7 +1211,7 @@ namespace ts {
export function isJsxOrTsxExtension(ext: string): boolean {
return ext === ".jsx" || ext === ".tsx";
}
export function changeExtension<T extends string | Path>(path: T, newExtension: string): T {
return <T>(removeFileExtension(path) + newExtension);
}

View File

@ -381,7 +381,15 @@ namespace ts {
continue;
}
const name = combinePaths(path, entry);
const stat = _fs.statSync(name);
let stat: any;
try {
stat = _fs.statSync(name);
}
catch (e) {
continue;
}
if (stat.isFile()) {
files.push(entry);
}

View File

@ -82,7 +82,7 @@ namespace ts {
const projectService = new server.ProjectService(serverHost, logger);
const rootScriptInfo = projectService.openFile(rootFile, /* openedByClient */true);
const project = projectService.createInferredProject(rootScriptInfo);
project.setProjectOptions( {files: [rootScriptInfo.fileName], compilerOptions: {module: ts.ModuleKind.AMD} } );
project.setProjectOptions({ files: [rootScriptInfo.fileName], compilerOptions: { module: ts.ModuleKind.AMD } });
return {
project,
rootScriptInfo