ecosse3 / nvim

A non-minimal Neovim config built to work most efficiently with Frontend Development
GNU General Public License v3.0
1.22k stars 107 forks source link

feat(lsp): use config to load lsp servers #32

Closed akiletour closed 2 years ago

akiletour commented 2 years ago

Hello,

I had an idea, I don't know if you will like it :D

Why not move the loading of LSPs directly from the lua/config.lua file, which will allow us to have less file to modify if we want to use ecovim.

What do you think about it?

ecosse3 commented 2 years ago

That's great idea! Could you also nest them so the final structure will be:

  lsp = {
    servers = {
      -- 'bash',
      -- 'css',
      -- 'eslint',
      -- 'graphql',
      -- 'html',
      -- 'json',
      -- 'lua',
      -- 'tailwind',
      -- 'tsserver',
      -- 'vue2'
    }
  },

By that it gives possibility to extend it with another options such as icons or something new in future.

Then we can modify a bit for loop:

for _, server_name in ipairs(EcoVim.lsp.servers) do
  require('lsp.servers.' .. server_name)
end

Thank you for your contribution!

akiletour commented 2 years ago

Good idea @ecosse3 :) Is it better now?

ecosse3 commented 2 years ago

Is it better now?

Thank you, it's great!