Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: add an option to suppress or reduce verbosity of diagnostics for go.mod #51262

Open
esprehn opened this issue Feb 10, 2022 · 2 comments · May be fixed by golang/tools#374
Open

x/tools/gopls: add an option to suppress or reduce verbosity of diagnostics for go.mod #51262

esprehn opened this issue Feb 10, 2022 · 2 comments · May be fixed by golang/tools#374
Labels
FeatureRequest gopls/workspace gopls Tools
Milestone

Comments

@esprehn
Copy link

@esprehn esprehn commented Feb 10, 2022

We have a project that intentionally has deps in the go.mod that appear unused (ex. because of generated code at build time through bazel). VSCode shows a long list of the below problems.

I've tried the suggestion here:
microsoft/vscode-go#3181

   "[go.mod]": {
        "editor.codeLens": false
    }

and also:

    "ui.codelenses": {
      "gc_details": false,
      "regenerate_cgo": false,
      "generate": false,
      "test": false,
      "tidy": false,
      "upgrade_dependency": false,
      "vendor": false,
    },

but it still shows warnings/errors:

Screen Shot 2022-02-10 at 4 50 25 PM

@suzmue suzmue added gopls FeatureRequest labels Feb 10, 2022
@suzmue
Copy link
Contributor

@suzmue suzmue commented Feb 10, 2022

The warnings / errors you are seeing are coming from the gopls diagnostics feature. There is currently no way to disable the go mod tidy diagnostics. Leaving this open as a feature request.

@hyangah hyangah changed the title No way to ignore go tidy problems in go.mod x/tools/gopls: add an option to suppress or reduce verbosity of diagnostics for go.mod Feb 18, 2022
@hyangah hyangah transferred this issue from golang/vscode-go Feb 18, 2022
@gopherbot gopherbot added the Tools label Feb 18, 2022
@gopherbot gopherbot added this to the Unreleased milestone Feb 18, 2022
@suzmue suzmue removed this from the Unreleased milestone Feb 23, 2022
@suzmue suzmue added this to the gopls/on-deck milestone Feb 23, 2022
@findleyr
Copy link
Contributor

@findleyr findleyr commented Mar 7, 2022

I think the correct path forward here is probably to allow disabling gopls' modfile diagnostics (or at least control verbosity) rather than to have syntax in the modfile that is only used by gopls.

Generally we try to avoid any changes to the source that exist only to integrate with a single tool.

@findleyr findleyr added the gopls/workspace label May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest gopls/workspace gopls Tools
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants