@@ -2,7 +2,7 @@ use serde_json::Value;
22use tower_lsp:: jsonrpc:: { Error , ErrorCode , Result } ;
33use tower_lsp:: lsp_types:: {
44 CodeActionOrCommand , CodeActionParams , CodeActionProviderCapability , CodeActionResponse ,
5- CodeLens , CodeLensOptions , CodeLensParams , Command , DidChangeConfigurationParams ,
5+ CodeLens , CodeLensOptions , CodeLensParams , DidChangeConfigurationParams ,
66 DidChangeTextDocumentParams , DidOpenTextDocumentParams , ExecuteCommandOptions ,
77 ExecuteCommandParams , InitializeParams , InitializeResult , InitializedParams , MessageType ,
88 ServerCapabilities , TextDocumentSyncCapability , TextDocumentSyncKind ,
@@ -150,13 +150,7 @@ where
150150 let code_actions: Vec < CodeActionOrCommand > = commands
151151 . into_iter ( )
152152 . filter ( |cmd| cmd. range . start . line == params. range . start . line )
153- . map ( |cmd| {
154- CodeActionOrCommand :: Command ( Command {
155- title : cmd. title ,
156- command : cmd. command ,
157- arguments : cmd. arguments ,
158- } )
159- } )
153+ . map ( |cmd| CodeActionOrCommand :: Command ( cmd. into ( ) ) )
160154 . collect ( ) ;
161155
162156 Ok ( Some ( code_actions) )
@@ -166,18 +160,7 @@ where
166160 let commands = self
167161 . get_commands_for_document ( & params. text_document . uri )
168162 . await ?;
169- let code_lenses = commands
170- . into_iter ( )
171- . map ( |cmd| CodeLens {
172- range : cmd. range ,
173- command : Some ( Command {
174- title : cmd. title ,
175- command : cmd. command ,
176- arguments : cmd. arguments ,
177- } ) ,
178- data : None ,
179- } )
180- . collect ( ) ;
163+ let code_lenses = commands. into_iter ( ) . map ( |cmd| cmd. into ( ) ) . collect ( ) ;
181164
182165 Ok ( Some ( code_lenses) )
183166 }
0 commit comments