Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lua/CopilotChat/config/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,12 @@ return {

diagnostics = {
group = 'copilot',
uri = 'neovim://diagnostics/{scope}',
uri = 'neovim://diagnostics/{scope}/{severity}',
description = 'Collects code diagnostics (errors, warnings, etc.) from specified buffers. Helpful for troubleshooting and fixing code issues.',

schema = {
type = 'object',
required = { 'scope' },
required = { 'scope', 'severity' },
properties = {
scope = {
type = 'string',
Expand Down
7 changes: 1 addition & 6 deletions lua/CopilotChat/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,14 @@ function M.parse_input(input, schema)
local prop_names = sorted_propnames(schema)

-- Map input parts to schema properties in sorted order
local i = 1
for _, prop_name in ipairs(prop_names) do
for i, prop_name in ipairs(prop_names) do
local prop_schema = schema.properties[prop_name]
local value = not utils.empty(parts[i]) and parts[i] or nil
if value == nil and prop_schema.default ~= nil then
value = prop_schema.default
end

result[prop_name] = value
i = i + 1
if i > #parts then
break
end
end

return result
Expand Down
Loading