• 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": {
        
        }
    }

    配置后效果如下:

     
  • 相关阅读:
    SFML从入门到放弃(3) 视角和碰撞检测
    SFML从入门到放弃(2) 图像和音频
    SFML从入门到放弃(1) 窗口和交互
    SFML从入门到放弃(0) 配置环境
    NOI2017 酱油记
    【bzoj4889】: [Tjoi2017]不勤劳的图书管理员 分块-BIT
    【bzoj4888】: [Tjoi2017]异或和 BIT-乱搞
    【bzoj4887】:[Tjoi2017]可乐 矩阵乘法,快速幂
    THUSC2017酱油记
    CTSC2017酱油记
  • 原文地址:https://www.cnblogs.com/beilong/p/13253043.html
Copyright © 2020-2023  润新知