feat(rust): some more comments

This commit is contained in:
Samuel Cobb 2026-06-03 01:54:01 +01:00
commit fc9950a5bf
2 changed files with 2 additions and 0 deletions

View file

@ -282,6 +282,7 @@ 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

View file

@ -22,6 +22,7 @@ in {
# https://github.com/rust-lang/rust-analyzer/blob/eb5da56d839ae0a9e9f50774fa3eb78eb0964550/docs/dev/lsp-extensions.md?plain=1#L26.
config = mkIf cfg.enable {
# Taken from https://github.com/neovim/nvim-lspconfig/blob/07dff35e7c95288861200b788ef32d6103f107f0/lsp/rust_analyzer.lua
vim.luaConfigRC.rust-util = entryBefore ["lsp-servers"] ''
local function rust_reload_workspace(bufnr)
local clients = vim.lsp.get_clients { bufnr = bufnr, name = 'rust-analyzer' }