我使用的是VS Code和lukehoban的Go扩展:
https://github.com/Microsoft/vscode-go
好像在你保存文件的时候golint已经运行了,有没有办法在我开始输入的时候让golint运行呢?通常,当我们在其他扩展和语言上输入时,会发生linting,比如jslint,在VS Code上输入tslint。如果可以选择使用golint也可以做到这一点,那就太好了。
我能做些什么来实现这一点?
发布于 2017-02-22 02:13:36
这似乎是完全不可能的。
关于golint的唯一可用配置是:
// Run Lint tool on save.
"go.lintOnSave": true,
// Specifies Lint tool name.
"go.lintTool": "golint",
// Flags to pass to Lint tool (e.g. ["-min_confidence=.8"])
"go.lintFlags": [],也许你可以通过改变这些选项来解决这个问题:
// Controls auto save of dirty files. Accepted values: "off", "afterDelay", "onFocusChange" (editor loses focus), "onWindowChange" (window loses focus). If set to "afterDelay", you can configure the delay in "files.autoSaveDelay".
"files.autoSave": "off",
// Controls the delay in ms after which a dirty file is saved automatically. Only applies when "files.autoSave" is set to "afterDelay"
"files.autoSaveDelay": 1000,您可以将files.autoSave设置为afterDelay和较低的files.autoSaveDelay。
发布于 2020-09-09 08:58:39
围棋的这一面让我发疯。
因此,我找到了一个名为"go.useLanguageServer“的选项(很可能我之前找到过它,但由于某种原因,无论如何都不容易找到它)。
"go.useLanguageServer": true,此外,还有以下选项:
"go.languageServerExperimentalFeatures": {
"diagnostics": true,
"documentLink": true
},
"go.liveErrors": {
"enabled": true,
"delay": 500,
},https://stackoverflow.com/questions/42349678
复制相似问题