File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -267,15 +267,6 @@ namespace ts.server {
267267 }
268268 }
269269
270- saveTo ( filename : NormalizedPath , tmpfilename : NormalizedPath ) {
271- const script = this . projectService . getScriptInfoForNormalizedPath ( filename ) ;
272- if ( script ) {
273- Debug . assert ( script . isAttached ( this ) ) ;
274- const snap = script . snap ( ) ;
275- this . projectService . host . writeFile ( tmpfilename , snap . getText ( 0 , snap . getLength ( ) ) ) ;
276- }
277- }
278-
279270 reloadScript ( filename : NormalizedPath ) : boolean {
280271 const script = this . projectService . getScriptInfoForNormalizedPath ( filename ) ;
281272 if ( script ) {
Original file line number Diff line number Diff line change @@ -110,6 +110,11 @@ namespace ts.server {
110110 this . markContainingProjectsAsDirty ( ) ;
111111 }
112112
113+ saveTo ( fileName : string ) {
114+ const snap = this . snap ( ) ;
115+ this . host . writeFile ( fileName , snap . getText ( 0 , snap . getLength ( ) ) ) ;
116+ }
117+
113118 reloadFromFile ( ) {
114119 this . svc . reloadFromFile ( this . fileName ) ;
115120 this . markContainingProjectsAsDirty ( ) ;
Original file line number Diff line number Diff line change @@ -1015,12 +1015,9 @@ namespace ts.server {
10151015 }
10161016
10171017 private saveToTmp ( fileName : string , tempFileName : string ) {
1018- const file = toNormalizedPath ( fileName ) ;
1019- const tmpfile = toNormalizedPath ( tempFileName ) ;
1020-
1021- const project = this . projectService . getDefaultProjectForFile ( file ) ;
1022- if ( project ) {
1023- project . saveTo ( file , tmpfile ) ;
1018+ const scriptInfo = this . projectService . getScriptInfo ( fileName ) ;
1019+ if ( scriptInfo ) {
1020+ scriptInfo . saveTo ( tempFileName ) ;
10241021 }
10251022 }
10261023
You can’t perform that action at this time.
0 commit comments