File tree Expand file tree Collapse file tree 4 files changed +28
-8
lines changed
Expand file tree Collapse file tree 4 files changed +28
-8
lines changed Original file line number Diff line number Diff line change @@ -219,10 +219,21 @@ function mod.unregister_status_notification_handler(handler)
219219 status .callback [handler ] = nil
220220end
221221
222+ --- @alias copilot_open_url_data { target : string }
223+
222224mod .handlers = {
223225 PanelSolution = panel .handlers .PanelSolution ,
224226 PanelSolutionsDone = panel .handlers .PanelSolutionsDone ,
225227 statusNotification = status .handlers .statusNotification ,
228+ --- @param result copilot_open_url_data
229+ [" copilot/openURL" ] = function (_ , result )
230+ vim .api .nvim_echo ({
231+ { " copilot/openURL" },
232+ { vim .inspect ({ _ , result }) },
233+ { " \n " , " NONE" },
234+ }, true , {})
235+ error (" not implemented: copilot.api.handlers['copilot/openURL']" )
236+ end ,
226237}
227238mod .panel = panel
228239mod .status = status
Original file line number Diff line number Diff line change @@ -174,13 +174,26 @@ local function prepare_client_config(overrides)
174174
175175 M .startup_error = nil
176176
177+ local capabilities = vim .lsp .protocol .make_client_capabilities ()
178+ capabilities .copilot = {
179+ openURL = true ,
180+ }
181+
182+ local handlers = {
183+ PanelSolution = api .handlers .PanelSolution ,
184+ PanelSolutionsDone = api .handlers .PanelSolutionsDone ,
185+ statusNotification = api .handlers .statusNotification ,
186+ [" copilot/openURL" ] = api .handlers [" copilot/openURL" ],
187+ }
188+
177189 return vim .tbl_deep_extend (" force" , {
178190 cmd = {
179191 node ,
180192 agent_path ,
181193 },
182194 root_dir = vim .loop .cwd (),
183195 name = " copilot" ,
196+ capabilities = capabilities ,
184197 get_language_id = function (_ , filetype )
185198 return util .language_for_file_type (filetype )
186199 end ,
@@ -215,11 +228,7 @@ local function prepare_client_config(overrides)
215228 end )
216229 end
217230 end ,
218- handlers = {
219- PanelSolution = api .handlers .PanelSolution ,
220- PanelSolutionsDone = api .handlers .PanelSolutionsDone ,
221- statusNotification = api .handlers .statusNotification ,
222- },
231+ handlers = handlers ,
223232 }, overrides )
224233end
225234
Original file line number Diff line number Diff line change @@ -403,12 +403,12 @@ local function advance(count, ctx)
403403end
404404
405405local function schedule ()
406- clear ()
407-
408406 if not is_enabled () then
407+ clear ()
409408 return
410409 end
411410
411+ update_preview ()
412412 local bufnr = vim .api .nvim_get_current_buf ()
413413 copilot ._copilot_timer = vim .fn .timer_start (copilot .debounce , function (timer )
414414 trigger (bufnr , timer )
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ function M.get_editor_info()
2020 editorPluginInfo = {
2121 name = " copilot.lua" ,
2222 -- reflects version of github/copilot.vim
23- version = " 1.12.1 " ,
23+ version = " 1.13.0 " ,
2424 },
2525 }
2626 return info
You can’t perform that action at this time.
0 commit comments