vscode golang 设置

徘徊边缘 提交于 2020-09-26 01:37:00

vscode 用 gopls : is the official language server for the Go language
vscode 设置参考:
    vscode-gopls 设置
注意: 打开一个项目,不能打开多个项目。即打开有go.mod的目录 ,否则不能跳转,甚至有错误提示。


{
    "go.useLanguageServer": true,
    "[go]": {
        "editor.formatOnSave": true,
        "editor.codeActionsOnSave": {
            "source.organizeImports": true,
        },
        // Optional: Disable snippets, as they conflict with completion ranking.
        "editor.snippetSuggestions": "none",
    },
    "[go.mod]": {
        "editor.formatOnSave": true,
        "editor.codeActionsOnSave": {
            "source.organizeImports": true,
        },
    },
    "gopls": {
        // Add parameter placeholders when completing a function.
        "usePlaceholders": true,

        // If true, enable additional analyses with staticcheck.
        // Warning: This will significantly increase memory usage.
        "staticcheck": false,
    },
    //个人喜欢
    "go.docsTool": "gogetdoc"
    "files.autoSave": "afterDelay",
    "files.autoSaveDelay": 500,
    "editor.fontSize": 16,
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!