在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
参考: 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": "\n", // 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": {
}
}
配置后效果如下:
|
请发表评论