1# Go
2
3Go support is available natively in Zed.
4
5- Tree Sitter: [tree-sitter-go](https://github.com/tree-sitter/tree-sitter-go)
6- Language Server: [gopls](https://github.com/golang/tools/tree/master/gopls)
7
8## Inlay Hints
9
10Zed sets the following initialization options for inlay hints:
11
12```json
13"hints": {
14 "assignVariableTypes": true,
15 "compositeLiteralFields": true,
16 "compositeLiteralTypes": true,
17 "constantValues": true,
18 "functionTypeParameters": true,
19 "parameterNames": true,
20 "rangeVariableTypes": true
21}
22```
23
24to make the language server send back inlay hints when Zed has them enabled in the settings.
25
26Use
27
28```json
29"lsp": {
30 "$LANGUAGE_SERVER_NAME": {
31 "initialization_options": {
32 "hints": {
33 ....
34 }
35 }
36 }
37}
38```
39
40to override these settings.
41
42See https://github.com/golang/tools/blob/master/gopls/doc/inlayHints.md for more information.
43
44# Go Mod
45
46- Tree Sitter: [tree-sitter-gomod](https://github.com/camdencheek/tree-sitter-go-mod)
47- Language Server: N/A
48
49# Go Sum
50
51TODO: https://github.com/zed-industries/zed/pull/7139
52
53# Go Work
54
55- Tree Sitter:
56 [tree-sitter-go-work](https://github.com/d1y/tree-sitter-go-work)
57- Language Server: N/A