mfussenegger / nvim-jdtls

Extensions for the built-in LSP support in Neovim for eclipse.jdt.ls
GNU General Public License v3.0
1.05k stars 61 forks source link

Show runtime path information in runtime selection #463

Closed jnk22 closed 1 year ago

jnk22 commented 1 year ago

Problem Statement

Hi @mfussenegger, first of all, thank you for this plugin!

I have multiple Java SDKs setup in the settings.java.configurations.runtime, some with the same major version (19, 18, 1.8, etc.), but different minor versions, or system-wide/custom paths.

Due to the the shown runtime.name in the selection being based on the enum ExecutionEnvironment as defined in eclipse.jdt.ls, multiple Java runtimes with the same major versions are not differentiable:

2023-04-13_19-51

(My runtimes are generated dynamically based on input paths, but this can also affect manual configuration setups where people use the same major versions multiple times.)

Ideas or possible solutions

I suggest to add additional output to the runtime selection.

A simple method would be to just show the path after the name. This attribute is required and always present as stated in the configuration guide, and also defined as required in the respective interface RuntimeOption on the eclipse.jdt.ls side.

Possible solution with always showing the path

function(r)
  return r.name .. " (" .. r.path .. ")"
end,

Runtime selection with Telescope UI: 2023-04-13_19-16

Runtime selection with default view: 2023-04-13_19-15

A few more ideas for possible output:

I have pushed the above solution to my fork: https://github.com/jnk22/nvim-jdtls

Is this something you think would be beneficial and could be added?

mfussenegger commented 1 year ago

Implement an additional field like runtime.details, that can show custom infos if present (could be the path, own notes, or whatever - fields would differ from RuntimeOption then though)

Given that these are settings sent to the server, adding additional fields is not an option.

I added the path with https://github.com/mfussenegger/nvim-jdtls/pull/465