Skip to content

Commit ba97b4a

Browse files
committed
refactor: adjust context scoring values
Modify scoring mechanism for buffer and file content contexts to better reflect their priority in the system. Remove redundant comment about score bonus. Changes: - Keep file content score at 0.2 - Set explicit buffer content score to 0.1
1 parent b842f85 commit ba97b4a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lua/CopilotChat/context.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ function M.files(winnr, with_content)
401401
content = table.concat(chunk, '\n'),
402402
filename = chunk_name,
403403
filetype = 'text',
404-
score = 0.2, -- Score bonus
404+
score = 0.2,
405405
})
406406
end
407407

@@ -464,11 +464,14 @@ function M.buffer(bufnr)
464464
return nil
465465
end
466466

467-
return build_outline(
467+
local out = build_outline(
468468
table.concat(content, '\n'),
469469
utils.filepath(vim.api.nvim_buf_get_name(bufnr)),
470470
vim.bo[bufnr].filetype
471471
)
472+
473+
out.score = 0.1
474+
return out
472475
end
473476

474477
--- Get content of all buffers

0 commit comments

Comments
 (0)