Skip to content

Commit 0ee5df0

Browse files
committed
feat: update ':Copilot status'
1 parent ee0e551 commit 0ee5df0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lua/copilot/api.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function mod.notify_change_configuration(client, params)
4646
end
4747

4848
---@alias copilot_check_status_params { options?: { localChecksOnly?: boolean } }
49-
---@alias copilot_check_status_data { user?: string }
49+
---@alias copilot_check_status_data { user?: string, status: 'OK'|'NotAuthorized'|'NoTelemetryConsent' }
5050

5151
---@param params? copilot_check_status_params
5252
---@return any|nil err

lua/copilot/command.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ function mod.status()
6666
if not status.user then
6767
flush_lines("Not authenticated. Run ':Copilot auth'")
6868
return
69+
elseif status.status == 'NoTelemetryConsent' then
70+
flush_lines("Telemetry terms not accepted")
71+
return
72+
elseif status.status == 'NotAuthorized' then
73+
flush_lines("Not authorized")
74+
return
6975
end
7076

7177
local should_attach, no_attach_reason = u.should_attach(c.params.filetypes)

0 commit comments

Comments
 (0)