Skip to content

Propsed fix for init.lua warnings without disabling diagnostics#1354

Merged
feoh merged 1 commit into
masterfrom
cpatti_1305_fix_init_lua_warnings
Feb 19, 2025
Merged

Propsed fix for init.lua warnings without disabling diagnostics#1354
feoh merged 1 commit into
masterfrom
cpatti_1305_fix_init_lua_warnings

Conversation

@feoh

@feoh feoh commented Feb 15, 2025

Copy link
Copy Markdown
Collaborator

Proposed fix as per #1305 (comment)

FOLKS SHOULD TEST THIS THOROUGHLY. I'm not having any issues but I'd love more feedback please.


NOTE
Please verify that the base repository above has the intended destination!
Github by default opens Pull Requests against the parent of a forked repository.
If this is your personal fork and you didn't intend to open a PR for contribution
to the original project then adjust the base repository accordingly.


@Jessy616

This comment was marked as spam.

@Jessy616

This comment was marked as spam.

@Jessy616

This comment was marked as spam.

Comment thread init.lua
@@ -675,6 +675,8 @@ require('lazy').setup({
require('mason-tool-installer').setup { ensure_installed = ensure_installed }

require('mason-lspconfig').setup {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setup_handlers() could also be used instead of setup(). See :h mason-lspconfig.setup_handlers()

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you I'll look into that.

Do you have any thoughts on the key point from the issue about the concerns that turning off auto-install might break something?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, mason-lspconfig just merges the user-config with a table containing default values. For automatic_installation that default value seems to be false. So auto-install is already implicitly disabled.

@feoh

feoh commented Feb 18, 2025

Copy link
Copy Markdown
Collaborator Author

Lots of good commentary here, and thanks for all of it!

Unless I hear "Don't merge this. You'll break the world!" I'm going to merge tomorrow, because people keep opening bugs against these warnings and it really would be great to silence them :)

@Jessy616

Copy link
Copy Markdown

Hi

@feoh feoh merged commit 34e7d29 into master Feb 19, 2025
@moustario moustario mentioned this pull request Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants