@@ -74,6 +74,7 @@ let g:lsp_work_done_progress_enabled = get(g:, 'lsp_work_done_progress_enabled',
74
74
let g: lsp_untitled_buffer_enabled = get (g: , ' lsp_untitled_buffer_enabled' , 1 )
75
75
let g: lsp_inlay_hints_enabled = get (g: , ' lsp_inlay_hints_enabled' , 0 )
76
76
let g: lsp_inlay_hints_delay = get (g: , ' lsp_inlay_hints_delay' , 350 )
77
+ let g: lsp_code_action_ui = get (g: , ' lsp_code_action_ui' , ' preview' )
77
78
78
79
let g: lsp_get_supported_capabilities = get (g: , ' lsp_get_supported_capabilities' , [function (' lsp#default_get_supported_capabilities' )])
79
80
@@ -89,16 +90,14 @@ endif
89
90
command ! LspAddTreeCallHierarchyIncoming call lsp#ui#vim#add_tree_call_hierarchy_incoming ()
90
91
command ! LspCallHierarchyIncoming call lsp#ui#vim#call_hierarchy_incoming ({})
91
92
command ! LspCallHierarchyOutgoing call lsp#ui#vim#call_hierarchy_outgoing ()
92
- command ! - range -nargs =* -complete =customlist ,lsp #ui#vim #code_action#complete LspCodeAction call lsp#ui#vim#code_action#do ({
93
- \ ' sync' : v: false ,
94
- \ ' selection' : <range> != 0 ,
95
- \ ' query' : ' <args>'
96
- \ })
97
- command ! - range -nargs =* -complete =customlist ,lsp #ui#vim #code_action#complete LspCodeActionSync call lsp#ui#vim#code_action#do ({
98
- \ ' sync' : v: true ,
99
- \ ' selection' : <range> != 0 ,
100
- \ ' query' : ' <args>'
101
- \ })
93
+ command ! - range -nargs =* -complete =customlist ,lsp #ui#vim #code_action#complete LspCodeAction call lsp#ui#vim#code_action#do (
94
+ \ extend ({ ' sync' : v: false , ' selection' : <range> != 0 }, lsp#utils#args#_parse (<q-args> , {
95
+ \ ' ui' : { ' type' : type (' ' ) },
96
+ \ }, ' query' )))
97
+ command ! - range -nargs =* -complete =customlist ,lsp #ui#vim #code_action#complete LspCodeActionSync call lsp#ui#vim#code_action#do (
98
+ \ extend ({ ' sync' : v: true , ' selection' : <range> != 0 }, lsp#utils#args#_parse (<q-args> , {
99
+ \ ' ui' : { ' type' : type (' ' ) },
100
+ \ }, ' query' )))
102
101
command ! LspCodeLens call lsp#ui#vim#code_lens#do ({})
103
102
command ! LspDeclaration call lsp#ui#vim#declaration (0 , <q-mods> )
104
103
command ! LspPeekDeclaration call lsp#ui#vim#declaration (1 )
@@ -109,11 +108,11 @@ command! LspDocumentSymbolSearch call lsp#internal#document_symbol#search#do({})
109
108
command ! -nargs =? LspDocumentDiagnostics call lsp#internal#diagnostics#document_diagnostics_command#do (
110
109
\ extend ({}, lsp#utils#args#_parse (<q-args> , {
111
110
\ ' buffers' : {' type' : type (' ' )},
112
- \ })))
111
+ \ }, v: null )))
113
112
command ! -nargs =? -complete =customlist ,lsp #utils#empty_complete LspHover call lsp#internal#document_hover#under_cursor#do (
114
113
\ extend ({}, lsp#utils#args#_parse (<q-args> , {
115
114
\ ' ui' : { ' type' : type (' ' ) },
116
- \ })))
115
+ \ }, v: null )))
117
116
command ! -nargs =* LspNextError call lsp#internal#diagnostics#movement#_next_error (<f-args> )
118
117
command ! -nargs =* LspPreviousError call lsp#internal#diagnostics#movement#_previous_error (<f-args> )
119
118
command ! -nargs =* LspNextWarning call lsp#internal#diagnostics#movement#_next_warning (<f-args> )
@@ -132,13 +131,13 @@ command! -range -nargs=? LspDocumentFormatSync call lsp#internal#document_format
132
131
\ extend ({' bufnr' : bufnr (' %' ), ' sync' : 1 }, lsp#utils#args#_parse (<q-args> , {
133
132
\ ' timeout' : {' type' : type (0 )},
134
133
\ ' sleep' : {' type' : type (0 )},
135
- \ })))
134
+ \ }, v: null )))
136
135
command ! - range LspDocumentRangeFormat call lsp#internal#document_range_formatting#format ({ ' bufnr' : bufnr (' %' ) })
137
136
command ! - range -nargs =? LspDocumentRangeFormatSync call lsp#internal#document_range_formatting#format (
138
137
\ extend ({' bufnr' : bufnr (' %' ), ' sync' : 1 }, lsp#utils#args#_parse (<q-args> , {
139
138
\ ' timeout' : {' type' : type (0 )},
140
139
\ ' sleep' : {' type' : type (0 )},
141
- \ })))
140
+ \ }, v: null )))
142
141
command ! LspImplementation call lsp#ui#vim#implementation (0 , <q-mods> )
143
142
command ! LspPeekImplementation call lsp#ui#vim#implementation (1 )
144
143
command ! -nargs =0 LspStatus call lsp#print_server_status ()
@@ -153,7 +152,9 @@ command! -nargs=0 LspSemanticTokenModifiers echo lsp#internal#semantic#get_token
153
152
154
153
nnoremap <silent> <plug> (lsp-call-hierarchy-incoming) :<c-u> call lsp#ui#vim#call_hierarchy_incoming({})<cr>
155
154
nnoremap <silent> <plug> (lsp-call-hierarchy-outgoing) :<c-u> call lsp#ui#vim#call_hierarchy_outgoing()<cr>
156
- nnoremap <silent> <plug> (lsp-code-action) :<c-u> call lsp#ui#vim#code_action()<cr>
155
+ nnoremap <silent> <plug> (lsp-code-action) :<c-u> call lsp#ui#vim#code_action({})<cr>
156
+ nnoremap <silent> <plug> (lsp-code-action-float) :<c-u> call lsp#ui#vim#code_action({ 'ui': 'float' })<cr>
157
+ nnoremap <silent> <plug> (lsp-code-action-preview) :<c-u> call lsp#ui#vim#code_action({ 'ui': 'preview' })<cr>
157
158
nnoremap <silent> <plug> (lsp-code-lens) :<c-u> call lsp#ui#vim#code_lens()<cr>
158
159
nnoremap <silent> <plug> (lsp-declaration) :<c-u> call lsp#ui#vim#declaration(0)<cr>
159
160
nnoremap <silent> <plug> (lsp-peek-declaration) :<c-u> call lsp#ui#vim#declaration(1)<cr>
0 commit comments