Skip to content
This repository was archived by the owner on Nov 30, 2025. It is now read-only.
This repository was archived by the owner on Nov 30, 2025. It is now read-only.

feature: Workspace data dir should be unique #54

Description

@jvalkeal

Did you check the docs?

  • I have read all 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 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

Activity

  1. s1n7ax commented on Dec 20, 2023

    @s1n7ax
    Member

    @jvalkeal Good point. I will add this to next release.

  2. self-assigned this
    on Dec 20, 2023
  3. added this to the v2.0.0 milestone on Dec 20, 2023
  4. jvalkeal commented on Dec 20, 2023

    @jvalkeal
    Author

    I could work on these issues I'm creating.

  5. assigned and unassigned on Dec 22, 2023
  6. moved this from Todo to In Progress in Java for Neovimon Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions