sublimelsp / LSP-julia

Julia support for Sublime's LSP plugin using LanguageServer.jl
MIT License
23 stars 1 forks source link

Better project naming and handling of subprojects #31

Open ghyatzo opened 4 months ago

ghyatzo commented 4 months ago

stemming from the discussion in #30 here is the idea for reference:

So I think one approach would be to read the (Julia)Project.toml file, and if it has a name field, then append .jl to name and use that in the status bar. Otherwise append the directory name of the sub-environment (here test) to the name of the parent environment. That would give for example

A.jl for path A B.jl for path A/B (this would be different to your example) B.jl/test for path A/B/test

If there is no name field in Project.toml, but also there isn't a parent environment, then use only the directory name as a fallback.

jwortmann commented 3 months ago

I pushed some improvements in https://github.com/sublimelsp/LSP-julia/commit/325d8147e324fc50e4e220358b04e37a6c61122d and tested it with a few examples. I think it should work now as it is described above.

Manual testing probably requires to run "Package Control: Satisfy Libraries" for now, but this should happen automatically when the next release of the LSP-julia package is made and it gets updated by Package Control.

ghyatzo commented 3 months ago

Great addition Thanks! By the way, wouldn't it make sense to use the same naming logic for the names in the environment selection palette as well? the toml part can most probably just be bolted on the code from my PR.