# go: enable completions with placeholders by default \(\#7780\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/b47aff4c144f6c96a2e4328447fdf050856c6b85)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: b47aff4c144f6c96a2e4328447fdf050856c6b85

Requested commit: b47aff4c144f6c96a2e4328447fdf050856c6b85

Commit: b47aff4c144f6c96a2e4328447fdf050856c6b85

Tree: f8a12c2241307f55cc0a4b7543b61c0db890b050

Author: Thorsten Ball

Committer: GitHub

## Message

```
go: enable completions with placeholders by default (#7780)

This fixes #7523 by enabling completions with placeholders by default.

This setting controls whether gopls sends back snippets with
placeholders. According to the documentation
(https://github.com/golang/tools/blob/master/gopls/doc/settings.md#useplaceholders-bool)
this only controls whether "placeholders for function parameters or
struct fields" are sent in completion responses.

In practice, though, this seems to also control whether any snippets
with *any* placeholders are being sent back.

Example: for the given Go code

    err := myFunction()
    i^

With the cursor being at `^`, this setting controls whether `gopls`
sends back statement snippets such as `if err != nil { return ... }`
with the `...` being dynamically matched to the return value of the
function.

So I think this setting controls far more than just function params and
struct fields. And since we *do* support placeholders in snippets, I
think this provides a better default experience.

Release Notes:

- Improved default Go experience by enabling snippets-with-placeholders
when initializing `gopls`.
([#7523](https://github.com/zed-industries/zed/issues/7523)).
```

## Parents

- [7ac055627eb602804092904103b42f63530b5d39](https://git.cafe/gitcafe/zed/commit/7ac055627eb602804092904103b42f63530b5d39?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/b47aff4c144f6c96a2e4328447fdf050856c6b85?format=markdown)
