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

Allow disabling diagnostics #980

Closed
plexus opened this issue Jan 22, 2021 · 0 comments
Closed

Allow disabling diagnostics #980

plexus opened this issue Jan 22, 2021 · 0 comments
Labels

Comments

@plexus
Copy link
Contributor

plexus commented Jan 22, 2021

Calva receives various diagnostics from clojure-lsp (which gets most but not all of these from clj-kondo), it then displays them as squiggly annotations.

Not everyone wants this, I mostly perceive these as noise. People with ADHD in particular may find these really troublesome.

I could not find a way to disable these. Calva and clojure-lsp don't seem to have a flag for it. I couldn't find a way to tell VS Code to ignore linting/annotations. The best you can do right now is to disable linters in clj-kondo, but not all diagnostics are coming from clj-kondo (e.g. unused namespace, unused public are coming from clojure-lsp itself).

I'm testing out a patch that adds a configuration flag for this, essentially this:

// package.json
                    "calva.displayDiagnostics": {
                        "type": "boolean",
                        "markdownDescription": "Show linter warnings and other diagnostics from clojure-lsp and clj-kondo.",
                        "default": true
                    }
// lsp.ts
        middleware: {
            handleDiagnostics(uri, diagnostics, next) {
                if (!state.config().displayDiagnostics) {
                    return;
                }

If it works I can send a PR, meanwhile happy to get some input on this. Is this a reasonable place to handle this? Any opinions on the config flag / description?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants