@@ -1495,7 +1495,7 @@ async fn pull_biome_quick_fixes() -> Result<()> {
14951495}
14961496
14971497#[ tokio:: test]
1498- async fn pull_quick_fixes_not_include_unsafe ( ) -> Result < ( ) > {
1498+ async fn pull_quick_fixes_include_unsafe ( ) -> Result < ( ) > {
14991499 let factory = ServerFactory :: default ( ) ;
15001500 let ( service, client) = factory. create ( ) . into_inner ( ) ;
15011501 let ( stream, sink) = client. split ( ) ;
@@ -1647,7 +1647,7 @@ async fn pull_quick_fixes_not_include_unsafe() -> Result<()> {
16471647 let expected_toplevel_suppression_action = CodeActionOrCommand :: CodeAction ( CodeAction {
16481648 title : String :: from ( "Suppress rule lint/suspicious/noDoubleEquals for the whole file." ) ,
16491649 kind : Some ( CodeActionKind :: new ( "quickfix.suppressRule.topLevel.biome" ) ) ,
1650- diagnostics : Some ( vec ! [ unsafe_fixable] ) ,
1650+ diagnostics : Some ( vec ! [ unsafe_fixable. clone ( ) ] ) ,
16511651 edit : Some ( WorkspaceEdit {
16521652 changes : Some ( top_level_changes) ,
16531653 document_changes : None ,
@@ -1659,9 +1659,44 @@ async fn pull_quick_fixes_not_include_unsafe() -> Result<()> {
16591659 data : None ,
16601660 } ) ;
16611661
1662+ let mut unsafe_action_changes = HashMap :: default ( ) ;
1663+ unsafe_action_changes. insert (
1664+ uri ! ( "document.js" ) ,
1665+ vec ! [ TextEdit {
1666+ range: Range {
1667+ start: Position {
1668+ line: 0 ,
1669+ character: 7 ,
1670+ } ,
1671+ end: Position {
1672+ line: 0 ,
1673+ character: 7 ,
1674+ } ,
1675+ } ,
1676+ new_text: String :: from( "=" ) ,
1677+ } ] ,
1678+ ) ;
1679+ let unsafe_action = CodeActionOrCommand :: CodeAction ( CodeAction {
1680+ title : String :: from ( "Use === instead." ) ,
1681+ kind : Some ( CodeActionKind :: new (
1682+ "quickfix.biome.suspicious.noDoubleEquals" ,
1683+ ) ) ,
1684+ diagnostics : Some ( vec ! [ unsafe_fixable] ) ,
1685+ edit : Some ( WorkspaceEdit {
1686+ changes : Some ( unsafe_action_changes) ,
1687+ document_changes : None ,
1688+ change_annotations : None ,
1689+ } ) ,
1690+ command : None ,
1691+ is_preferred : None ,
1692+ disabled : None ,
1693+ data : None ,
1694+ } ) ;
1695+
16621696 assert_eq ! (
16631697 res,
16641698 vec![
1699+ unsafe_action,
16651700 expected_inline_suppression_action,
16661701 expected_toplevel_suppression_action,
16671702 ]
0 commit comments