Skip to content

Conversation

@Numkil
Copy link
Contributor

@Numkil Numkil commented Jul 25, 2023

hi @feoh

The problem was that kickstart initializes all LSP's that are installed and not only the ones explicitly defined in your servers variable. I locally had not done this so I did not realize this at the time.

Here I add a conditional check to see if servers[server_name] is explicitly defined in servers and if not to just set nil on the filetypes variable

This fixes #375

@feoh
Copy link
Collaborator

feoh commented Jul 25, 2023

Thanks for the fix!

@tjdevries @mech-a can anyone validate this approach? Not so much for the fix itself as that seems valid to my eye but the approach he's taking to allowing additional filetypes to attach to a given LSP?

I really should have asked for wider input on the initial change but got excited and merged it without enough testing, so I'm asking now :)

Thanks folks!

@tjdevries
Copy link
Member

I think you could do something like this:

filetypes = servers[server_name].filetypes, -> filetypes = (servers[server_name] or {}).filetypes,

@Numkil
Copy link
Contributor Author

Numkil commented Jul 25, 2023

I personally would prefer if Kickstart would only call setup() on LSP servers I have defined in the servers variable above. I think that would cause the config to behave in a more predictable way since you would always have an explicit map of all the LSP's you have enabled right in your init.lua.

The downside would be that everything would work less automatic for the people who do not modify their config at all and install LSP's through Mason manually without relying on the ensure_installed function.

It probably is a bit of a coin toss which approach would be most useful for most people so I understand that its hard to have a perfect solution for everyone.

@tjdevries
Thanks for that syntax tip. Ill update my PR accordingly

@feoh
Copy link
Collaborator

feoh commented Jul 25, 2023

@Numkil It's a tricky thing to balance the preferences of our myriad users in a project like this :) For every user who comments there are a hundred just quietly git clone-ing and moving on with their lives.

Thanks for understanding. I tested @tjdevries proposed fix locally and it works, so if you could indeed update your PR we'll get this merged and everyone will be (mostly?) happy :)

@feoh feoh merged commit 3dc1c1c into nvim-lua:master Jul 25, 2023
@Numkil
Copy link
Contributor Author

Numkil commented Jul 25, 2023

@feoh done!

I might change the approach in my own fork since thats the spirit of this project haha 👍

@feoh
Copy link
Collaborator

feoh commented Jul 25, 2023

Abso-freaking-lutely!

One tip I wasn't aware of with forks:

If you're encountering all kinds of crazy pulling down changes from upstream and you're using rebase, try merge, it will do the git auto-resolve magic much more effectively.

I was having a hell of a time maintaining mine but now that I've switched from rebase to merge I only get dinged when there's an ACTUAL conflict.

If you like maybe put a pointer to your refactor here once you're done. Always worth keeping an open mind and seeing how others are doing things!

Thanks everyone for your comments and help with this. I feel like my Neovim Lua education is ongoing :)

@Numkil Numkil deleted the patch-bug branch August 19, 2023 14:24
qiuye2015 pushed a commit to qiuye2015/fjp.nvim that referenced this pull request Dec 10, 2023
Fix bug when server not explicitely defined in configuration but installed
s-frick pushed a commit to s-frick/kickstart.nvim that referenced this pull request Jul 29, 2024
Fix bug when server not explicitely defined in configuration but installed
melobern added a commit to melobern/kickstart.nvim that referenced this pull request Oct 30, 2024
Fix bug when server not explicitely defined in configuration but installed
felixhummel added a commit to felixhummel/nvim that referenced this pull request Dec 19, 2024
Fix bug when server not explicitely defined in configuration but installed
restray added a commit to restray/kickstart.nvim that referenced this pull request Mar 16, 2025
Fix bug when server not explicitely defined in configuration but installed
tkappedev pushed a commit to tkappedev/kickstart.nvim that referenced this pull request Jun 14, 2025
Fix bug when server not explicitely defined in configuration but installed
apriljarosz pushed a commit to apriljarosz/kickstart.nvim that referenced this pull request Jun 19, 2025
Fix bug when server not explicitely defined in configuration but installed
eduardofuncao pushed a commit to eduardofuncao/config.nvim that referenced this pull request Aug 5, 2025
Fix bug when server not explicitely defined in configuration but installed
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.

kickstart.nvim currently spews 'attempt to index null value' errors at startup

3 participants