zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
47.94k stars 2.83k forks source link

Disable Zed autocomplete suggestions in comments #14372

Open soham-suki opened 2 months ago

soham-suki commented 2 months ago

Check for existing issues

Describe the feature

When writing comments, I often use periods to end sentences (and hit enter to go to the next line) However, Zed suggests completions when I hit periods in comments. Then when I hit enter, it thinks I wanted to use its suggestions, so it adds that after the period. To prevent this, I have to constantly hit Esc to dismiss suggestions.

Is there a way to disable suggestions inside of comments?

If applicable, add mockups / screenshots to help present your vision of the feature

image As you can see above, typing . in the comment triggered the hover popup with logAndSendError as a suggestion. However, this was an unnecessary suggestion - . should only trigger suggestion when I'm writing code, not comments. Besides, why was logAndSendError suggested for out.?

soham-suki commented 2 months ago

Bump!

soham-suki commented 2 months ago

Why was the ai label added to this? I'm unsure if this concerns the ai part of Zed at all.

notpeter commented 2 months ago

Why was the ai label added to this? I'm unsure if this concerns the ai part of Zed at all.

It was assumed the completion was an assistant suggestion (copilot) not a language suggestion (language server). I appreciate the clarification.

mbylstra commented 2 days ago

I also find the completion very distracting in the AI composer chat window. I think there should be an option to be able to enable AI auto completion only in code (not in comments, nor any other scenario that isn't source code)

notpeter commented 9 hours ago

@mbylstra Zed should likely support a way to disable inline suggestions (Copilot/SuperMaven) when using the Assistant Panel, but there is not currently a setting for this.

A workaround (that I use) is to add the following to your settings:

  "languages":
    "Markdown": {
      "show_inline_completions": false
    }
  }

This will disable inline completions when editing Markdown files and when using the Assistant Panel (which is a Language==Markdown buffer under the hood).

This is separate from @soham-suki's initial request to be able to disable inline completions (copilot) and code completions (lsp) inside comments via a setting, but I figured folks who end up here might appreciate this workaround.