Skip to content

Commit d643947

Browse files
committed
Refactor VSCode settings and tasks for improved Go development workflow
- Updated settings.json to enhance Go language configuration, including: - Added code actions on save for organizing imports in go.mod and go files. - Improved inlay hints and coverage decorator settings. - Configured gopls settings for better formatting and diagnostics. - Revised tasks.json to streamline task definitions and improve presentation: - Added detailed descriptions and labels for tasks. - Consolidated presentation settings for better user experience. - Introduced new tasks for pre-commit hooks and dependency management. - Enhanced existing tasks with clearer commands and problem matchers.
1 parent e5311f6 commit d643947

File tree

2 files changed

+539
-510
lines changed

2 files changed

+539
-510
lines changed

.vscode/settings.json

Lines changed: 48 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
// ============================================================
3-
// GO LANGUAGE CONFIGURATION
4-
// ============================================================
52
"[go.mod]": {
63
"editor.codeActionsOnSave": {
74
"source.organizeImports": "explicit"
@@ -12,154 +9,91 @@
129
"editor.codeActionsOnSave": {
1310
"source.organizeImports": "explicit"
1411
},
15-
"editor.formatOnSave": true,
16-
"editor.defaultFormatter": "golang.go"
12+
"editor.defaultFormatter": "golang.go",
13+
"editor.formatOnSave": true
1714
},
1815
"[go][go.mod]": {
1916
"editor.codeActionsOnSave": {
2017
"source.organizeImports": "explicit"
2118
}
2219
},
23-
24-
// ============================================================
25-
// OTHER LANGUAGE CONFIGURATIONS
26-
// ============================================================
2720
"[yaml]": {
2821
"editor.defaultFormatter": "redhat.vscode-yaml"
2922
},
3023
"files.associations": {
3124
"application.yaml": "yaml-cloudformation"
3225
},
33-
34-
// ============================================================
35-
// GO TOOLS & LANGUAGE SERVER
36-
// ============================================================
37-
"go.useLanguageServer": true,
38-
"go.toolsManagement.autoUpdate": true,
39-
40-
// ============================================================
41-
// INLAY HINTS
42-
// ============================================================
26+
"go.addTags": {
27+
"options": "json=omitempty",
28+
"promptForTags": false,
29+
"tags": "json",
30+
"transform": "snakecase"
31+
},
32+
"go.coverOnSave": false,
33+
"go.coverageDecorator": {
34+
"coveredHighlightColor": "rgba(64,128,64,0.5)",
35+
"type": "gutter",
36+
"uncoveredHighlightColor": "rgba(128,64,64,0.25)"
37+
},
38+
"go.delveConfig": {
39+
"debugAdapter": "dlv-dap",
40+
"dlvLoadConfig": {
41+
"followPointers": true,
42+
"maxArrayValues": 64,
43+
"maxStringLen": 256,
44+
"maxStructFields": -1,
45+
"maxVariableRecurse": 1
46+
},
47+
"showGlobalVariables": false
48+
},
49+
"go.enableCodeLens": {
50+
"runtest": true
51+
},
4352
"go.inlayHints.assignVariableTypes": true,
4453
"go.inlayHints.compositeLiteralFields": true,
4554
"go.inlayHints.compositeLiteralTypes": true,
4655
"go.inlayHints.constantValues": true,
4756
"go.inlayHints.functionTypeParameters": true,
4857
"go.inlayHints.parameterNames": true,
4958
"go.inlayHints.rangeVariableTypes": true,
50-
51-
// ============================================================
52-
// LINTING
53-
// ============================================================
54-
"go.lintTool": "golangci-lint",
5559
"go.lintFlags": [
5660
"--fast",
5761
"--timeout=5m"
5862
],
5963
"go.lintOnSave": "package",
60-
61-
// ============================================================
62-
// TESTING
63-
// ============================================================
64+
"go.lintTool": "golangci-lint",
6465
"go.testExplorerPackages": ".*",
6566
"go.testFlags": [
6667
"-v",
6768
"-race",
6869
"-count=1"
6970
],
70-
"go.coverOnSave": false,
71-
"go.coverageDecorator": {
72-
"type": "gutter",
73-
"coveredHighlightColor": "rgba(64,128,64,0.5)",
74-
"uncoveredHighlightColor": "rgba(128,64,64,0.25)"
75-
},
76-
77-
// ============================================================
78-
// CODE LENS
79-
// ============================================================
80-
"go.enableCodeLens": {
81-
"runtest": true
82-
},
83-
84-
// ============================================================
85-
// DEBUGGING (Delve)
86-
// ============================================================
87-
"go.delveConfig": {
88-
"dlvLoadConfig": {
89-
"followPointers": true,
90-
"maxVariableRecurse": 1,
91-
"maxStringLen": 256,
92-
"maxArrayValues": 64,
93-
"maxStructFields": -1
94-
},
95-
"showGlobalVariables": false,
96-
"debugAdapter": "dlv-dap"
97-
},
98-
99-
// ============================================================
100-
// STRUCT TAG MANAGEMENT
101-
// ============================================================
102-
"go.addTags": {
103-
"tags": "json",
104-
"options": "json=omitempty",
105-
"promptForTags": false,
106-
"transform": "snakecase"
107-
},
108-
109-
// ============================================================
110-
// GOPLS (LANGUAGE SERVER) CONFIGURATION
111-
// ============================================================
71+
"go.toolsManagement.autoUpdate": true,
72+
"go.useLanguageServer": true,
11273
"gopls": {
113-
// --------------------------------------------------------
114-
// Formatting (gofumpt for stricter formatting)
115-
// --------------------------------------------------------
116-
"formatting.gofumpt": true,
117-
118-
// --------------------------------------------------------
119-
// IMPORTANT: Project-Specific Module Path
120-
// For multi-project use, update this to your module path:
121-
// Example: "github.com/yourorg/yourproject"
122-
// Or remove this setting to use auto-detection
123-
// --------------------------------------------------------
124-
"formatting.local": "github.com/bsv-blockchain/go-template",
125-
126-
// --------------------------------------------------------
127-
// UI & Completion Features
128-
// --------------------------------------------------------
129-
"ui.semanticTokens": true,
130-
"ui.completion.completeFunctionCalls": true,
131-
"ui.completion.usePlaceholders": true,
132-
133-
// --------------------------------------------------------
134-
// Symbol Navigation
135-
// --------------------------------------------------------
136-
"symbolMatcher": "fastfuzzy",
137-
"symbolStyle": "full",
138-
"ui.navigation.importShortcut": "Definition",
139-
140-
// --------------------------------------------------------
141-
// Enhanced Diagnostics & Static Analysis
142-
// Extends the 60+ golangci-lint philosophy into the IDE
143-
// --------------------------------------------------------
144-
"ui.diagnostic.staticcheck": true,
145-
"ui.diagnostic.analyses": {
146-
"unusedparams": true,
147-
"shadow": true,
148-
"unusedwrite": true,
149-
"nilness": true,
150-
"unusedvariable": true
151-
},
152-
153-
// --------------------------------------------------------
154-
// Build Performance (Exclude directories from analysis)
155-
// --------------------------------------------------------
15674
"build.directoryFilters": [
15775
"-node_modules",
15876
"-vendor",
15977
"-.git",
16078
"-dist",
16179
"-build",
16280
"-.mage-cache"
163-
]
81+
],
82+
"formatting.gofumpt": true,
83+
"formatting.local": "github.com/bsv-blockchain/go-template",
84+
"symbolMatcher": "fastfuzzy",
85+
"symbolStyle": "full",
86+
"ui.completion.completeFunctionCalls": true,
87+
"ui.completion.usePlaceholders": true,
88+
"ui.diagnostic.analyses": {
89+
"nilness": true,
90+
"shadow": true,
91+
"unusedparams": true,
92+
"unusedvariable": true,
93+
"unusedwrite": true
94+
},
95+
"ui.diagnostic.staticcheck": true,
96+
"ui.navigation.importShortcut": "Definition",
97+
"ui.semanticTokens": true
16498
}
16599
}

0 commit comments

Comments
 (0)