|
1 | 1 | { |
| 2 | + // ============================================================ |
| 3 | + // GO LANGUAGE CONFIGURATION |
| 4 | + // ============================================================ |
2 | 5 | "[go.mod]": { |
3 | 6 | "editor.codeActionsOnSave": { |
4 | 7 | "source.organizeImports": "explicit" |
|
9 | 12 | "editor.codeActionsOnSave": { |
10 | 13 | "source.organizeImports": "explicit" |
11 | 14 | }, |
12 | | - "editor.formatOnSave": true |
| 15 | + "editor.formatOnSave": true, |
| 16 | + "editor.defaultFormatter": "golang.go" |
13 | 17 | }, |
14 | 18 | "[go][go.mod]": { |
15 | 19 | "editor.codeActionsOnSave": { |
16 | 20 | "source.organizeImports": "explicit" |
17 | 21 | } |
18 | 22 | }, |
| 23 | + |
| 24 | + // ============================================================ |
| 25 | + // OTHER LANGUAGE CONFIGURATIONS |
| 26 | + // ============================================================ |
| 27 | + "[yaml]": { |
| 28 | + "editor.defaultFormatter": "redhat.vscode-yaml" |
| 29 | + }, |
| 30 | + "files.associations": { |
| 31 | + "application.yaml": "yaml-cloudformation" |
| 32 | + }, |
| 33 | + |
| 34 | + // ============================================================ |
| 35 | + // GO TOOLS & LANGUAGE SERVER |
| 36 | + // ============================================================ |
| 37 | + "go.useLanguageServer": true, |
| 38 | + "go.toolsManagement.autoUpdate": true, |
| 39 | + |
| 40 | + // ============================================================ |
| 41 | + // LINTING |
| 42 | + // ============================================================ |
| 43 | + "go.lintTool": "golangci-lint", |
19 | 44 | "go.lintFlags": [ |
20 | | - "--verbose" |
| 45 | + "--fast", |
| 46 | + "--timeout=5m" |
21 | 47 | ], |
22 | | - "go.lintTool": "golangci-lint", |
23 | | - "go.useLanguageServer": true, |
| 48 | + "go.lintOnSave": "package", |
| 49 | + |
| 50 | + // ============================================================ |
| 51 | + // TESTING |
| 52 | + // ============================================================ |
| 53 | + "go.testExplorerPackages": ".*", |
| 54 | + "go.testFlags": [ |
| 55 | + "-v", |
| 56 | + "-race", |
| 57 | + "-count=1" |
| 58 | + ], |
| 59 | + "go.coverOnSave": false, |
| 60 | + "go.coverageDecorator": { |
| 61 | + "type": "gutter", |
| 62 | + "coveredHighlightColor": "rgba(64,128,64,0.5)", |
| 63 | + "uncoveredHighlightColor": "rgba(128,64,64,0.25)" |
| 64 | + }, |
| 65 | + |
| 66 | + // ============================================================ |
| 67 | + // CODE LENS |
| 68 | + // ============================================================ |
| 69 | + "go.enableCodeLens": { |
| 70 | + "runtest": true |
| 71 | + }, |
| 72 | + |
| 73 | + // ============================================================ |
| 74 | + // DEBUGGING (Delve) |
| 75 | + // ============================================================ |
| 76 | + "go.delveConfig": { |
| 77 | + "dlvLoadConfig": { |
| 78 | + "followPointers": true, |
| 79 | + "maxVariableRecurse": 1, |
| 80 | + "maxStringLen": 256, |
| 81 | + "maxArrayValues": 64, |
| 82 | + "maxStructFields": -1 |
| 83 | + }, |
| 84 | + "showGlobalVariables": false, |
| 85 | + "debugAdapter": "dlv-dap" |
| 86 | + }, |
| 87 | + |
| 88 | + // ============================================================ |
| 89 | + // STRUCT TAG MANAGEMENT |
| 90 | + // ============================================================ |
| 91 | + "go.addTags": { |
| 92 | + "tags": "json", |
| 93 | + "options": "json=omitempty", |
| 94 | + "promptForTags": false, |
| 95 | + "transform": "snakecase" |
| 96 | + }, |
| 97 | + |
| 98 | + // ============================================================ |
| 99 | + // GOPLS (LANGUAGE SERVER) CONFIGURATION |
| 100 | + // ============================================================ |
24 | 101 | "gopls": { |
| 102 | + // -------------------------------------------------------- |
| 103 | + // Formatting (gofumpt for stricter formatting) |
| 104 | + // -------------------------------------------------------- |
25 | 105 | "formatting.gofumpt": true, |
26 | | - "formatting.local": "github.com/mrz1836/go-sanitize" |
| 106 | + |
| 107 | + // -------------------------------------------------------- |
| 108 | + // IMPORTANT: Project-Specific Module Path |
| 109 | + // For multi-project use, update this to your module path: |
| 110 | + // Example: "github.com/yourorg/yourproject" |
| 111 | + // Or remove this setting to use auto-detection |
| 112 | + // -------------------------------------------------------- |
| 113 | + "formatting.local": "github.com/mrz1836/go-sanitize", |
| 114 | + |
| 115 | + // -------------------------------------------------------- |
| 116 | + // UI & Completion Features |
| 117 | + // -------------------------------------------------------- |
| 118 | + "ui.semanticTokens": true, |
| 119 | + "ui.completion.completeFunctionCalls": true, |
| 120 | + "ui.completion.usePlaceholders": true, |
| 121 | + |
| 122 | + // -------------------------------------------------------- |
| 123 | + // Inlay Hints (Inline Type & Parameter Information) |
| 124 | + // -------------------------------------------------------- |
| 125 | + "ui.inlayHint.assignVariableTypes": true, |
| 126 | + "ui.inlayHint.compositeLiteralFields": true, |
| 127 | + "ui.inlayHint.compositeLiteralTypes": true, |
| 128 | + "ui.inlayHint.constantValues": true, |
| 129 | + "ui.inlayHint.functionTypeParameters": true, |
| 130 | + "ui.inlayHint.parameterNames": true, |
| 131 | + "ui.inlayHint.rangeVariableTypes": 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.vulncheck": "Imports", |
| 146 | + "ui.diagnostic.analyses": { |
| 147 | + "unusedparams": true, |
| 148 | + "shadow": true, |
| 149 | + "unusedwrite": true, |
| 150 | + "fieldalignment": true, |
| 151 | + "nilness": true, |
| 152 | + "unusedvariable": true |
| 153 | + }, |
| 154 | + |
| 155 | + // -------------------------------------------------------- |
| 156 | + // Build Performance (Exclude directories from analysis) |
| 157 | + // -------------------------------------------------------- |
| 158 | + "build.directoryFilters": [ |
| 159 | + "-node_modules", |
| 160 | + "-vendor", |
| 161 | + "-.git", |
| 162 | + "-dist", |
| 163 | + "-build", |
| 164 | + "-.mage-cache" |
| 165 | + ] |
27 | 166 | } |
28 | 167 | } |
0 commit comments