• Vscode解决Golang无法跳转定义问题


    首先,需要安装好 go 插件,插件市场搜索go,选一个即可安装。

    然后,需要安装 go 的工具包。在 vscode 中,输入快捷键:command(ctrl) + shift + p,在弹出的窗口中,输入:go:install/Update Tools,回车后,选择所有插件(勾一下全选),点击确认,进行安装(设置GOPROXY)。

    接下来,在项目的 settings.json 文件中添加配置:

       "go.goroot": "D:\\Go",
        "go.gopath": "D:\\gopath",
        //第三方库代码提示
        "go.inferGopath": true,
        "go.formatTool": "goreturns",
        //自动完成未导入的包
        "go.autocompleteUnimportedPackages": true,
        "go.gocodePackageLookupMode": "go",
        "go.gotoSymbol.includeImports": true,
        "go.docsTool": "gogetdoc",
        "go.useCodeSnippetsOnFunctionSuggest": true,
        "go.useCodeSnippetsOnFunctionSuggestWithoutType": true,
        "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, 
            },
        },"go.trace.server": "verbose", 
        "gopls": { 
            // Add parameter placeholders when completing a function. 
           "usePlaceholders": false, 
           // If true, enable additional analyses with staticcheck. 
           // Warning: This will significantly increase memory usage.   "staticcheck": false, 
        },"go.languageServerFlags": [ 
            "-remote=auto", "-logfile=auto", "-debug=:0", "-rpc.trace", 
        ], 
    

    首选项-设置 去掉 Use Language Server

    在这里插入图片描述

  • 相关阅读:
    Google Web 字体 API 访谈
    关于如何跨越抄袭程序阶段的一些断想
    DirectX开发中找不到dxtrans.h的问题的解决
    Google Web 字体 API 访谈
    NetBeans 6.9 发布后选版 1 已经可用
    Thrift java服务器与客户端示例
    Wing IDE Pro v. 4.1.91 Python Wingware Python IDE
    tkang's blog
    Thrift的简单使用
    maven加载自己的包
  • 原文地址:https://www.cnblogs.com/senberhu/p/15737504.html
Copyright © 2020-2023  润新知