File tree Expand file tree Collapse file tree 4 files changed +11
-13
lines changed Expand file tree Collapse file tree 4 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -1504,12 +1504,9 @@ pub(crate) fn handle_inlay_hints_resolve(
1504
1504
) -> anyhow:: Result < InlayHint > {
1505
1505
let _p = tracing:: span!( tracing:: Level :: INFO , "handle_inlay_hints_resolve" ) . entered ( ) ;
1506
1506
1507
- let data = match original_hint. data . take ( ) {
1508
- Some ( it) => it,
1509
- None => return Ok ( original_hint) ,
1510
- } ;
1511
-
1507
+ let Some ( data) = original_hint. data . take ( ) else { return Ok ( original_hint) } ;
1512
1508
let resolve_data: lsp_ext:: InlayHintResolveData = serde_json:: from_value ( data) ?;
1509
+ let Some ( hash) = resolve_data. hash . parse ( ) . ok ( ) else { return Ok ( original_hint) } ;
1513
1510
let file_id = FileId :: from_raw ( resolve_data. file_id ) ;
1514
1511
anyhow:: ensure!( snap. file_exists( file_id) , "Invalid LSP resolve data" ) ;
1515
1512
@@ -1521,14 +1518,12 @@ pub(crate) fn handle_inlay_hints_resolve(
1521
1518
& forced_resolve_inlay_hints_config,
1522
1519
file_id,
1523
1520
hint_position,
1524
- resolve_data . hash ,
1521
+ hash,
1525
1522
|hint| {
1526
1523
std:: hash:: BuildHasher :: hash_one (
1527
1524
& std:: hash:: BuildHasherDefault :: < ide_db:: FxHasher > :: default ( ) ,
1528
1525
hint,
1529
1526
)
1530
- // json only supports numbers up to 2^53 - 1 as integers, so mask the rest
1531
- & ( ( 1 << 53 ) - 1 )
1532
1527
} ,
1533
1528
) ?;
1534
1529
Original file line number Diff line number Diff line change @@ -794,7 +794,8 @@ pub struct CompletionResolveData {
794
794
#[ derive( Debug , Serialize , Deserialize ) ]
795
795
pub struct InlayHintResolveData {
796
796
pub file_id : u32 ,
797
- pub hash : u64 ,
797
+ // This is a string instead of a u64 as javascript can't represent u64 fully
798
+ pub hash : String ,
798
799
}
799
800
800
801
#[ derive( Debug , Serialize , Deserialize ) ]
Original file line number Diff line number Diff line change @@ -453,8 +453,6 @@ pub(crate) fn inlay_hint(
453
453
& std:: hash:: BuildHasherDefault :: < FxHasher > :: default ( ) ,
454
454
& inlay_hint,
455
455
)
456
- // json only supports numbers up to 2^53 - 1 as integers, so mask the rest
457
- & ( ( 1 << 53 ) - 1 )
458
456
} ) ;
459
457
460
458
let mut something_to_resolve = false ;
@@ -481,7 +479,11 @@ pub(crate) fn inlay_hint(
481
479
482
480
let data = match resolve_hash {
483
481
Some ( hash) if something_to_resolve => Some (
484
- to_value ( lsp_ext:: InlayHintResolveData { file_id : file_id. index ( ) , hash } ) . unwrap ( ) ,
482
+ to_value ( lsp_ext:: InlayHintResolveData {
483
+ file_id : file_id. index ( ) ,
484
+ hash : hash. to_string ( ) ,
485
+ } )
486
+ . unwrap ( ) ,
485
487
) ,
486
488
_ => None ,
487
489
} ;
Original file line number Diff line number Diff line change 1
1
<!-- -
2
- lsp/ext.rs hash: 4aacf4cca1c9ff5e
2
+ lsp/ext.rs hash: dd51139b0530147e
3
3
4
4
If you need to change the above hash to make the test pass, please check if you
5
5
need to adjust this doc as well and ping this issue:
You can’t perform that action at this time.
0 commit comments