mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-06-10 15:10:04 +00:00
feat(rust): add assertion and comment on configuration
This commit is contained in:
parent
ac5827a619
commit
ad13549beb
2 changed files with 9 additions and 6 deletions
|
|
@ -74,7 +74,8 @@ isMaximal: {
|
|||
typst.enable = isMaximal;
|
||||
rust = {
|
||||
enable = isMaximal;
|
||||
extensions.rustaceanvim.enable = isMaximal;
|
||||
# Can only be enabled if lsp.enable = false
|
||||
extensions.rustaceanvim.enable = false;
|
||||
extensions.crates-nvim.enable = isMaximal;
|
||||
};
|
||||
toml.enable = isMaximal;
|
||||
|
|
|
|||
|
|
@ -282,11 +282,6 @@ in {
|
|||
|
||||
(mkIf cfg.extensions.rustaceanvim.enable {
|
||||
vim = {
|
||||
# TODO: Determine if mkForce is the best thing here, and if we should consider a warning instead? Or use priority settings.
|
||||
lsp.servers.rust-analyzer.enable = lib.mkForce false;
|
||||
lsp.servers.rust-analyzer.root_dir = lib.mkForce null; # let rustaceanvim determine root
|
||||
lsp.servers.rust-analyzer.on_attach = lib.mkForce null; # let rustaceanvim determine attach funcs
|
||||
|
||||
startPlugins = ["rustaceanvim"];
|
||||
pluginRC.rustaceanvim = entryAfter ["lsp-setup"] ''
|
||||
vim.g.rustaceanvim = function()
|
||||
|
|
@ -294,6 +289,13 @@ in {
|
|||
end
|
||||
'';
|
||||
};
|
||||
|
||||
assertions = [
|
||||
{
|
||||
assertion = !cfg.lsp.enable;
|
||||
message = "rustaceanvim and vim.languages.rust.lsp.enable are mutually exclusive. Please ensure `vim.lsp.rust-analyzer.enable` is false, or disable `vim.languages.rust.lsp.enable`.";
|
||||
}
|
||||
];
|
||||
})
|
||||
|
||||
(mkIf cfg.extensions.crates-nvim.enable {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue