File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
packages/language-server/lib Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -230,17 +230,19 @@ export function analyze(
230
230
}
231
231
232
232
function findEffectByEffectHandlerPosition ( position : number ) {
233
- return signals . find ( ref =>
233
+ return signals . filter ( ref =>
234
234
ref . sideEffectInfo && ref . sideEffectInfo . handler . getStart ( sourceFile ) <= position
235
235
&& ref . sideEffectInfo . handler . getEnd ( ) >= position
236
- ) ;
236
+ ) . sort ( ( a , b ) =>
237
+ a . sideEffectInfo ! . handler . getWidth ( sourceFile ) - b . sideEffectInfo ! . handler . getWidth ( sourceFile )
238
+ ) [ 0 ] ;
237
239
}
238
240
239
241
function findEffectByDepsHandlerPosition ( position : number ) {
240
- return signals . find ( ref =>
242
+ return signals . filter ( ref =>
241
243
ref . trackInfo && ref . trackInfo . depsHandler . getStart ( sourceFile ) <= position
242
244
&& ref . trackInfo . depsHandler . getEnd ( ) >= position
243
- ) ;
245
+ ) . sort ( ( a , b ) => a . trackInfo ! . depsHandler . getWidth ( sourceFile ) - b . trackInfo ! . depsHandler . getWidth ( sourceFile ) ) [ 0 ] ;
244
246
}
245
247
}
246
248
You can’t perform that action at this time.
0 commit comments