You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently jdtls is launched with something like -data /home/jvalkealahti/.cache/nvim/jdtls/workspaces/common-workspace. All the examples around jdtls seems to propose to just use a common directory which imho is just wrong. When you re-launch jdtls or used a completely different project, jdtls will actually partially wipe stuff from its data directory.
That's why i.e. vscode will calculate a hash(based on your project root) and uses that to launch jdtls with unique data directory.
Describe the solution you'd like
In my nvim-jdtls setup i've just been using this relatively naive hack which with this plugin would look something like:
local project_name = string.gsub(vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h"), "/", "_")
local path = join(cache_dir, 'nvim', 'jdtls', 'workspaces', 'common-workspace', project_name)
That would give you something like /home/jvalkealahti/.cache/nvim/jdtls/workspaces/common-workspace/_home_jvalkealahti_path_to_projectroot.
Lua don't have any buildin hash functions so we'd just need to come up with something else which creates a unique directory name.
Describe alternatives you've considered
Don't there's any.
Additional context
No response
The text was updated successfully, but these errors were encountered:
Did you check the docs?
Is your feature request related to a problem? Please describe.
Currently
jdtls
is launched with something like-data /home/jvalkealahti/.cache/nvim/jdtls/workspaces/common-workspace
. All the examples aroundjdtls
seems to propose to just use a common directory which imho is just wrong. When you re-launchjdtls
or used a completely different project,jdtls
will actually partially wipe stuff from its data directory.That's why i.e. vscode will calculate a hash(based on your project root) and uses that to launch
jdtls
with unique data directory.Describe the solution you'd like
In my
nvim-jdtls
setup i've just been using this relatively naive hack which with this plugin would look something like:That would give you something like
/home/jvalkealahti/.cache/nvim/jdtls/workspaces/common-workspace/_home_jvalkealahti_path_to_projectroot
.Lua don't have any buildin hash functions so we'd just need to come up with something else which creates a unique directory name.
Describe alternatives you've considered
Don't there's any.
Additional context
No response
The text was updated successfully, but these errors were encountered: