File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1073,6 +1073,7 @@ module ts.server {
1073
1073
1074
1074
static changeNumberThreshold = 8 ;
1075
1075
static changeLengthThreshold = 256 ;
1076
+ static maxVersions = 8 ;
1076
1077
1077
1078
// REVIEW: can optimize by coalescing simple edits
1078
1079
edit ( pos : number , deleteLen : number , insertedText ?: string ) {
@@ -1133,6 +1134,13 @@ module ts.server {
1133
1134
this . currentVersion = snap . version ;
1134
1135
this . versions [ snap . version ] = snap ;
1135
1136
this . changes = [ ] ;
1137
+ if ( ( this . currentVersion - this . minVersion ) >= ScriptVersionCache . maxVersions ) {
1138
+ var oldMin = this . minVersion ;
1139
+ this . minVersion = ( this . currentVersion - ScriptVersionCache . maxVersions ) + 1 ;
1140
+ for ( var j = oldMin ; j < this . minVersion ; j ++ ) {
1141
+ this . versions [ j ] = undefined ;
1142
+ }
1143
+ }
1136
1144
}
1137
1145
return snap ;
1138
1146
}
You can’t perform that action at this time.
0 commit comments