File tree 3 files changed +7
-7
lines changed
3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -306,14 +306,14 @@ var TSS = (function () {
306
306
file = _this . resolveRelativePath ( m [ 3 ] ) ;
307
307
pos = _this . fileCache . lineColToPosition ( file , line , col ) ;
308
308
locs = _this . ls . getDefinitionAtPosition ( file , pos ) ; // NOTE: multiple definitions
309
- info = locs . map ( function ( def ) { return ( {
309
+ info = locs && locs . map ( function ( def ) { return ( {
310
310
def : def ,
311
311
file : def && def . fileName ,
312
312
min : def && _this . fileCache . positionToLineCol ( def . fileName , def . textSpan . start ) ,
313
313
lim : def && _this . fileCache . positionToLineCol ( def . fileName , ts . textSpanEnd ( def . textSpan ) )
314
314
} ) ; } ) ;
315
315
// TODO: what about multiple definitions?
316
- _this . output ( info [ 0 ] || null ) ;
316
+ _this . output ( ( locs && info [ 0 ] ) || null ) ;
317
317
}
318
318
else if ( m = match ( cmd , / ^ ( r e f e r e n c e s | o c c u r r e n c e s ) ( \d + ) ( \d + ) ( .* ) $ / ) ) {
319
319
line = parseInt ( m [ 2 ] ) ;
Original file line number Diff line number Diff line change @@ -162,10 +162,10 @@ function! TSSdef(cmd)
162
162
let info = TSScmd (" definition" ,{})
163
163
if type (info)!= type ({}) || info.file == ' null' || type (info.min )!= type ({})
164
164
\ || type (info.min .line )!= type (0 ) || type (info.min .character )!= type (0 )
165
- if type (info)== type (" " )
166
- echoerr info
167
- else
165
+ if type (info)== type (" " ) && info== ' null'
168
166
echoerr ' no useable definition information'
167
+ else
168
+ echoerr string (info)
169
169
endif
170
170
return info
171
171
endif
Original file line number Diff line number Diff line change @@ -374,15 +374,15 @@ class TSS {
374
374
pos = this . fileCache . lineColToPosition ( file , line , col ) ;
375
375
locs = this . ls . getDefinitionAtPosition ( file , pos ) ; // NOTE: multiple definitions
376
376
377
- info = locs . map ( def => ( {
377
+ info = locs && locs . map ( def => ( {
378
378
def : def ,
379
379
file : def && def . fileName ,
380
380
min : def && this . fileCache . positionToLineCol ( def . fileName , def . textSpan . start ) ,
381
381
lim : def && this . fileCache . positionToLineCol ( def . fileName , ts . textSpanEnd ( def . textSpan ) )
382
382
} ) ) ;
383
383
384
384
// TODO: what about multiple definitions?
385
- this . output ( info [ 0 ] || null ) ;
385
+ this . output ( ( locs && info [ 0 ] ) || null ) ;
386
386
387
387
} else if ( m = match ( cmd , / ^ ( r e f e r e n c e s | o c c u r r e n c e s ) ( \d + ) ( \d + ) ( .* ) $ / ) ) {
388
388
You can’t perform that action at this time.
0 commit comments