You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default extension [supports syntax highlighting](https://github.com/golang/vscode-go/wiki/features#go-template-syntax-highlighting), but requires a configuration change. You must add this section to your golang extension settings:
10
+
11
+
```json
12
+
"gopls": {
13
+
"ui.semanticTokens": true
14
+
},
15
+
```
16
+
17
+
Unfortunately, the VSCode extension does not support both go template and postgres highlighting. You can switch between the two with:
18
+
19
+
1.`ctl + shift + p`
20
+
1. "Change language Mode"
21
+
1. "Postgres" or "Go Template File"
22
+
- Feel free to create a permanent file association with `*.gosql` files.
23
+
24
+
25
+
## Goland
26
+
27
+
Goland supports [template highlighting](https://www.jetbrains.com/help/go/integration-with-go-templates.html) out of the box. To associate sql files, add a new file type in **Editor** settings. Select "Go template files". Add a new filename of `*.gosql` and select "postgres" as the "Template Data Language".
28
+
29
+
30
+

31
+
32
+
It also helps to support the sqlc type variables. You can do this by adding ["User Parameters"](https://www.jetbrains.com/help/datagrip/settings-tools-database-user-parameters.html) in database queries.
33
+
34
+

35
+
36
+
You can also add `dump.sql` as a DDL data source for proper table column recognition.
0 commit comments