Skip to content

feat(functions): add scope=selection to diagnostics#1351

Merged
deathbeam merged 6 commits intoCopilotC-Nvim:mainfrom
ruicsh:1350-diagnostics-selection-scope
Aug 25, 2025
Merged

feat(functions): add scope=selection to diagnostics#1351
deathbeam merged 6 commits intoCopilotC-Nvim:mainfrom
ruicsh:1350-diagnostics-selection-scope

Conversation

@ruicsh
Copy link
Copy Markdown
Contributor

@ruicsh ruicsh commented Aug 23, 2025

Adds a new scope to the diagnostics function where the user specifies that only diagnostics found inside the visual selection are to be included in the prompt's context.

This implements #1350

Adds a new scope to the diagnostics function where the user specifies that only diagnostics found inside the visual selection are to be included in the prompt's context.
@deathbeam deathbeam added the enhancement New feature or request label Aug 23, 2025
@deathbeam
Copy link
Copy Markdown
Collaborator

This should probably wait for #1340 as there will be only single api for selection with it (as currently the selection module has 4 apis and this is hardcoding the visual one here)

@deathbeam
Copy link
Copy Markdown
Collaborator

Ok #1340 was merged so now the selection is just select.get(source.bufnr)

@ruicsh
Copy link
Copy Markdown
Contributor Author

ruicsh commented Aug 25, 2025

Ok #1340 was merged so now the selection is just select.get(source.bufnr)

@deathbeam cheers, I updated the selection call

Comment thread lua/CopilotChat/config/functions.lua Outdated
Comment thread lua/CopilotChat/config/functions.lua Outdated
Comment thread lua/CopilotChat/config/functions.lua
- no need for scope conditional bc we're using the whole buffer as default selection
- pass buffer id when using selection.get
- return early if mode is selection but there's nothing selected
@ruicsh ruicsh requested a review from deathbeam August 25, 2025 21:31
Comment thread lua/CopilotChat/config/functions.lua Outdated
@ruicsh ruicsh requested a review from deathbeam August 25, 2025 23:15
@deathbeam deathbeam merged commit 7b4a56b into CopilotC-Nvim:main Aug 25, 2025
4 checks passed
@deathbeam
Copy link
Copy Markdown
Collaborator

awesome, thanks!

@all-contributors add @ruicsh for code

@allcontributors
Copy link
Copy Markdown
Contributor

@deathbeam

I've put up a pull request to add @ruicsh! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants