simrat39 / rust-tools.nvim

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

proc macro not expanded: Proc macros are disabled #389

Open christopher-wilke opened 1 year ago

christopher-wilke commented 1 year ago

I see a warning when running [tokio::main]:

proc macro "main" not expanded: Proc macros are disabled.

Is there any way to disable this warning?

0xDmtri commented 1 year ago

yeah same, this happens if i go to definition and it opens some other dep of the project, it starts building all the stuff and then I get this everywhere too. Super annpying

qdrs commented 1 year ago

Yes I have this exact same problem, the macro expansion still works though even after it mentions this error...

52funny commented 1 year ago

I also have this problem. I use the original lsp-config without using rust-tools to solve this problem well, and it is faster than rust-tools.

0xDmtri commented 1 year ago

I also have this problem. I use the original lsp-config without using rust-tools to solve this problem well, and it is faster than rust-tools.

Do u have inlay hinting there too? If yes, would you mind sharing this part of your config please! Cheers!

52funny commented 1 year ago

I also have this problem. I use the original lsp-config without using rust-tools to solve this problem well, and it is faster than rust-tools.

Do u have inlay hinting there too? If yes, would you mind sharing this part of your config please! Cheers!

You can refer to this:reddit

This post says that Native LSP Inlay Hint is already supported in the Nightly version of neovim.

simrat39 commented 1 year ago

Is there any way I can reproduce this?

0xDmtri commented 1 year ago

Is there any way I can reproduce this?

yes ser, all u need to do is to open some rust project, for example, something that uses tokio::spawn(), and then do "go to definition" on "spawn()" method or any other method u r using from an external crate. Rust analyzer will start fetching everything and then it will produce this warning. The warning will stay until u restart the lsp and u will see this warning even in the original code from where you jumped from.

aqrln commented 11 months ago

I'm not sure about the exact steps to reproduce but it happens pretty often to me. Any proc macro can trigger this, not necessarily tokio::main. LspRestart doesn't always help when that happens, only restarting neovim reliably does.