File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1073,6 +1073,7 @@ module ts.server {
10731073
10741074 static changeNumberThreshold = 8 ;
10751075 static changeLengthThreshold = 256 ;
1076+ static maxVersions = 8 ;
10761077
10771078 // REVIEW: can optimize by coalescing simple edits
10781079 edit ( pos : number , deleteLen : number , insertedText ?: string ) {
@@ -1133,6 +1134,13 @@ module ts.server {
11331134 this . currentVersion = snap . version ;
11341135 this . versions [ snap . version ] = snap ;
11351136 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+ }
11361144 }
11371145 return snap ;
11381146 }
You can’t perform that action at this time.
0 commit comments