Closed Ryex closed 1 month ago
Does this PR follow the [Contribution Guidelines](development guidelines)? Following is a partial checklist:
Proper conventional commit scoping:
If you are adding a new plugin, the scope would be the name of the category it is being added into. ex. feat(utility): added noice.nvim plugin
If you are modifying a pre-existing plugin or pack, the scope would be the name of the plugin folder. ex. fix(noice-nvim): fix LSP handler error
[x] Pull request title has the appropriate conventional commit type and scope where the scope is the name of the pre-existing directory in the project as described above
[x] README
is properly formatted and uses fenced in links with <url>
unless they are inside a [title](url)
[x] Proper usage of opts
table rather than setting things up with the config
function.
📑 Description
merge astrolsp settings in such a way as to preserve the default behavior of loading local project settings from rust-analyzer.json
ℹ Additional Information
The default behavior of rustaceanvim is to load a
rust-analyzer.json
at the project root to load rust-anlyzer settings see: rustaceanvim/config/server.lua#L15 rustaceanvim/config/internal.lua#L287this file can have any of the keys defined in https://rust-analyzer.github.io/manual.html#configuration either at the top level of the json or under a
'rust-analyzer'
top level keyThis is done by having
server.settings
be a function that takes the project root path and the default settings configured atserver.default_settings
and calling rustaceanvim'srustaceanvim.config.server.load_rust_analyzer_settings(root, opts)
function.This change configures rustaceanvim by merging the astrolsp configured opts around a similar function that itself merges the astrolsp configured settings table with the defaults before loading the
rust-analyzer.json
as you can see, it's working as expected