File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -25,21 +25,19 @@ function init(modules: { typescript: typeof tsserver }): any {
2525 proxy [ k ] = ( ...args : Array < { } > ) => x . apply ( info . languageService , args ) ;
2626 }
2727
28- const program = info . languageService . getProgram ( ) ;
29- if ( program === undefined ) {
30- return proxy ;
31- }
32-
33- const checker = makeFunctionlessChecker ( program . getTypeChecker ( ) ) ;
34-
3528 proxy . getSemanticDiagnostics = ( fileName ) : ts . Diagnostic [ ] => {
3629 const errors = info . languageService . getSemanticDiagnostics ( fileName ) ;
30+ const program = info . languageService . getProgram ( ) ;
3731
38- const sf = program . getSourceFile ( fileName ) ;
32+ if ( program !== undefined ) {
33+ const checker = makeFunctionlessChecker ( program . getTypeChecker ( ) ) ;
34+ const sf = program . getSourceFile ( fileName ) ;
3935
40- if ( sf ) {
41- const customErrors = validate ( ts as any , checker , sf ) ;
42- return [ ...errors , ...customErrors ] ;
36+ if ( sf ) {
37+ const customErrors = validate ( ts as any , checker , sf , logger ) ;
38+ logger . info ( `Functionless found ${ customErrors . length } errors` ) ;
39+ return [ ...errors , ...customErrors ] ;
40+ }
4341 }
4442
4543 return errors ;
You can’t perform that action at this time.
0 commit comments