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

fix: prevent mason setup from being run twice (#1298) #1

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

BasedScott
Copy link
Owner

  • fix: prevent mason setup from being run twice

Addresses nvim-lua#1297

Currently, we're calling require('mason').setup(...) twice:

  • once when setting it as a dependency of nvim-lspconfig (since we set config = true)
  • once in the config function we define for nvim-lspconfig

Calling setup twice can cause issues with, e.g., setting the PATH option: you might append Mason's bin dir in one setup call and prepend it in the other.

We've kept the setup of mason in the nvim-lspconfig dependencies table since leaving it to the config function caused some plugin-loading-order related issues in the past. See:


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.


* fix: prevent mason setup from being run twice

Addresses #1297

Currently, we're calling `require('mason').setup(...)` twice:
* once when setting it as a dependency of `nvim-lspconfig` (since we set
	`config = true`)
* once in the `config` function we define for `nvim-lspconfig`

Calling setup twice can cause issues with, e.g., setting the `PATH`
option: you might append Mason's bin dir in one setup call and prepend
it in the other.

We've kept the setup of `mason` in the `nvim-lspconfig` dependencies
table since leaving it to the `config` function caused some
plugin-loading-order related issues in the past. See:
* #210
* #554
* #555
* #865

* docs: tweak comments per review feedback
@BasedScott BasedScott merged commit 6819be7 into BasedScott:master Jan 9, 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.

2 participants