Add setting to disable inline completions in language scopes (#20508)

This adds a setting to disable inline completions in language scopes to,
for example, disable them in comments or strings.

This setting can be made per language.

Examples:

```json
{
  "languages": {
    "Go": {
      "inline_completions_disabled_in": ["comment", "string"]
    }
  }
}
```

```json
{
  "inline_completions_disabled_in": ["comment"]
}
```

Closes #9133

Release Notes:

- Added language setting to disable inline comments in certain scopes.
Example: `{"languages": {"Go": {"inline_completions_disabled_in":
["comment", "string"]}}}`

Co-authored-by: Bennet <bennet@zed.dev>
This commit is contained in:
Thorsten Ball 2024-11-11 18:09:05 +01:00 committed by GitHub
parent 9e7afe870a
commit ba743a1bd9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 77 additions and 0 deletions

View file

@ -359,6 +359,40 @@ There are two options to choose from:
List of `string` values
## Inline Completions Disabled in
- Description: A list of language scopes in which inline completions should be disabled.
- Setting: `inline_completions_disabled_in`
- Default: `[]`
**Options**
List of `string` values
1. Don't show inline completions in comments:
```json
"disabled_in": ["comment"]
```
2. Don't show inline completions in strings and comments:
```json
"disabled_in": ["comment", "string"]
```
3. Only in Go, don't show inline completions in strings and comments:
```json
{
"languages": {
"Go": {
"inline_completions_disabled_in": ["comment", "string"]
}
}
}
```
## Current Line Highlight
- Description: How to highlight the current line in the editor.