@@ -255,6 +255,10 @@ define(function (require, exports, module) {
255255 return response . promise ( ) ;
256256 }
257257
258+ providerList = providerList . filter ( function ( provider ) {
259+ return ! provider . canInspect || provider . canInspect ( file . fullPath ) ;
260+ } ) ;
261+
258262 DocumentManager . getDocumentText ( file )
259263 . done ( function ( fileText ) {
260264 var perfTimerInspector = PerfUtils . markStart ( "CodeInspection:\t" + file . fullPath ) ,
@@ -284,6 +288,7 @@ define(function (require, exports, module) {
284288 runPromise . resolve ( scanResult ) ;
285289 } )
286290 . catch ( function ( err ) {
291+ err = err || new Error ( "Unknown error while inspecting " + file . fullPath ) ;
287292 PerfUtils . finalizeMeasurement ( perfTimerProvider ) ;
288293 var errError = {
289294 pos : { line : - 1 , col : 0 } ,
@@ -305,7 +310,8 @@ define(function (require, exports, module) {
305310 message : StringUtils . format ( Strings . LINTER_FAILED , provider . name , err ) ,
306311 type : Type . ERROR
307312 } ;
308- console . error ( "[CodeInspection] Provider " + provider . name + " (sync) threw an error: " + err . stack ) ;
313+ console . error ( "[CodeInspection] Provider " + provider . name +
314+ " (sync) threw an error: " + err && ( err . stack || err ) ) ;
309315 runPromise . resolve ( { errors : [ errError ] } ) ;
310316 }
311317 }
@@ -558,9 +564,13 @@ define(function (require, exports, module) {
558564 return ;
559565 }
560566
561- var currentDoc = DocumentManager . getCurrentDocument ( ) ,
567+ let currentDoc = DocumentManager . getCurrentDocument ( ) ,
562568 providerList = currentDoc && getProvidersForPath ( currentDoc . file . fullPath ) ;
563569
570+ providerList = providerList && providerList . filter ( function ( provider ) {
571+ return ! provider . canInspect || provider . canInspect ( currentDoc . file . fullPath ) ;
572+ } ) ;
573+
564574 if ( providerList && providerList . length ) {
565575 var numProblems = 0 ;
566576 var aborted = false ;
0 commit comments