File tree 5 files changed +23
-5
lines changed 5 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -62,5 +62,5 @@ var RView = (function (_super) {
62
62
} ) ;
63
63
return RView ;
64
64
} ( sp . ScrollView ) ) ;
65
- exports . RView = RView ;
66
65
RView . protocol = 'atomtsview:' ;
66
+ exports . RView = RView ;
Original file line number Diff line number Diff line change @@ -74,8 +74,8 @@ var RenameView = (function (_super) {
74
74
} ;
75
75
return RenameView ;
76
76
} ( view . View ) ) ;
77
- exports . RenameView = RenameView ;
78
77
RenameView . content = html ;
78
+ exports . RenameView = RenameView ;
79
79
var panel ;
80
80
function attach ( ) {
81
81
exports . panelView = new RenameView ( { } ) ;
Original file line number Diff line number Diff line change @@ -248,7 +248,7 @@ var LanguageServiceHost = (function () {
248
248
if ( script ) {
249
249
return getScriptSnapShot ( script ) ;
250
250
}
251
- else if ( fs . existsSync ( fileName ) ) {
251
+ else if ( _this . fileExists ( fileName ) ) {
252
252
_this . config . project . files . push ( fileName ) ;
253
253
_this . addScript ( fileName ) ;
254
254
return _this . getScriptSnapshot ( fileName ) ;
@@ -259,6 +259,15 @@ var LanguageServiceHost = (function () {
259
259
return _this . config . projectFileDirectory ;
260
260
} ;
261
261
this . getDefaultLibFileName = ts . getDefaultLibFileName ;
262
+ this . fileExists = function ( path ) {
263
+ try {
264
+ var stat = fs . statSync ( path ) ;
265
+ return stat . isFile ( ) ;
266
+ }
267
+ catch ( error ) {
268
+ return false ;
269
+ }
270
+ } ;
262
271
if ( ! config . project . compilerOptions . noLib && ! config . project . compilerOptions . lib ) {
263
272
this . addScript ( exports . getDefaultLibFilePath ( config . project . compilerOptions ) ) ;
264
273
}
Original file line number Diff line number Diff line cha
8000
nge @@ -7,7 +7,7 @@ var path = require("path");
7
7
function resolve ( ) {
8
8
var args = [ ] ;
9
9
for ( var _i = 0 ; _i < arguments . length ; _i ++ ) {
10
- args [ _i - 0 ] = arguments [ _i ] ;
10
+ args [ _i ] = arguments [ _i ] ;
11
11
}
12
12
return consistentPath ( path . resolve . apply ( path , args ) ) ;
13
13
}
Original file line number Diff line number Diff line change @@ -378,7 +378,7 @@ export class LanguageServiceHost implements ts.LanguageServiceHost {
378
378
return getScriptSnapShot ( script ) ;
379
379
}
380
380
// This script should be a part of the project if it exists
381
- else if ( fs . existsSync ( fileName ) ) {
381
+ else if ( this . fileExists ( fileName ) ) {
382
382
this . config . project . files . push ( fileName ) ;
383
383
this . addScript ( fileName ) ;
384
384
return this . getScriptSnapshot ( fileName ) ;
@@ -389,4 +389,13 @@ export class LanguageServiceHost implements ts.LanguageServiceHost {
389
389
return this . config . projectFileDirectory ;
390
390
}
391
391
getDefaultLibFileName = ts . getDefaultLibFileName ;
392
+
393
+ fileExists = ( path : string ) => {
394
+ try {
395
+ const stat = fs . statSync ( path )
396
+ return stat . isFile ( )
397
+ } catch ( error ) {
398
+ return false
399
+ }
400
+ }
392
401
}
You can’t perform that action at this time.
0 commit comments