File tree 4 files changed +18
-0
lines changed
4 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -492,6 +492,9 @@ namespace Harness.LanguageService {
492
492
getNonBoundSourceFile ( fileName : string ) : ts . SourceFile {
493
493
throw new Error ( "SourceFile can not be marshaled across the shim layer." ) ;
494
494
}
495
+ getSourceFile ( fileName : string ) : ts . SourceFile {
496
+ throw new Error ( "SourceFile can not be marshaled across the shim layer." ) ;
497
+ }
495
498
dispose ( ) : void { this . shim . dispose ( { } ) ; }
496
499
}
497
500
Original file line number Diff line number Diff line change @@ -678,6 +678,10 @@ namespace ts.server {
678
678
throw new Error ( "SourceFile objects are not serializable through the server protocol." ) ;
679
679
}
680
680
681
+ getSourceFile ( fileName : string ) : SourceFile {
682
+ throw new Error ( "SourceFile objects are not serializable through the server protocol." ) ;
683
+ }
684
+
681
685
cleanupSemanticCache ( ) : void {
682
686
throw new Error ( "cleanupSemanticCache is not available through the server layer." ) ;
683
687
}
Original file line number Diff line number Diff line change @@ -1401,6 +1401,10 @@ namespace ts {
1401
1401
return syntaxTreeCache . getCurrentSourceFile ( fileName ) ;
1402
1402
}
1403
1403
1404
+ function getSourceFile ( fileName : string ) : SourceFile {
1405
+ return getNonBoundSourceFile ( fileName ) ;
1406
+ }
1407
+
1404
1408
function getNameOrDottedNameSpan ( fileName : string , startPos : number , endPos : number ) : TextSpan {
1405
1409
const sourceFile = syntaxTreeCache . getCurrentSourceFile ( fileName ) ;
1406
1410
@@ -1812,6 +1816,7 @@ namespace ts {
1812
1816
isValidBraceCompletionAtPosition,
1813
1817
getEmitOutput,
1814
1818
getNonBoundSourceFile,
1819
+ getSourceFile,
1815
1820
getProgram
1816
1821
} ;
1817
1822
}
Original file line number Diff line number Diff line change @@ -240,6 +240,12 @@ namespace ts {
240
240
241
241
/* @internal */ getNonBoundSourceFile ( fileName : string ) : SourceFile ;
242
242
243
+ /**
244
+ * @internal
245
+ * @deprecated Use ts.createSourceFile instead.
246
+ */
247
+ getSourceFile ( fileName : string ) : SourceFile ;
248
+
243
249
dispose ( ) : void ;
244
250
}
245
251
You can’t perform that action at this time.
0 commit comments