@@ -2,11 +2,11 @@ use std::{fmt::Write as _, io::Write as _};
22
33use gen_lsp_server:: ErrorCode ;
44use lsp_types:: {
5- CodeAction , CodeActionResponse , CodeLens , Command , Diagnostic , DiagnosticSeverity ,
6- DocumentFormattingParams , DocumentHighlight , DocumentSymbol , FoldingRange , FoldingRangeKind ,
7- FoldingRangeParams , Hover , HoverContents , Location , MarkupContent , MarkupKind , Position ,
8- PrepareRenameResponse , Range , RenameParams , SymbolInformation , TextDocumentIdentifier ,
9- TextEdit , WorkspaceEdit ,
5+ CodeAction , CodeActionOrCommand , CodeActionResponse , CodeLens , Command , Diagnostic ,
6+ DiagnosticSeverity , DocumentFormattingParams , DocumentHighlight , DocumentSymbol , FoldingRange ,
7+ FoldingRangeKind , FoldingRangeParams , Hover , HoverContents , Location , MarkupContent ,
8+ MarkupKind , Position , PrepareRenameResponse , Range , RenameParams , SymbolInformation ,
9+ TextDocumentIdentifier , TextEdit , WorkspaceEdit ,
1010} ;
1111use ra_ide_api:: {
1212 AssistId , Cancelable , FileId , FilePosition , FileRange , FoldKind , Query , RangeInfo ,
@@ -665,7 +665,7 @@ pub fn handle_code_action(
665665
666666 let assists = world. analysis ( ) . assists ( FileRange { file_id, range } ) ?. into_iter ( ) ;
667667 let diagnostics = world. analysis ( ) . diagnostics ( file_id) ?;
668- let mut res: Vec < CodeAction > = Vec :: new ( ) ;
668+ let mut res = CodeActionResponse :: default ( ) ;
669669
670670 let fixes_from_diagnostics = diagnostics
671671 . into_iter ( )
@@ -689,7 +689,7 @@ pub fn handle_code_action(
689689 edit : None ,
690690 command : Some ( command) ,
691691 } ;
692- res. push ( action) ;
692+ res. push ( CodeActionOrCommand :: CodeAction ( action) ) ;
693693 }
694694
695695 for assist in assists {
@@ -711,10 +711,10 @@ pub fn handle_code_action(
711711 edit : None ,
712712 command : Some ( command) ,
713713 } ;
714- res. push ( action) ;
714+ res. push ( CodeActionOrCommand :: CodeAction ( action) ) ;
715715 }
716716
717- Ok ( Some ( CodeActionResponse :: Actions ( res) ) )
717+ Ok ( Some ( res) )
718718}
719719
720720pub fn handle_code_lens (
0 commit comments