nvim-lua / kickstart.nvim

A launch point for your personal nvim configuration
MIT License
16.77k stars 16.75k forks source link

Update init.lua to prevent mason package error #916

Closed sahanagana closed 2 months ago

sahanagana commented 2 months ago

I kept repeatedly getting mason errors where the results of functions were 'nil' and checkhealth was failing. Rearranging the code this way fixed that problem.


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.


sahanagana commented 2 months ago

I can't see how this rearrange could fix anything.

I was getting issues with mason on startup, and when I ran checkhealth, it completely failed. I have screenshots of this behavior, as well as these issues being resolved after I made the change. I found the solution online with moving the setup() call, which fixed the error. I'm not entirely sure how it works, but I believe it has to do with calling mason-lspconfig before setting up mason. It may also have to do with my neovim version (v0.9.4).

dam9000 commented 2 months ago

You're moving the call to mason setup() from after the servers= assignment to before of it. The assignment does not execute any code, I can't see how this change could affect anything. I understand this now works for you but I believe the fix is not related to your change, but perhaps just the fact that you re-run the nvim and Mason was then able to complete with whatever failed before. Are you able to reproduce the issue by reverting the change?

feoh commented 2 months ago

I agree.

I'm glad this helped you, but if you want us to merge this you'll need to give us some sense of why the change is necessary.

Either please close this PR or provide the screenshots and error messages you're getting that prompted this change.

feoh commented 2 months ago

No trouble, but I'm not sure that other PR is necessary.