simrat39 / rust-tools.nvim

Tools for better development in rust using neovim's builtin lsp
MIT License
2.17k stars 158 forks source link

Do not use ftplugin folder #286

Open anstadnik opened 1 year ago

anstadnik commented 1 year ago

I suggest setting everything that is set in ftplugin/rust somewhere else instead. My personal use-case is that I sometimes set a custom ft for certain files. Then, LSP lazy-loads. Then, rust-tools lazy-loads. When ftplugin folder is detected, I assume that nvim decides to re-evaluate ft for my file, and it resets. I'm not sure why it happens, but nevertheless, if I remove ftplugin folder from rust-tools repo, the issue perishes. I suggest that, since the plugin is designed to work with rust only, suggest users to load it lazily with LSP, or load only for rust filetype, and do not use filetype folder.

rockerBOO commented 1 year ago

Try using the nvim/after/ftplugin to work around this. Will execute after all the plugins are set up.