Skip to content

Commit e599a76

Browse files
committed
fix: trace_lsp would not activate tracing in the LSP
1 parent 3061f28 commit e599a76

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lua/copilot/api.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ function mod.notify_change_configuration(client, params)
5353
return mod.notify(client, "notifyChangeConfiguration", params)
5454
end
5555

56+
---@alias copilot_nofify_set_trace_params { value: 'off'|'messages'|'verbose' }
57+
58+
---@param params copilot_nofify_set_trace_params
59+
function mod.notify_set_trace(client, params)
60+
return mod.notify(client, "$/setTrace", params)
61+
end
62+
5663
---@alias copilot_check_status_params { options?: { localChecksOnly?: boolean } }
5764
---@alias copilot_check_status_data { user?: string, status: 'OK'|'NotAuthorized'|'NoTelemetryConsent' }
5865

lua/copilot/client.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,12 @@ local function prepare_client_config(overrides)
309309
end
310310
end)
311311
logger.trace("setEditorInfo has been called")
312+
313+
local logger_conf = config.get("logger") --[[@as copilot_config_logging]]
314+
local trace_params = { value = logger_conf.trace_lsp } --[[@as copilot_nofify_set_trace_params]]
315+
logger.trace("data for setTrace LSP call", trace_params)
316+
api.notify_set_trace(client, trace_params)
317+
312318
M.initialized = true
313319
end)
314320
end,

0 commit comments

Comments
 (0)