@@ -875,8 +875,8 @@ module ts {
875
875
getScriptVersion ( fileName : string ) : string ;
876
876
getScriptIsOpen ( fileName : string ) : boolean ;
877
877
getScriptSnapshot ( fileName : string ) : IScriptSnapshot ;
878
- getLocalizedDiagnosticMessages ( ) : any ;
879
- getCancellationToken ( ) : CancellationToken ;
878
+ getLocalizedDiagnosticMessages ? ( ) : any ;
879
+ getCancellationToken ? ( ) : CancellationToken ;
880
880
getCurrentDirectory ( ) : string ;
881
881
getDefaultLibFilename ( options : CompilerOptions ) : string ;
882
882
}
@@ -2395,12 +2395,12 @@ module ts {
2395
2395
var useCaseSensitivefilenames = false ;
2396
2396
var sourceFilesByName : Map < SourceFile > = { } ;
2397
2397
var documentRegistry = documentRegistry ;
2398
- var cancellationToken = new CancellationTokenObject ( host . getCancellationToken ( ) ) ;
2398
+ var cancellationToken = new CancellationTokenObject ( host . getCancellationToken && host . getCancellationToken ( ) ) ;
2399
2399
var activeCompletionSession : CompletionSession ; // The current active completion session, used to get the completion entry details
2400
2400
var writer : ( filename : string , data : string , writeByteOrderMark : boolean ) => void = undefined ;
2401
2401
2402
2402
// Check if the localized messages json is set, otherwise query the host for it
2403
- if ( ! localizedDiagnosticMessages ) {
2403
+ if ( ! localizedDiagnosticMessages && host . getLocalizedDiagnosticMessages ) {
2404
2404
localizedDiagnosticMessages = host . getLocalizedDiagnosticMessages ( ) ;
2405
2405
}
2406
2406
0 commit comments