1414 // The optional 'workspaceFolder' property is the path VS Code should open by default when
1515 // connected. This is typically a file mount in .devcontainer/docker-compose.yml
1616 "workspaceFolder" : " /app" ,
17- // Set *default* container specific settings.json values on container create.
18- "settings" : {
19- "terminal.integrated.shell.linux" : null ,
20- // https://github.com/golang/tools/blob/master/gopls/doc/vscode.md#vscode
21- "go.useLanguageServer" : true ,
22- "[go]" : {
23- "editor.formatOnSave" : true ,
24- "editor.codeActionsOnSave" : {
25- "source.organizeImports" : true ,
17+ // All containers should stop if we close / reload the VSCode window.
18+ "shutdownAction" : " stopCompose" ,
19+ "customizations" : {
20+ "vscode" : {
21+ // Set *default* container specific settings.json values on container create.
22+ "settings" : {
23+ // https://github.com/golang/tools/blob/master/gopls/doc/vscode.md#vscode
24+ "go.useLanguageServer" : true ,
25+ "[go]" : {
26+ "editor.formatOnSave" : true ,
27+ "editor.codeActionsOnSave" : {
28+ "source.organizeImports" : true ,
29+ },
30+ // Optional: Disable snippets, as they conflict with completion ranking.
31+ "editor.snippetSuggestions" : " none" ,
32+ },
33+ "[go.mod]" : {
34+ "editor.formatOnSave" : true ,
35+ "editor.codeActionsOnSave" : {
36+ "source.organizeImports" : true ,
37+ },
38+ },
39+ "[sql]" : {
40+ "editor.formatOnSave" : true
41+ },
42+ "gopls" : {
43+ // Add parameter placeholders when completing a function.
44+ "usePlaceholders" : true ,
45+ // If true, enable additional analyses with staticcheck.
46+ // Warning: This will significantly increase memory usage.
47+ // DISABLED, done via
48+ "staticcheck" : false ,
49+ },
50+ // https://code.visualstudio.com/docs/languages/go#_intellisense
51+ "go.autocompleteUnimportedPackages" : true ,
52+ // https://github.com/golangci/golangci-lint#editor-integration
53+ "go.lintTool" : " golangci-lint" ,
54+ "go.lintFlags" : [
55+ " --fast" ,
56+ " --timeout" ,
57+ " 5m"
58+ ],
59+ // disable test caching, race and show coverage (in sync with makefile)
60+ "go.testFlags" : [
61+ " -cover" ,
62+ " -race" ,
63+ " -count=1" ,
64+ " -v"
65+ ],
66+ "go.coverMode" : " atomic" , // atomic is required when utilizing -race
67+ "go.delveConfig" : {
68+ "dlvLoadConfig" : {
69+ // increase max length of strings displayed in debugger
70+ "maxStringLen" : 2048 ,
71+ },
72+ "apiVersion" : 2 ,
73+ },
74+ // ensure that the pgFormatter VSCode extension uses the pgFormatter that comes preinstalled in the Dockerfile
75+ "pgFormatter.pgFormatterPath" : " /usr/local/bin/pg_format"
2676 },
27- // Optional: Disable snippets, as they conflict with completion ranking.
28- "editor.snippetSuggestions" : " none" ,
29- },
30- "[go.mod]" : {
31- "editor.formatOnSave" : true ,
32- "editor.codeActionsOnSave" : {
33- "source.organizeImports" : true ,
34- },
35- },
36- "[sql]" : {
37- "editor.formatOnSave" : true
38- },
39- "gopls" : {
40- // Add parameter placeholders when completing a function.
41- "usePlaceholders" : true ,
42- // If true, enable additional analyses with staticcheck.
43- // Warning: This will significantly increase memory usage.
44- // DISABLED, done via
45- "staticcheck" : false ,
46- },
47- // https://code.visualstudio.com/docs/languages/go#_intellisense
48- "go.autocompleteUnimportedPackages" : true ,
49- // https://github.com/golangci/golangci-lint#editor-integration
50- "go.lintTool" : " golangci-lint" ,
51- "go.lintFlags" : [
52- " --fast"
53- ],
54- // disable test caching, race and show coverage (in sync with makefile)
55- "go.testFlags" : [
56- " -cover" ,
57- " -race" ,
58- " -count=1" ,
59- " -v"
60- ],
61- // "go.lintOnSave": "workspace"
62- // general build settings in sync with our makefile
63- // "go.buildFlags": [
64- // "-o",
65- // "bin/app"
66- // ]
67- // "sqltools.connections": [
68- // {
69- // "database": "sample",
70- // "dialect": "PostgreSQL",
71- // "name": "postgres",
72- // "password": "9bed16f749d74a3c8bfbced18a7647f5",
73- // "port": 5432,
74- // "server": "postgres",
75- // "username": "dbuser"
76- // }
77- // ],
78- // "sqltools.autoConnectTo": [
79- // "postgres"
80- // ],
81- // // only use pg_format to actually format!
82- // "sqltools.formatLanguages": [],
83- // "sqltools.telemetry": false,
84- // "sqltools.autoOpenSessionFiles": false
77+ // Add the IDs of extensions you want installed when the container is created.
78+ "extensions" : [
79+ // required:
80+ " golang.go" ,
81+ " bradymholt.pgformatter" ,
82+ // optional:
83+ " 42crunch.vscode-openapi" ,
84+ " heaths.vscode-guid" ,
85+ " bungcip.better-toml" ,
86+ " eamodio.gitlens" ,
87+ " casualjim.gotemplate" ,
88+ " yzhang.markdown-all-in-one"
89+ ]
90+ }
8591 },
86- // Add the IDs of extensions you want installed when the container is created.
87- "extensions" : [
88- // required:
89- " ms-vscode.go" ,
90- " bradymholt.pgformatter" ,
91- // optional:
92- // "766b.go-outliner",
93- " heaths.vscode-guid" ,
94- " bungcip.better-toml" ,
95- " eamodio.gitlens" ,
96- " casualjim.gotemplate"
97- // "mtxr.sqltools",
98- ]
9992 // Uncomment the next line if you want start specific services in your Docker Compose config.
10093 // "runServices": [],
10194 // Uncomment the next line if you want to keep your containers running after VS Code shuts down.
10295 // "shutdownAction": "none",
10396 // Uncomment the next line to run commands after the container is created - for example installing git.
97+ "postCreateCommand" : " go version" ,
10498 // "postCreateCommand": "apt-get update && apt-get install -y git",
10599 // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
106- // "remoteUser": "vscode "
100+ // "remoteUser": ""
107101}
0 commit comments