AstroNvim / astrocommunity

A community repository of common plugin specifications
GNU General Public License v3.0
1.04k stars 214 forks source link

fix(rust): preserve loading of rust-analyzer.json #977

Closed Ryex closed 1 month ago

Ryex commented 1 month ago

📑 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#L287

this 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 key

This is done by having server.settings be a function that takes the project root path and the default settings configured at server.default_settings and calling rustaceanvim's rustaceanvim.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

image

as you can see, it's working as expected

github-actions[bot] commented 1 month ago

Review Checklist

Does this PR follow the [Contribution Guidelines](development guidelines)? Following is a partial checklist:

Proper conventional commit scoping: