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

Avoid unnecessary warnings in the checkhealth report; perhaps filter which tests to run accordingly. #1744

Open
1 task done
EdmundsEcho opened this issue Jun 27, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@EdmundsEcho
Copy link

EdmundsEcho commented Jun 27, 2024

I've searched open issues for similar requests

  • Yes

Is your feature request related to a problem? Please describe.

First, this is a great plugin. I love it! I hope this feedback contributes to the quality of the work.

The problem is that mason generates unnecessary warnings in the checkhealth report.

Describe the solution you'd like

Where we have in the lua/mason/health.lua module

    a.wait_all({ 
        check_thunk({ cmd = "go", ... }),
        check_thunk({ cmd = "cargo", ... }),
        check_thunk({ cmd = "luarocks", ... }),
        check_thunk({ cmd = "ruby", args = { "--version" }, name = "Ruby", relaxed = true }),
        check_thunk({ cmd = "gem", args = { "--version" }, name = "RubyGem", relaxed = true }),
        check_thunk({ cmd = "composer", args = { "--version" }, name = "Composer", relaxed = true }),
        check_thunk { cmd = "php", args = { "--version" }, name = "PHP", relaxed = true },
        etc...

These checks generate of bunch of warnings that "stick out" in my checkhealth report, warnings that made me wonder if I had inadvertently activated all of the lsps.

Option 1 (solves the problem)

Have the check be dependent on the user having configured mason to manage the lsp.

Option 2 - update the warning message

At minimum update the warnings to let the person know there isn't anything to do.

Option 3 - only fire Errors

Just get rid of the warnings and only report when a test fails when the user has activated the lsp.

Describe potential alternatives you've considered

I would be happy to contribute with just a little bit of guidance. In particular, I would want to know where in the mason runtime state, it maintains the user configurations... i.e., the list of activated lsps. I know that the companion plugin maintains a list of lsps, but that's presumably not something mason has access to.

Finally, perhaps the lsp-specific health tests should be run using the companion plugin, and not mason. This makes sense given it's the use of the mason-lspconfig plugin where the user has clearly "signalled" that it wants mason to specifically manage more about the lsps.

Next steps

Fix mason?

Where in the runtime code can I access information about the lsps?

Augment mason-lspconfig

Where in the runtime code can I access information about the list managed lsps?

Additional context

A check health report is a place I go to diagnose issues that I should address. The report is likely done when I'm trying to problem-solve something. Warnings can be indicative of a problem. That is not the case here and, thus, an issue that may be worthwhile to consider.

@EdmundsEcho EdmundsEcho added the enhancement New feature or request label Jun 27, 2024
@github-project-automation github-project-automation bot moved this to Needs triage in Issue Triaging Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Needs triage
Development

No branches or pull requests

1 participant