@@ -56,7 +56,6 @@ module ts {
5656 }
5757
5858 export interface SourceFile {
59- isOpen : boolean ;
6059 version : string ;
6160 scriptSnapshot : IScriptSnapshot ;
6261
@@ -747,7 +746,6 @@ module ts {
747746 public identifierCount : number ;
748747 public symbolCount : number ;
749748 public version : string ;
750- public isOpen : boolean ;
751749 public languageVersion : ScriptTarget ;
752750 public identifiers : Map < string > ;
753751
@@ -848,7 +846,6 @@ module ts {
848846 getCompilationSettings ( ) : CompilerOptions ;
849847 getScriptFileNames ( ) : string [ ] ;
850848 getScriptVersion ( fileName : string ) : string ;
851- getScriptIsOpen ( fileName : string ) : boolean ;
852849 getScriptSnapshot ( fileName : string ) : IScriptSnapshot ;
853850 getLocalizedDiagnosticMessages ?( ) : any ;
854851 getCancellationToken ?( ) : CancellationToken ;
@@ -1163,18 +1160,15 @@ module ts {
11631160 filename : string ,
11641161 compilationSettings : CompilerOptions ,
11651162 scriptSnapshot : IScriptSnapshot ,
1166- version : string ,
1167- isOpen : boolean ) : SourceFile ;
1163+ version : string ) : SourceFile ;
11681164
11691165 updateDocument (
11701166 sourceFile : SourceFile ,
11711167 filename : string ,
11721168 compilationSettings : CompilerOptions ,
11731169 scriptSnapshot : IScriptSnapshot ,
11741170 version : string ,
1175- isOpen : boolean ,
1176- textChangeRange : TextChangeRange
1177- ) : SourceFile ;
1171+ textChangeRange : TextChangeRange ) : SourceFile ;
11781172
11791173 releaseDocument ( filename : string , compilationSettings : CompilerOptions ) : void
11801174 }
@@ -1315,7 +1309,6 @@ module ts {
13151309 interface HostFileInformation {
13161310 filename : string ;
13171311 version : string ;
1318- isOpen : boolean ;
13191312 sourceText ?: IScriptSnapshot ;
13201313 }
13211314
@@ -1409,8 +1402,7 @@ module ts {
14091402 var filename = filenames [ i ] ;
14101403 this . filenameToEntry [ normalizeSlashes ( filename ) ] = {
14111404 filename : filename ,
1412- version : host . getScriptVersion ( filename ) ,
1413- isOpen : host . getScriptIsOpen ( filename )
1405+ version : host . getScriptVersion ( filename )
14141406 } ;
14151407 }
14161408
@@ -1453,10 +1445,6 @@ module ts {
14531445 return this . getEntry ( filename ) . version ;
14541446 }
14551447
1456- public isOpen ( filename : string ) : boolean {
1457- return this . getEntry ( filename ) . isOpen ;
1458- }
1459-
14601448 public getScriptSnapshot ( filename : string ) : IScriptSnapshot {
14611449 var file = this . getEntry ( filename ) ;
14621450 if ( ! file . sourceText ) {
@@ -1507,7 +1495,7 @@ module ts {
15071495 var scriptSnapshot = this . hostCache . getScriptSnapshot ( filename ) ;
15081496
15091497 var start = new Date ( ) . getTime ( ) ;
1510- sourceFile = createLanguageServiceSourceFile ( filename , scriptSnapshot , ScriptTarget . Latest , version , /*isOpen*/ true , /* setNodeParents; */ true ) ;
1498+ sourceFile = createLanguageServiceSourceFile ( filename , scriptSnapshot , ScriptTarget . Latest , version , /*setNodeParents: */ true ) ;
15111499 this . log ( "SyntaxTreeCache.Initialize: createSourceFile: " + ( new Date ( ) . getTime ( ) - start ) ) ;
15121500 }
15131501 else if ( this . currentFileVersion !== version ) {
@@ -1516,7 +1504,7 @@ module ts {
15161504 var editRange = this . hostCache . getChangeRange ( filename , this . currentFileVersion , this . currentSourceFile . scriptSnapshot ) ;
15171505
15181506 var start = new Date ( ) . getTime ( ) ;
1519- sourceFile = updateLanguageServiceSourceFile ( this . currentSourceFile , scriptSnapshot , version , /*isOpen*/ true , editRange ) ;
1507+ sourceFile = updateLanguageServiceSourceFile ( this . currentSourceFile , scriptSnapshot , version , editRange ) ;
15201508 this . log ( "SyntaxTreeCache.Initialize: updateSourceFile: " + ( new Date ( ) . getTime ( ) - start ) ) ;
15211509 }
15221510
@@ -1538,21 +1526,20 @@ module ts {
15381526 }
15391527 }
15401528
1541- function setSourceFileFields ( sourceFile : SourceFile , scriptSnapshot : IScriptSnapshot , version : string , isOpen : boolean ) {
1529+ function setSourceFileFields ( sourceFile : SourceFile , scriptSnapshot : IScriptSnapshot , version : string ) {
15421530 sourceFile . version = version ;
1543- sourceFile . isOpen = isOpen ;
15441531 sourceFile . scriptSnapshot = scriptSnapshot ;
15451532 }
15461533
1547- export function createLanguageServiceSourceFile ( filename : string , scriptSnapshot : IScriptSnapshot , scriptTarget : ScriptTarget , version : string , isOpen : boolean , setNodeParents : boolean ) : SourceFile {
1534+ export function createLanguageServiceSourceFile ( filename : string , scriptSnapshot : IScriptSnapshot , scriptTarget : ScriptTarget , version : string , setNodeParents : boolean ) : SourceFile {
15481535 var sourceFile = createSourceFile ( filename , scriptSnapshot . getText ( 0 , scriptSnapshot . getLength ( ) ) , scriptTarget , setNodeParents ) ;
1549- setSourceFileFields ( sourceFile , scriptSnapshot , version , isOpen ) ;
1536+ setSourceFileFields ( sourceFile , scriptSnapshot , version ) ;
15501537 return sourceFile ;
15511538 }
15521539
15531540 export var disableIncrementalParsing = false ;
15541541
1555- export function updateLanguageServiceSourceFile ( sourceFile : SourceFile , scriptSnapshot : IScriptSnapshot , version : string , isOpen : boolean , textChangeRange : TextChangeRange ) : SourceFile {
1542+ export function updateLanguageServiceSourceFile ( sourceFile : SourceFile , scriptSnapshot : IScriptSnapshot , version : string , textChangeRange : TextChangeRange ) : SourceFile {
15561543 if ( textChangeRange && Debug . shouldAssert ( AssertionLevel . Normal ) ) {
15571544 var oldText = sourceFile . scriptSnapshot ;
15581545 var newText = scriptSnapshot ;
@@ -1573,18 +1560,18 @@ module ts {
15731560 // If we were given a text change range, and our version or open-ness changed, then
15741561 // incrementally parse this file.
15751562 if ( textChangeRange ) {
1576- if ( version !== sourceFile . version || isOpen != sourceFile . isOpen ) {
1563+ if ( version !== sourceFile . version ) {
15771564 // Once incremental parsing is ready, then just call into this function.
15781565 if ( ! disableIncrementalParsing ) {
15791566 var newSourceFile = sourceFile . update ( scriptSnapshot . getText ( 0 , scriptSnapshot . getLength ( ) ) , textChangeRange ) ;
1580- setSourceFileFields ( newSourceFile , scriptSnapshot , version , isOpen ) ;
1567+ setSourceFileFields ( newSourceFile , scriptSnapshot , version ) ;
15811568 return newSourceFile ;
15821569 }
15831570 }
15841571 }
15851572
15861573 // Otherwise, just create a new source file.
1587- return createLanguageServiceSourceFile ( sourceFile . filename , scriptSnapshot , sourceFile . languageVersion , version , isOpen , /*setNodeParents:*/ true ) ;
1574+ return createLanguageServiceSourceFile ( sourceFile . filename , scriptSnapshot , sourceFile . languageVersion , version , /*setNodeParents:*/ true ) ;
15881575 }
15891576
15901577 export function createDocumentRegistry ( ) : DocumentRegistry {
@@ -1628,13 +1615,12 @@ module ts {
16281615 filename : string ,
16291616 compilationSettings : CompilerOptions ,
16301617 scriptSnapshot : IScriptSnapshot ,
1631- version : string ,
1632- isOpen : boolean ) : SourceFile {
1618+ version : string ) : SourceFile {
16331619
16341620 var bucket = getBucketForCompilationSettings ( compilationSettings , /*createIfMissing*/ true ) ;
16351621 var entry = lookUp ( bucket , filename ) ;
16361622 if ( ! entry ) {
1637- var sourceFile = createLanguageServiceSourceFile ( filename , scriptSnapshot , compilationSettings . target , version , isOpen , /*setNodeParents:*/ false ) ;
1623+ var sourceFile = createLanguageServiceSourceFile ( filename , scriptSnapshot , compilationSettings . target , version , /*setNodeParents:*/ false ) ;
16381624
16391625 bucket [ filename ] = entry = {
16401626 sourceFile : sourceFile ,
@@ -1653,7 +1639,6 @@ module ts {
16531639 compilationSettings : CompilerOptions ,
16541640 scriptSnapshot : IScriptSnapshot ,
16551641 version : string ,
1656- isOpen : boolean ,
16571642 textChangeRange : TextChangeRange
16581643 ) : SourceFile {
16591644
@@ -1662,7 +1647,7 @@ module ts {
16621647 var entry = lookUp ( bucket , filename ) ;
16631648 Debug . assert ( entry !== undefined ) ;
16641649
1665- entry . sourceFile = updateLanguageServiceSourceFile ( entry . sourceFile , scriptSnapshot , version , isOpen , textChangeRange ) ;
1650+ entry . sourceFile = updateLanguageServiceSourceFile ( entry . sourceFile , scriptSnapshot , version , textChangeRange ) ;
16661651 return entry . sourceFile ;
16671652 }
16681653
@@ -1962,7 +1947,7 @@ module ts {
19621947 }
19631948
19641949 function sourceFileUpToDate ( sourceFile : SourceFile ) : boolean {
1965- return sourceFile && sourceFile . version === hostCache . getVersion ( sourceFile . filename ) && sourceFile . isOpen === hostCache . isOpen ( sourceFile . filename ) ;
1950+ return sourceFile && sourceFile . version === hostCache . getVersion ( sourceFile . filename ) ;
19661951 }
19671952
19681953 function programUpToDate ( ) : boolean {
@@ -2031,7 +2016,6 @@ module ts {
20312016 var filename = hostfilenames [ i ] ;
20322017
20332018 var version = hostCache . getVersion ( filename ) ;
2034- var isOpen = hostCache . isOpen ( filename ) ;
20352019 var scriptSnapshot = hostCache . getScriptSnapshot ( filename ) ;
20362020
20372021 var sourceFile : SourceFile = getSourceFile ( filename ) ;
@@ -2043,21 +2027,13 @@ module ts {
20432027 continue ;
20442028 }
20452029
2046- // Only perform incremental parsing on open files that are being edited. If a file was
2047- // open, but is now closed, we want to re-parse entirely so we don't have any tokens that
2048- // are holding onto expensive script snapshot instances on the host. Similarly, if a
2049- // file was closed, then we always want to re-parse. This is so our tree doesn't keep
2050- // the old buffer alive that represented the file on disk (as the host has moved to a
2051- // new text buffer).
20522030 var textChangeRange : TextChangeRange = null ;
2053- if ( sourceFile . isOpen && isOpen ) {
2054- textChangeRange = hostCache . getChangeRange ( filename , sourceFile . version , sourceFile . scriptSnapshot ) ;
2055- }
2031+ textChangeRange = hostCache . getChangeRange ( filename , sourceFile . version , sourceFile . scriptSnapshot ) ;
20562032
2057- sourceFile = documentRegistry . updateDocument ( sourceFile , filename , compilationSettings , scriptSnapshot , version , isOpen , textChangeRange ) ;
2033+ sourceFile = documentRegistry . updateDocument ( sourceFile , filename , compilationSettings , scriptSnapshot , version , textChangeRange ) ;
20582034 }
20592035 else {
2060- sourceFile = documentRegistry . acquireDocument ( filename , compilationSettings , scriptSnapshot , version , isOpen ) ;
2036+ sourceFile = documentRegistry . acquireDocument ( filename , compilationSettings , scriptSnapshot , version ) ;
20612037 }
20622038
20632039 // Remember the new sourceFile
0 commit comments