Skip to content

Conversation

@tomasgareau
Copy link
Contributor

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:

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:
* nvim-lua#210
* nvim-lua#554
* nvim-lua#555
* nvim-lua#865
@tomasgareau tomasgareau requested a review from iton0 January 3, 2025 17:07
Copy link
Contributor

@iton0 iton0 left a comment

Choose a reason for hiding this comment

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

LGTM

@feoh
Copy link
Collaborator

feoh commented Jan 7, 2025

Thank you for this @tomasgareau you rock!

And thank you @iton0 for the review! It looked reasonable to me but I don't really have time to dive down the rabbit hole and understand its goodness :)

@feoh feoh merged commit db4867a into nvim-lua:master Jan 7, 2025
1 check passed
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