Skip to content

Instantly share code, notes, and snippets.

@zeroidentidad
Last active February 6, 2025 00:00
Show Gist options
  • Save zeroidentidad/f3afd8e76eb2ef52496892dc94e4134e to your computer and use it in GitHub Desktop.
Save zeroidentidad/f3afd8e76eb2ef52496892dc94e4134e to your computer and use it in GitHub Desktop.
SublimeText + LSP-gopls
// Settings in here override those in "LSP-gopls/LSP-gopls.sublime-settings"
{
"command": ["~/go/bin/gopls"],
"settings": {
"manageGoplsBinary": false,
"gopls.env": {"GOMODCACHE":"~/go/pkg/mod"},
"gopls.directoryFilters": [
"-**/node_modules",
"-**/vendor",
"-**/dist",
"-**/build",
"-**/.git",
"-**/docs"
],
"gopls.gofumpt": true,
"gopls.expandWorkspaceToModule": false,
"gopls.staticcheck": false,
"gopls.analyses": {
"embed": false,
"directive": false,
"buildtag": false,
"asmdecl": false,
"unusedparams": false,
"unreachable": false,
"nilness": false,
"shadow": false,
"fieldalignment": false
},
"gopls.codelenses": {
"gc_details": false,
"regenerate_cgo": false,
"generate": false,
"test": false,
"tidy": false,
"upgrade_dependency": false,
"vendor": false,
"run_vulncheck_exp": false,
"run_govulncheck": false
},
"gopls.matcher": "CaseInsensitive",
"gopls.analysisProgressReporting": false,
"gopls.completionBudget": "400ms",
"gopls.verboseOutput": false,
"gopls.usePlaceholders": true,
"gopls.experimentalPostfixCompletions": false,
"gopls.diagnosticsDelay": "2s",
}
}
// Settings in here override those in "LSP/LSP.sublime-settings"
{
"lsp_format_on_save": true,
"clients": {
"gopls": {
"update_disable": true,
"enabled": true,
"command": ["~/go/bin/gopls"],
"selector": "source.go",
"initializationOptions": {
"gofumpt": true,
"usePlaceholders": true,
"completeUnimported": true
}
},
}
}
// SublimeLinter Settings - User
{
// "debug": true,
"linters": {
"golangcilint": {
"disable": false,
"args": [
"--fast",
"--enable=gosec",
"--concurrency=2",
"--skip-dirs-use-default",
"--exclude-use-default",
"--max-issues-per-linter=50",
],
"executable": "~/go/bin/golangci-lint",
"lint_mode": "save",
"selectors": {
"go": "source.go"
},
"env": {
"GOPATH": "~/go",
"PATH": "$PATH:~/go/bin"
}
}
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment