@@ -150,7 +150,9 @@ export class NpmWorker {
150
150
if ( pck ) {
151
151
if ( this . isRefreshNeeded ( pck ) ) {
152
152
this . updatePackages ( dependency )
153
- . catch ( ( dependency ) => atom . notifications . addWarning ( `Unable to update ${ dependency . name } ` ) ) ;
153
+ /* eslint-disable no-console */
154
+ . catch ( ( dependency ) => console . warn ( `Unable to update ${ dependency . name } ` ) ) ;
155
+ /* eslint-enable no-console */
154
156
}
155
157
156
158
return Promise . resolve ( {
@@ -213,7 +215,7 @@ export class NpmWorker {
213
215
*/
214
216
check ( textEditor ) {
215
217
const filepath = textEditor . getPath ( ) ;
216
- if ( ! this . isTargettingFile ( filepath ) ) {
218
+ if ( ! filepath || ! this . isTargettingFile ( filepath ) ) {
217
219
return [ ] ;
218
220
}
219
221
@@ -261,9 +263,10 @@ export class NpmWorker {
261
263
*/
262
264
suggestion ( textEditor , bufferPosition ) {
263
265
const filepath = textEditor . getPath ( ) ;
264
- if ( ! this . isTargettingFile ( filepath ) ) {
266
+ if ( ! filepath || ! this . isTargettingFile ( filepath ) ) {
265
267
return [ ] ;
266
268
}
269
+
267
270
const lineRegex = / ^ " ( [ ^ " ] + ) " * : * " ( [ ^ " ] * ) $ / g;
268
271
269
272
const line = textEditor . lineTextForBufferRow ( bufferPosition . row ) ;
@@ -308,7 +311,7 @@ export class NpmWorker {
308
311
link ( textEditor , text , range ) {
309
312
const filepath = textEditor . getPath ( ) ;
310
313
311
- if ( ! this . isTargettingFile ( filepath ) ) {
314
+ if ( ! filepath || ! this . isTargettingFile ( filepath ) ) {
312
315
return ;
313
316
}
314
317
0 commit comments