simrat39 / rust-tools.nvim

Tools for better development in rust using neovim's builtin lsp
MIT License
2.16k stars 158 forks source link

Support for .vscode/settings.json #215

Open jrmoulton opened 2 years ago

jrmoulton commented 2 years ago

On several projects that I work on rust analyzer is configured to work using a vscode settings.json file in order to set project settings that without them renders rust analyzer basically useless. Is there any support/ any way to read in those project settings and set the rust analyzer settings?

An example project

simrat39 commented 2 years ago

Shouldn't be too hard to add support for with workspace/configurationChange or whatever it's called, the real hard part would be parsing the json, but yeah you're right its definitely a useful feature

jrmoulton commented 2 years ago

Cool. I can work on implementing it. Would I just parse the json and then pass that in to the RA with the other server configs?

https://github.com/simrat39/rust-tools.nvim/blob/11dcd674781ba68a951ab4c7b740553cae8fe671/lua/rust-tools.lua#L150-L152 Would I just extend this with the parsed json?

simrat39 commented 2 years ago

hmm not sure, would definitely want a way to update the settings without restarting neovim so an autocmd + parse the json then send a workspace/didChangeConfiguration

Miaxos commented 2 years ago

Really interested as well

Samyak2 commented 2 years ago

FWIW I was able to workaround the lack of this by using tamago324/nlsp-settings.nvim: