From 94f6df048fbecfdf2f65ab96156b713555df40dc Mon Sep 17 00:00:00 2001 From: iniw Date: Fri, 13 Dec 2024 03:28:09 -0300 Subject: [PATCH] feat(rust): exclude bad directories from rust-analyzer (#5021) ## Description rust-analyzer is unfortunately not smart enough to use a folder's .gitignore (or similar) when looking for rust files to analyze, meaning that when it finds a large enough folder (e.g: .git, .direnv) it completely dies going through it searching for rust files. This commit adds a filter of common folders that are big enough to potentially choke rust-analyzer. The list could be amended in the future. ## Checklist - [X] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/rust.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index eec3ce2d..e5304b56 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -92,6 +92,19 @@ return { ["async-recursion"] = { "async_recursion" }, }, }, + files = { + excludeDirs = { + ".direnv", + ".git", + ".github", + ".gitlab", + "bin", + "node_modules", + "target", + "venv", + ".venv", + }, + }, }, }, },