init.lua 854 B

123456789101112131415161718
  1. -- 1. get the config for this server from nvim-lspconfig and adjust the cmd path.
  2. -- relative paths are allowed, lspinstall automatically adjusts the cmd and cmd_cwd for us!
  3. local config = require'lspconfig'.jdtls.document_config
  4. require'lspconfig/configs'.jdtls = nil -- important, unset the loaded config again
  5. -- config.default_config.cmd[1] = "./node_modules/.bin/bash-language-server"
  6. -- 2. extend the config with an install_script and (optionally) uninstall_script
  7. require'lspinstall/servers'.jdtls = vim.tbl_extend('error', config, {
  8. -- lspinstall will automatically create/delete the install directory for every server
  9. install_script = [[
  10. git clone https://github.com/eclipse/eclipse.jdt.ls.git
  11. cd eclipse.jdt.ls
  12. ./mvnw clean verify
  13. ]],
  14. uninstall_script = nil -- can be omitted
  15. })
  16. require'lspinstall'.setup()