Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't call completion providers inside of comments #831

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

anderseknert
Copy link
Member

It seems like this is handled client side by some editors, but Zed triggered completion requests inside of comments. While we could have each provider handle this, I think an early exit in the manager already is a better solution, as there's unlikely to be any provider that wants to do suggestions in a comment. If that changes in the future, we'll handle it then.

Fixes #826

It seems like this is handled client side by some editors, but Zed
triggered completion requests inside of comments. While we could have
each provider handle this, I think an early exit in the manager already
is a better solution, as there's unlikely to be any provider that wants
to do suggestions in a comment. If that changes in the future, we'll
handle it then.

Fixes #826

Signed-off-by: Anders Eknert <[email protected]>

if cp.Line == params.Position.Line {
if cp.Character <= params.Position.Character {
return true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice!

@anderseknert anderseknert merged commit 53dbce6 into main Jun 13, 2024
3 checks passed
@anderseknert anderseknert deleted the zed-comment-completion branch June 13, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Code completion in comments (Zed)
2 participants