# Add language server for Terraform \(\#7657\) · gitcafe/zed

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

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

Visibility: public

Requested revision: bbc4ed9cab27489373148bef589cedfab8b910fd

Requested commit: bbc4ed9cab27489373148bef589cedfab8b910fd

Commit: bbc4ed9cab27489373148bef589cedfab8b910fd

Tree: b556a30e7a8b52d41a2a52f58320e8a10815177b

Author: Daniel Banck

Committer: GitHub

## Message

```
Add language server for Terraform (#7657)

* Depends on: https://github.com/zed-industries/zed/pull/7449
* Closes: https://github.com/zed-industries/zed/issues/5098

---

This PR adds support for downloading and running the Terraform language
server for `*.tf` and `*.tfvars` files. I've verified that the code
works for `aarch64` and `x86_64` macOS. Downloading new language server
versions on release also works as expected.

Furthermore this PR adds:
- A short docs page for Terraform
- An icon for `*.tf` and `*.tfvars` files

## UX

### File Icons

![CleanShot 2024-02-10 at 23 10
13@2x](https://github.com/zed-industries/zed/assets/45985/6f7cd4f0-e94c-4cfb-b3e9-64b0e33c8a43)

### Completion

![CleanShot 2024-02-13 at 20 54
15@2x](https://github.com/zed-industries/zed/assets/45985/18fafa3b-cb50-4f51-b071-ca9eee3521a6)

### Hover

![CleanShot 2024-02-13 at 20 53
40@2x](https://github.com/zed-industries/zed/assets/45985/4d215315-e019-4d3d-b23c-2691db1803e3)

### Go to definition

![2024-02-13 20 56
28](https://github.com/zed-industries/zed/assets/45985/c21d562f-eb0b-4df9-9175-c53b9923344e)

### Formatting

![2024-02-13 20 59
06](https://github.com/zed-industries/zed/assets/45985/0cdf4ec5-e231-4c8a-a257-cae30a8edc8b)

and more!

## Known issue(s)

@fdionisi discovered that sometimes completion results are inserted with
the wrong indentation. Or rather, if you look closely, they are inserted
with the correct indentation and then something shifts the closing `}`.
I don't think this is related to LSP support and can be addressed in a
separate PR.

![2024-02-13 20 58
16](https://github.com/zed-industries/zed/assets/45985/94a118dd-95f5-4e38-8f83-75fec7a0dddf)

Release Notes:

- Add language server support for Terraform
([#5098](https://github.com/zed-industries/zed/issues/5098)).

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
```

## Parents

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

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