File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -358,7 +358,11 @@ pub(crate) fn signature_help(
358
358
let params = call_info
359
359
. parameter_ranges ( )
360
360
. iter ( )
361
- . map ( |it| [ u32:: from ( it. start ( ) ) , u32:: from ( it. end ( ) ) ] )
361
+ . map ( |it| {
362
+ let start = call_info. signature [ ..it. start ( ) . into ( ) ] . chars ( ) . count ( ) as u32 ;
363
+ let end = call_info. signature [ ..it. end ( ) . into ( ) ] . chars ( ) . count ( ) as u32 ;
364
+ [ start, end]
365
+ } )
362
366
. map ( |label_offsets| lsp_types:: ParameterInformation {
363
367
label : lsp_types:: ParameterLabel :: LabelOffsets ( label_offsets) ,
364
368
documentation : None ,
@@ -375,9 +379,9 @@ pub(crate) fn signature_help(
375
379
label. push_str ( ", " ) ;
376
380
}
377
381
first = false ;
378
- let start = label. len ( ) as u32 ;
382
+ let start = label. chars ( ) . count ( ) as u32 ;
379
383
label. push_str ( param) ;
380
- let end = label. len ( ) as u32 ;
384
+ let end = label. chars ( ) . count ( ) as u32 ;
381
385
params. push ( lsp_types:: ParameterInformation {
382
386
label : lsp_types:: ParameterLabel :: LabelOffsets ( [ start, end] ) ,
383
387
documentation : None ,
You can’t perform that action at this time.
0 commit comments