zoukankan      html  css  js  c++  java
  • vscode中go代码自动补全

    参考:

    https://abelsu7.top/2019/09/06/gopls-guide/

    点击go插件extensions settings, 打开.vscode/settings.json,

    需要打开以下开关,支持本地包自动补全

     
    "deepCompletion": true, 
     "matcher": "fuzzy",
     

    settings.json配置示例如下:

    {
        "go.useLanguageServer": true,
        "timeline.excludeSources": [],

        "[go]": {
            "editor.snippetSuggestions": "none",
            "editor.formatOnSave": true,
            "editor.codeActionsOnSave": {
                "source.organizeImports": true
            }
        },
        
        "gopls": {
            "completeUnimported": true,
            "usePlaceholders": true,
            "completionDocumentation": true,
            "deepCompletion": true, 
            "matcher": "fuzzy",
            "hoverKind": "SynopsisDocumentation" // No/Synopsis/Full, default Synopsis
        },
        
        "files.eol": " ", // formatting only supports LF line endings

        "go.languageServerExperimentalFeatures": {
            "format": true,
            "autoComplete": true,
            "rename": true,
            "goToDefinition": true,
            "hover": true,
            "signatureHelp": true,
            "goToTypeDefinition": true,
            "goToImplementation": true,
            "documentSymbols": true,
            "workspaceSymbols": true,
            "findReferences": true,
            "diagnostics": false
        },
        "emmet.excludeLanguages": [
        
            "markdown"
        ],
        "go.addTags": {
        
        }
    }

    配置后效果如下:

     
  • 相关阅读:
    react-native 点击按钮进行交互
    常用类
    js里面 undefined 和 null
    ajax 提交数据
    通过Unicode判断一个字符是不是汉字
    git commit 后的对话框
    vue-cli 使用less的方法
    node创建服务器简单测试接口
    bootstrap3 模态框js的控制
    鱼眼镜头的坐标变换
  • 原文地址:https://www.cnblogs.com/beilong/p/13253043.html
Copyright © 2011-2022 走看看