LazyVim/lazyvim.github.io

bug: examples snippet is out of date

Closed this issue · 2 comments

The lua snippet provided in https://www.lazyvim.org/configuration/examples contains many helpful examples, but at this current time it seems to raise a few diagnostic errors when added, which may be confusing to new users like myself.

Here's the current 5 diagnostic errors

   lua/plugins/example.lua  5

 │    Missing required fields in type
 `lspconfig.options`: `als`, `astro`, `awkls`, `bashls`, `clangd`, `cssls`,
 `dartls`, `denols`, `elixirls`, `elmls`, `eslint`, `flow`, `fsautocomplete`,
 `grammarly`, `haxe_language_server`, `hhvm`, `hie`, `html`, `intelephense`,
 `java_language_server`, `jdtls`, `jsonls`, `julials`,
 `kotlin_language_server`, `ltex`, `lua_ls`, `luau_lsp`, `omnisharp`,
 `perlls`, `perlnavigator`, `perlpls`, `powershell_es`, `psalm`, `puppet`,
 `purescriptls`, `pylsp`, `r_language_server`, `rescriptls`, `rls`, `rome`,
 `rust_analyzer`, `solargraph`, `solidity_ls`, `sorbet`, `sourcekit`,
 `spectral`, `stylelint_lsp`, `svelte`, `svlangserver`, `tailwindcss`,
 `terraformls`, `tsserver`, `volar`, `vtsls`, `vuels`, `wgls_analyzer`,
 `yamlls`, `zeta_note`, `zls` Lua Diagnostics. (missing-fields) [92, 17]

 │  Missing required fields in type `lspconfig.options.pyright`: `settings` Lua
 Diagnostics. (missing-fields) [94, 19]

 │     Undefined field `on_attach`.
 Lua Diagnostics. (undefined-field) [105, 33]

 │     Missing required fields
 in type `lspconfig.options`: `als`, `astro`, `awkls`, `bashls`, `clangd`,
 `cssls`, `dartls`, `denols`, `elixirls`, `elmls`, `eslint`, `flow`,
 `fsautocomplete`, `grammarly`, `haxe_language_server`, `hhvm`, `hie`,
 `html`, `intelephense`, `java_language_server`, `jdtls`, `jsonls`,
 `julials`, `kotlin_language_server`, `ltex`, `lua_ls`, `luau_lsp`,
 `omnisharp`, `perlls`, `perlnavigator`, `perlpls`, `powershell_es`, `psalm`,
 `puppet`, `purescriptls`, `pylsp`, `pyright`, `r_language_server`,
 `rescriptls`, `rls`, `rome`, `rust_analyzer`, `solargraph`, `solidity_ls`,
 `sorbet`, `sourcekit`, `spectral`, `stylelint_lsp`, `svelte`,
 `svlangserver`, `tailwindcss`, `terraformls`, `volar`, `vtsls`, `vuels`,
 `wgls_analyzer`, `yamlls`, `zeta_note`, `zls` Lua Diagnostics.
 (missing-fields) [115, 17]

 │     Missing required fields in type
 `lspconfig.options.tsserver`: `settings` Lua Diagnostics. (missing-fields)
 [117, 20]

Can I say that I'm facing similar problems as well?
I wanted to config shfmt so I began with putting the options of conform.nvim in file ~/.config/nvim/lua/plugins/formatting.lua like:

return {
  {
    "stevearc/conform.nvim",
    opts = function ()
      -- omitted
    end,
  }
}

Got something like M undefined.
So I just replaced opts with the returned opts of this func. No more error logs occurred, but nothing had changed QAQ

those are not valid errors. luals diagnostics is not 100% correct all the time