File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,19 @@ local defaults = {
1515}
1616
1717local create_cmds = function (_ )
18+ vim .api .nvim_create_user_command (" CopilotDetach" , function ()
19+ local client_instance = require (" copilot.util" ).get_copilot_client ()
20+ local valid = client_instance and vim .lsp .buf_is_attached (0 , client_instance .id )
21+ if not valid then return end
22+ vim .lsp .buf_detach_client (0 , client_instance .id )
23+ end , {})
24+
25+ vim .api .nvim_create_user_command (" CopilotStop" , function ()
26+ local client_instance = require (" copilot.util" ).get_copilot_client ()
27+ if not client_instance then return end
28+ vim .lsp .stop_client (client_instance .id )
29+ end , {})
30+
1831 vim .api .nvim_create_user_command (" CopilotPanel" , function ()
1932 local panel = require (" copilot.extensions.panel" ).create ()
2033 panel .send_request ()
You can’t perform that action at this time.
0 commit comments