mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 11:35:42 -06:00
Add files to change set instead of delay reloading project on "change" command
This commit is contained in:
parent
54f64a1695
commit
0ff160f93f
@ -1948,12 +1948,7 @@ namespace ts.server {
|
||||
const change = file.changes[i];
|
||||
scriptInfo.editContent(change.span.start, change.span.start + change.span.length, change.newText);
|
||||
}
|
||||
if (!this.changedFiles) {
|
||||
this.changedFiles = [scriptInfo];
|
||||
}
|
||||
else if (!contains(this.changedFiles, scriptInfo)) {
|
||||
this.changedFiles.push(scriptInfo);
|
||||
}
|
||||
this.addChangedFile(scriptInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1969,6 +1964,16 @@ namespace ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
addChangedFile(scriptInfo: ScriptInfo) {
|
||||
if (!this.changedFiles) {
|
||||
this.changedFiles = [scriptInfo];
|
||||
}
|
||||
else if (!contains(this.changedFiles, scriptInfo)) {
|
||||
this.changedFiles.push(scriptInfo);
|
||||
}
|
||||
}
|
||||
|
||||
private closeConfiguredProject(configFile: NormalizedPath): void {
|
||||
const configuredProject = this.findConfiguredProjectByProjectName(configFile);
|
||||
if (configuredProject && configuredProject.deleteOpenRef() === 0) {
|
||||
|
||||
@ -1287,9 +1287,9 @@ namespace ts.server {
|
||||
const end = scriptInfo.lineOffsetToPosition(args.endLine, args.endOffset);
|
||||
if (start >= 0) {
|
||||
scriptInfo.editContent(start, end, args.insertString);
|
||||
this.projectService.addChangedFile(scriptInfo);
|
||||
this.changeSeq++;
|
||||
}
|
||||
this.projectService.delayUpdateProjectGraphAndInferredProjectsRefresh(project);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user