@@ -2116,7 +2116,7 @@ namespace ts.projectSystem {
2116
2116
2117
2117
const scriptInfo = project . getScriptInfo ( file1 . path ) ;
2118
2118
const snap = scriptInfo . getSnapshot ( ) ;
2119
- const actualText = snap . getText ( 0 , snap . getLength ( ) ) ;
2119
+ const actualText = getSnapshotText ( snap ) ;
2120
2120
assert . equal ( actualText , "" , `expected content to be empty string, got "${ actualText } "` ) ;
2121
2121
2122
2122
projectService . openClientFile ( file1 . path , `var x = 1;` ) ;
@@ -2128,8 +2128,7 @@ namespace ts.projectSystem {
2128
2128
projectService . closeClientFile ( file1 . path ) ;
2129
2129
2130
2130
const scriptInfo2 = project . getScriptInfo ( file1 . path ) ;
2131
- const snap2 = scriptInfo2 . getSnapshot ( ) ;
2132
- const actualText2 = snap2 . getText ( 0 , snap . getLength ( ) ) ;
2131
+ const actualText2 = getSnapshotText ( scriptInfo2 . getSnapshot ( ) ) ;
2133
2132
assert . equal ( actualText2 , "" , `expected content to be empty string, got "${ actualText2 } "` ) ;
2134
2133
} ) ;
2135
2134
@@ -4178,7 +4177,7 @@ namespace ts.projectSystem {
4178
4177
// verify content
4179
4178
const projectServiice = session . getProjectService ( ) ;
4180
4179
const snap1 = projectServiice . getScriptInfo ( f1 . path ) . getSnapshot ( ) ;
4181
- assert . equal ( snap1 . getText ( 0 , snap1 . getLength ( ) ) , tmp . content , "content should be equal to the content of temp file" ) ;
4180
+ assert . equal ( getSnapshotText ( snap1 ) , tmp . content , "content should be equal to the content of temp file" ) ;
4182
4181
4183
4182
// reload from original file file
4184
4183
session . executeCommand ( < server . protocol . ReloadRequest > {
@@ -4190,7 +4189,7 @@ namespace ts.projectSystem {
4190
4189
4191
4190
// verify content
4192
4191
const snap2 = projectServiice . getScriptInfo ( f1 . path ) . getSnapshot ( ) ;
4193
- assert . equal ( snap2 . getText ( 0 , snap2 . getLength ( ) ) , f1 . content , "content should be equal to the content of original file" ) ;
4192
+ assert . equal ( getSnapshotText ( snap2 ) , f1 . content , "content should be equal to the content of original file" ) ;
4194
4193
4195
4194
} ) ;
4196
4195
@@ -4280,7 +4279,7 @@ namespace ts.projectSystem {
4280
4279
4281
4280
function checkScriptInfoContents ( contentsOfInfo : string , captionForContents : string ) {
4282
4281
const snap = info . getSnapshot ( ) ;
4283
- assert . equal ( snap . getText ( 0 , snap . getLength ( ) ) , contentsOfInfo , "content should be equal to " + captionForContents ) ;
4282
+ assert . equal ( getSnapshotText ( snap ) , contentsOfInfo , "content should be equal to " + captionForContents ) ;
4284
4283
}
4285
4284
} ) ;
4286
4285
} ) ;
0 commit comments