@@ -61,6 +61,11 @@ module ts {
6161 scriptSnapshot : IScriptSnapshot ;
6262 nameTable : Map < string > ;
6363 getNamedDeclarations ( ) : Declaration [ ] ;
64+ getLineAndCharacterFromPosition ( pos : number ) : LineAndCharacter ;
65+ getLineStarts ( ) : number [ ] ;
66+ getPositionFromLineAndCharacter ( line : number , character : number ) : number ;
67+ getSyntacticDiagnostics ( ) : Diagnostic [ ] ;
68+ update ( newText : string , textChangeRange : TextChangeRange ) : SourceFile ;
6469 }
6570
6671 /**
@@ -716,22 +721,16 @@ module ts {
716721 public filename : string ;
717722 public text : string ;
718723 public scriptSnapshot : IScriptSnapshot ;
724+ public lineMap : number [ ] ;
719725
720726 public statements : NodeArray < Statement > ;
721727 public endOfFileToken : Node ;
722728
723- // These methods will have their implementation provided by the implementation the
724- // compiler actually exports off of SourceFile.
725- public getLineAndCharacterFromPosition : ( position : number ) => LineAndCharacter ;
726- public getPositionFromLineAndCharacter : ( line : number , character : number ) => number ;
727- public getLineStarts : ( ) => number [ ] ;
728- public getSyntacticDiagnostics : ( ) => Diagnostic [ ] ;
729- public update : ( newText : string , textChangeRange : TextChangeRange ) => SourceFile ;
730-
731729 public amdDependencies : string [ ] ;
732730 public amdModuleName : string ;
733731 public referencedFiles : FileReference [ ] ;
734732
733+ public syntacticDiagnostics : Diagnostic [ ] ;
735734 public referenceDiagnostics : Diagnostic [ ] ;
736735 public parseDiagnostics : Diagnostic [ ] ;
737736 public semanticDiagnostics : Diagnostic [ ] ;
@@ -748,6 +747,26 @@ module ts {
748747
749748 private namedDeclarations : Declaration [ ] ;
750749
750+ public getSyntacticDiagnostics ( ) : Diagnostic [ ] {
751+ return getSyntacticDiagnostics ( this ) ;
752+ }
753+
754+ public update ( newText : string , textChangeRange : TextChangeRange ) : SourceFile {
755+ return updateSourceFile ( this , newText , textChangeRange ) ;
756+ }
757+
758+ public getLineAndCharacterFromPosition ( position : number ) : LineAndCharacter {
759+ return getLineAndCharacterOfPosition ( this , position ) ;
760+ }
761+
762+ public getLineStarts ( ) : number [ ] {
763+ return getLineStarts ( this ) ;
764+ }
765+
766+ public getPositionFromLineAndCharacter ( line : number , character : number ) : number {
767+ return getPositionFromLineAndCharacter ( this , line , character ) ;
768+ }
769+
751770 public getNamedDeclarations ( ) {
752771 if ( ! this . namedDeclarations ) {
753772 var sourceFile = this ;
@@ -1633,7 +1652,7 @@ module ts {
16331652 if ( version !== sourceFile . version ) {
16341653 // Once incremental parsing is ready, then just call into this function.
16351654 if ( ! disableIncrementalParsing ) {
1636- var newSourceFile = sourceFile . update ( scriptSnapshot . getText ( 0 , scriptSnapshot . getLength ( ) ) , textChangeRange ) ;
1655+ var newSourceFile = updateSourceFile ( sourceFile , scriptSnapshot . getText ( 0 , scriptSnapshot . getLength ( ) ) , textChangeRange ) ;
16371656 setSourceFileFields ( newSourceFile , scriptSnapshot , version ) ;
16381657 // after incremental parsing nameTable might not be up-to-date
16391658 // drop it so it can be lazily recreated later
0 commit comments