|
| 1 | +{ |
| 2 | + "editor.formatOnSave": false, |
| 3 | + "editor.formatOnPaste": false, |
| 4 | + "editor.formatOnType": false, |
| 5 | + "editor.codeActionsOnSave": [ ], |
| 6 | + "editor.rulers": [ 120 ], |
| 7 | + |
| 8 | + // markdown formatting options |
| 9 | + "[markdown]": { |
| 10 | + "editor.formatOnSave": true, |
| 11 | + "editor.defaultFormatter": "esbenp.prettier-vscode" |
| 12 | + }, |
| 13 | + // json formatting options |
| 14 | + "[json]": { |
| 15 | + "editor.formatOnSave": true, |
| 16 | + "editor.defaultFormatter": "vscode.json-language-features" |
| 17 | + }, |
| 18 | + "[jsonc]": { |
| 19 | + "editor.formatOnSave": true, |
| 20 | + "editor.defaultFormatter": "vscode.json-language-features" |
| 21 | + }, |
| 22 | + // yaml formatting options |
| 23 | + "[yaml]": { |
| 24 | + "editor.formatOnSave": true, |
| 25 | + "editor.defaultFormatter": "redhat.vscode-yaml" |
| 26 | + }, |
| 27 | + // we want to support make files as well |
| 28 | + "[makefile]": { |
| 29 | + "editor.formatOnSave": true, |
| 30 | + "editor.defaultFormatter": "ms-vscode.makefile-tools" |
| 31 | + }, |
| 32 | + // go specific settings |
| 33 | + "[go]": { |
| 34 | + "editor.formatOnSave": true, |
| 35 | + "editor.defaultFormatter": "golang.go", |
| 36 | + "editor.codeActionsOnSave": { |
| 37 | + "source.organizeImports": "explicit", |
| 38 | + "source.fixAll": "explicit" |
| 39 | + } |
| 40 | + }, |
| 41 | + // make sure the go language server is enabled |
| 42 | + "go.useLanguageServer": true, |
| 43 | + // configure gopls, the go language server |
| 44 | + "gopls": { |
| 45 | + "ui.semanticTokens": true, |
| 46 | + "ui.completion.usePlaceholders": true |
| 47 | + }, |
| 48 | + // configure the go formatting tool to be goimports |
| 49 | + "go.formatTool": "goimports", |
| 50 | + "go.formatFlags": [ "-local", "github.com/arhea/" ], |
| 51 | + |
| 52 | + // change the linting tool to be golangci |
| 53 | + "go.lintTool": "golangci-lint", |
| 54 | + "go.lintOnSave": "workspace", |
| 55 | + "go.lintFlags": [ "--fast" ], |
| 56 | + // configure the tags we want to add by default |
| 57 | + "go.addTags": { |
| 58 | + "tags": "json,validate", |
| 59 | + "options": "json=omitempty,validate=omitempty", |
| 60 | + "promptForTags": false, |
| 61 | + "transform": "snakecase", |
| 62 | + "template": "" |
| 63 | + }, |
| 64 | + // dont run code coverage on save |
| 65 | + "go.coverOnSave": false, |
| 66 | + "go.coverOnSingleTest": true, |
| 67 | + "go.coverOnTestPackage": true, |
| 68 | + "go.coverShowCounts": false, |
| 69 | + "go.coverageDecorator": { |
| 70 | + "type": "gutter", |
| 71 | + "coveredHighlightColor": "rgba(64,128,128,0.5)", |
| 72 | + "uncoveredHighlightColor": "rgba(128,64,64,0.25)", |
| 73 | + "coveredGutterStyle": "blockgreen", |
| 74 | + "uncoveredGutterStyle": "blockred" |
| 75 | + }, |
| 76 | + // configure some helpful test environment variables |
| 77 | + "go.testEnvVars": { |
| 78 | + "WORKSPACE_DIR": "${workspaceFolder}" |
| 79 | + } |
| 80 | +} |
0 commit comments