Merge remote-tracking branch 'origin/master' into pathMappingModuleResolution

This commit is contained in:
Vladimir Matveev
2015-12-21 09:21:35 -08:00
2 changed files with 11 additions and 14 deletions

View File

@@ -486,7 +486,7 @@ namespace ts.server {
// number becomes 0 for a watcher, then we should close it.
directoryWatchersRefCount: ts.Map<number> = {};
hostConfiguration: HostConfiguration;
timerForDetectingProjectFilelistChanges: Map<NodeJS.Timer> = {};
timerForDetectingProjectFileListChanges: Map<NodeJS.Timer> = {};
constructor(public host: ServerHost, public psLogger: Logger, public eventHandler?: ProjectServiceEventHandler) {
// ts.disableIncrementalParsing = true;
@@ -541,21 +541,20 @@ namespace ts.server {
}
this.log("Detected source file changes: " + fileName);
this.startTimerForDetectingProjectFilelistChanges(project);
this.startTimerForDetectingProjectFileListChanges(project);
}
startTimerForDetectingProjectFilelistChanges(project: Project) {
if (this.timerForDetectingProjectFilelistChanges[project.projectFilename]) {
clearTimeout(this.timerForDetectingProjectFilelistChanges[project.projectFilename]);
startTimerForDetectingProjectFileListChanges(project: Project) {
if (this.timerForDetectingProjectFileListChanges[project.projectFilename]) {
clearTimeout(this.timerForDetectingProjectFileListChanges[project.projectFilename]);
}
this.timerForDetectingProjectFilelistChanges[project.projectFilename] = setTimeout(
() => this.handleProjectFilelistChanges(project),
this.timerForDetectingProjectFileListChanges[project.projectFilename] = setTimeout(
() => this.handleProjectFileListChanges(project),
250
);
}
handleProjectFilelistChanges(project: Project) {
// TODO: Ignoring potentially returned 'error' and 'succeeded' condition
handleProjectFileListChanges(project: Project) {
const { projectOptions } = this.configFileToProjectOptions(project.projectFilename);
const newRootFiles = projectOptions.files.map((f => this.getCanonicalFileName(f)));
@@ -585,7 +584,6 @@ namespace ts.server {
this.log("Detected newly added tsconfig file: " + fileName);
// TODO: Ignoring potentially returned 'error' and 'succeeded' condition
const { projectOptions } = this.configFileToProjectOptions(fileName);
const rootFilesInTsconfig = projectOptions.files.map(f => this.getCanonicalFileName(f));
@@ -1085,7 +1083,6 @@ namespace ts.server {
* Close file whose contents is managed by the client
* @param filename is absolute pathname
*/
closeClientFile(filename: string) {
const info = ts.lookUp(this.filenameToScriptInfo, filename);
if (info) {
@@ -1741,9 +1738,9 @@ namespace ts.server {
}
getLineMapper() {
return ((line: number) => {
return (line: number) => {
return this.index.lineNumberToInfo(line).offset;
});
};
}
getTextChangeRangeSinceVersion(scriptVersion: number) {

View File

@@ -1,6 +1,6 @@
/// <reference path="..\..\..\src\harness\harness.ts" />
var expect: typeof _chai.expect = _chai.expect;
const expect: typeof _chai.expect = _chai.expect;
namespace ts.server {
let lastWrittenToHost: string;