nvim-lspconfig icon indicating copy to clipboard operation
nvim-lspconfig copied to clipboard

Missing legacy configs

Open justinmk opened this issue 1 year ago • 15 comments

These legacy configs may require on_new_config (see https://github.com/neovim/nvim-lspconfig/pull/4081 for an alternative), so aren't migrated to the new lsp/*.lua format:

  • [x] angularls
  • [x] apex_ls
  • [x] astro
  • [ ] bqnlsp
  • [ ] cadence
  • [ ] codeqlls
  • [ ] drools_lsp
  • [x] eslint
  • [x] glint
  • [ ] haxe_language_server
  • [x] jsonnet_ls
  • [x] leanls
  • [x] mdx_analyzer
  • [x] omnisharp
  • [ ] openedge_ls
  • [x] powershell_es
  • [ ] relay_lsp
  • [ ] sourcery
  • [x] tailwindcss
  • [ ] vdmj
  • [x] volar
  • [x] zls #3733

These are the ones which have single_file_support = false:

  • [x] biome
  • [ ] bitbake_ls
  • [x] ccls
  • [ ] delphi_ls
  • [x] efm
  • [x] gh_actions_ls https://github.com/neovim/nvim-lspconfig/pull/3713
  • [x] matlab_ls
  • [x] oxlint
  • [x] vectorcode_server

Originally posted by @TheRealLorenz in https://github.com/neovim/nvim-lspconfig/issues/3659#issuecomment-2776613000

justinmk avatar Apr 11 '25 13:04 justinmk

  • https://github.com/neovim/nvim-lspconfig/pull/3666 not needed because vim.system() can be used instead

justinmk avatar Apr 12 '25 14:04 justinmk

efm doesn't has single_file_support = false. Its explicitly set to true: https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/configs/efm.lua#L7.

Is it in this list by mistake and could be migrated to vim.lsp.config?

ybc37 avatar Apr 13 '25 16:04 ybc37

efm doesn't has single_file_support = false. Its explicitly set to true: https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/configs/efm.lua#L7.

Is it in this list by mistake and could be migrated to vim.lsp.config?

I don't use efm myself, so I thought to wait until neovim 0.11.1 in order to also port the documentation which said that older version of efm didn't have single file support.

TheRealLorenz avatar Apr 13 '25 17:04 TheRealLorenz

@ybc37 You could use workspace_required to deal with single_file_support, ref: https://github.com/neovim/neovim/pull/31824

rockyzhang24 avatar Apr 13 '25 17:04 rockyzhang24

@ybc37 You could use workspace_required to deal with single_file_support, ref: https://github.com/neovim/neovim/pull/31824

It's not available in the current neovim release. Will be in 0.11.1.

TheRealLorenz avatar Apr 13 '25 17:04 TheRealLorenz

@TheRealLorenz FWIW, may be helpful: https://github.com/neovim/neovim/issues/32037#issuecomment-2825599872 : root_dir() can be used to conditionally (per-file) decide whether to enable lsp.

justinmk avatar Apr 23 '25 22:04 justinmk

@TheRealLorenz Neovim 0.11.1 is released.

hankertrix avatar Apr 26 '25 17:04 hankertrix

Current version of matlab_ls works without issues with single_file_support = true for me. I'm not sure if it was needed in the past. Can it be migrated without this field?

haraldan avatar Apr 30 '25 09:04 haraldan

Send a pr. "single-file support" is the default in vim.lsp.config, and Nvim 0.11.1 added workspace_required flag to allow configs to disable "single-file support".

justinmk avatar Apr 30 '25 11:04 justinmk

Hi! I'd like to help move apex_ls into the new format, but I'm unsure as to how exactly to do it.

The problem with the Apex LSP Server is that it doesn't provide a cmd, but rather you need to call the jar file by providing the path. I was able to create the lsp/apex_ls.lua locally by hardcoding the path to the jar file downloaded by mason into the cmd property, and hardcoding the flags, and that works just fine, and on_new_config was not needed. But I'm not sure how to properly make it so that cmd can be dynamically set either by the user or (hopefully) mason.

Is there some example lsp/<>.lua where the cmd can be dynamically set/modified that I can follow?

Thanks!

As an example, this works for me:

return {
  cmd = {
    vim.env.JAVA_HOME and (vim.env.JAVA_HOME .. '/bin/java') or 'java',
    '-cp',
    '/home/fede/.local/share/nvim/mason/share/apex-language-server/apex-jorje-lsp.jar',
    '-Ddebug.internal.errors=true',
    '-Ddebug.semantic.errors=false',
    '-Ddebug.completion.statistics=false',
    '-Dlwc.typegeneration.disabled=true',
    'apex.jorje.lsp.ApexLanguageServerLauncher',
  },
  filetypes = { 'apexcode' },
  root_markers = { 'sfdx-project.json' },
}

FedeAbella avatar Jun 16 '25 00:06 FedeAbella

@FedeAbella my current suggestion is to define reuse_client and define cmd() as function. There is sample code given there.

Please open a new PR or issue for further discussion, to avoid too many overlapping discussions in this issue.

justinmk avatar Jun 16 '25 12:06 justinmk

https://github.com/neovim/nvim-lspconfig/pull/4081 shows an interesting way to get the on_new_config effect with vim.lsp.config.

justinmk avatar Sep 19 '25 21:09 justinmk

bitbake_language_server has been migrated to the new API in the initial treewide migration. Yet, bitbake_ls (slightly different name) appears as unchecked in the list of unmigrated servers above. Is that a mistake?

Also, are bitbake_language_server and bidbake_ls the same thing?

GaetanLepage avatar Sep 30 '25 20:09 GaetanLepage

@GaetanLepage as you can see from the above list, https://github.com/neovim/nvim-lspconfig/blob/master/lsp/bitbake_language_server.lua needs workspace_required=true (the equivalent to the old single_file_support = false).

Also, are bitbake_language_server and bitbake_ls the same thing?

Look at the configs to answer that.

  • https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/configs/bitbake_ls.lua cmd is language-server-bitbake and links to https://github.com/yoctoproject/vscode-bitbake/tree/staging/server ,
  • whereas https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/configs/bitbake_language_server.lua cmd is bitbake-language-server and mentions no URL (though it should, since that would help with these kinds of questions).

We would appreciate your help in answering this question and updating the configs. We need actual users to maintain the configs they are interested in, since there are 1000s of configs.

justinmk avatar Sep 30 '25 22:09 justinmk

Thank you for this clarification. I missed this subtle difference.

For a bit of context, I am a maintainer of the nixvim project and we are planning our transition to the new internal vim.lsp API and dropping internal require("lspconfig") usage. I never used these specific bitbake language servers and am thus not familiar with them. Nonetheless, I should have checked the config files more carefully.

We would appreciate your help in answering this question and updating the configs. We need actual users to maintain the configs they are interested in, since there are 1000s of configs.

Sure! Thanks for all the tremendous work you do in neovim by the way. I opened https://github.com/neovim/nvim-lspconfig/pull/4109. Hope it helps :)

GaetanLepage avatar Sep 30 '25 23:09 GaetanLepage