# Support OnTypeFormatting LSP request \(\#2517\) · gitcafe/zed

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

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

Visibility: public

Requested revision: ae3bdd755e1ae714a17fcef49bc5482ca33db034

Requested commit: ae3bdd755e1ae714a17fcef49bc5482ca33db034

Commit: ae3bdd755e1ae714a17fcef49bc5482ca33db034

Tree: 48f94157f8ee08d7e33467cc1af65316b9de523b

Author: Kirill Bulatov

Committer: GitHub

## Message

```
Support OnTypeFormatting LSP request (#2517)

Supports
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_onTypeFormatting

rust-analyzer uses this feature to add matching brackets semantically,
e.g.
before:
![Screenshot 2023-05-23 at 17 46
42](https://github.com/zed-industries/zed/assets/2690773/020e8448-23e6-4a38-8dbb-c9edf18062f7)

after:
![Screenshot 2023-05-23 at 17 46
49](https://github.com/zed-industries/zed/assets/2690773/4d140af3-aca6-451d-ac61-e2a9bb31caea)

`use_on_type_format` settings entry was added, enabled by default, to
disable the new feature.

Release Notes:

* Support `OnTypeFormatting` LSP protocol feature, allowing
rust-analyzer to add matching brackets
```

## Parents

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

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

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