Closed GopherJ closed 3 years ago
Do you have rust-analyzer.lens.methodReferences
disabled?
@lnicola how should I disable this one in coc-rust-analyzer? I'd like to try
Ok I understood what do you mean, actually I still want tto keep method reference in other places but remove it from the list of code lens run
In Code all three lenses items (Run, Debug, references) are clickable and have an associated action. I guess we could do one or both of:
main
I prefer the first one
I also think the first one is a better idea, when a function has no references seeing the 0 references
still gives the user the information that that function isn't referenced.
So we have to filter out the main function here https://github.com/rust-analyzer/rust-analyzer/blob/70fe7a4515ebdc6222a6565cd4cd1c5fd0c77350/crates/ide/src/annotations.rs#L143-L151, that is if the function is called "main" and defined inside the root module.
What if we are calling the main function though?
@flodiebold which case will we call main function?
When it's recursive, for example. That's disallowed in C, but not in Rust AFAIK.
Or in no_std
/ no_main
code.
It just doesn't seem worth special-casing to me. I wouldn't expect the fact that main
is the entry point to have an effect on the "X references", just like for some function exported from a library.
Yeah, I don't see this warranting a special case.
hi, I still have this while calling codelens run:
is it possible to remove it?