Configurable workspace path
I jump between java projects quite frequently, which means that each of them need a separate workspace directory. Otherwise, there is a need to clear the workspace dir before every launch, which is sub-optimal.
I got around this issue by applying a patch the the jdtls-launcher.sh, that allow the script to accept an optional workspace directory. So the way it works now is:
- Workspace root is unique per project, which is resolved dynamically every time jdtls is to be launched.
- this line takes whatever args were passed from cmd and forwards them to
rune.g. `run "$@" - Instead of using a hard-coded workspace path here we instead take the arguments passed to the function e.g.
--data "$@"
I realize this is a very naive solution, but it works for most of the use cases. I certainly haven't had problems with it so far.
Ideally, there should be an option like --workspaceDir or something that would default if not provided. WDYT?
I don't quite understand the problem here, there shouldn't be any conflicts by default since the workspace is a root and each project gets its own subdirectory.
For example, this is my Workspace structure:
❯ tree -L 1
.
├── eruizc-dev_a8d6905d
├── jdt.ls-java-project
├── nvim-efm-setup_2e6741e6
├── TCP_conversor_aa60fe8c
├── test_1356b31d
├── test_4c6067d
└── test_de585d96
A hash is also included to prevent conflicts from projects with the same name
I like the solution you provided for changing workspace (assuming we keep backwards compatibility and there's a default value), but are we sure that's the root of your problem?
Since the per-project workspace isn't much of an issue and the default location ~/.cache/jdtls-workspace is now configurable, I'll close this
Thanks for the issue and PR #20