williamboman / nvim-lsp-installer

Further development has moved to https://github.com/williamboman/mason.nvim!
https://github.com/williamboman/mason.nvim
Apache License 2.0
2k stars 123 forks source link

configurable jvm_args & workspace for jdtls server #857

Open s1n7ax opened 2 years ago

s1n7ax commented 2 years ago

Is your feature request related to a problem? Please describe.

lspconfig allows jvm_args and workspace to be overridden by setting config.init_options.

nvim-lsp-installer seems to be using config.vmargs & vim.env.WORKSPACE.

Since nvim-lsp-installer allows to be setup through the regular lspconfig.setup() it would be nice to respect lspconfig config.

Describe the solution you'd like

Following config should change set -additional_arg JVM option and should change the workspace from ~/workspace to ~/.cache/jdtls.

require('lspconfig').jdtls.setup({
    init_options = {
        -- export DEFAULT_VMARGS so user can append additional args without
        -- having to manage default args?
        jvm_args = '-additional_arg',

        -- I like the idea of generic workspace, but better to have it working
        -- with init_options.workspace too I guess
        workspace = vim.env.HOME .. '/cache/.jdtls'
    }
})

Describe potential alternatives you've considered

To export DEFAULT_VMARGS, a possible solution would be, moving DEFAULT_VMARGS to nvim-lsp-installer/servers/jdtls/defaults.lua.

williamboman commented 2 years ago

Hello! I believe the nvim-lsp-installer settings were added before jdtls introduced the jdtls wrapper script. In order to avoid breaking changes for people using jdtls via nvim-lsp-installer I'm not too sure about completely removing the current behaviour. I'd be happy to accept a PR that makes nvim-lsp-installer behave a bit better with jdtls (while not changing default behaviour)! (also as a sidenote, going forward I'll be concentrating my efforts on https://github.com/williamboman/mason.nvim which will be stabilized soon)

s1n7ax commented 1 year ago

@williamboman mason will replace this?