1

I'm using rust-analyzer 0.3.193-nightly with VSCode 1.45.1, Windows 10 x64.

On a struct, when I type ::, I'd like to see the static methods only. Non-static methods are also showing up in suggestion list.

I the example below, I would not like to see calc_num appear in suggestions, since it's a non-static method:

VSCode editor showing suggestions

Is there a way to hide calc_num from the suggestions, in the example above? I searched rust-analyzer options and I found nothing.

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
rodrigocfd
  • 6,450
  • 6
  • 34
  • 68
  • You may or may not be aware, but methods _are_ associated functions (Rust doesn't use the term "static" for these). That means you can do things like `.map(Foo::calc_num)` – Shepmaster Jun 03 '20 at 12:36
  • @Shepmaster I'm aware that method *are* associated functions in Rust. Actually, RLS with VSCode does exactly what I'm trying here. I'm trying to move away from RLS because it's really buggy. – rodrigocfd Jun 03 '20 at 12:49
  • 2
    Amusingly, I'd say that it not showing the methods is one of the bugs! – Shepmaster Jun 03 '20 at 12:55
  • @Shepmaster You made me laugh really loud on this one. Do you recommend me using rust-analyzer over RLS? – rodrigocfd Jun 03 '20 at 13:04
  • 1
    I think that rust-analyzer is better in almost all ways than RLS, yes. I think your request is a reasonable one, as it's a matter of how useful the autocomplete set is to you. – Shepmaster Jun 03 '20 at 13:12
  • @Shepmaster Thank you. I just [opened an issue](https://github.com/rust-analyzer/rust-analyzer/issues/4731) in rust-analyzer repo. – rodrigocfd Jun 03 '20 at 13:27

0 Answers0