this post was submitted on 27 Jun 2024
54 points (100.0% liked)

Rust

111 readers
7 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 1 year ago
MODERATORS
 

Rust Rover is out of preview and is free for non-commercial use. The only caveat is:

It’s also important to note that if you’re using a non-commercial license, you cannot opt out of the collection of anonymous usage statistics.

you are viewing a single comment's thread
view the rest of the comments
[–] sukhmel@programming.dev 5 points 4 months ago (1 children)

I use it and it's okay but man, how long could it take them to separate search results in tests from not in tests.

Last time I think I found a similar issue for vscode or rust-analyzer, and the devs said it requires a lot of rework and will not be done for a while. Now I can't find that but maybe it is a task that is harder than it looks. It would've been a total killer feature for me, though

[–] FizzyOrange@programming.dev 2 points 4 months ago (1 children)

Ugh yeah that's infuriating on Github search too. Obviously if I'm searching for some identifier I don't want 10 pages of results in /tests.

How hard can it be? Just weight anything with test in the file path lower than everything else. Job done.

[–] BB_C@programming.dev 1 points 4 months ago (1 children)

You two bring shame to the programming community.
Just ripgrep cargo expanded output for f**** sake.

[–] FizzyOrange@programming.dev 1 points 4 months ago (1 children)
[–] BB_C@programming.dev 1 points 4 months ago (1 children)

What part are you struggling with?
The ripgrep (rg) part, or the cargo expand part?

[–] FizzyOrange@programming.dev 1 points 4 months ago (1 children)

I know what both of those are and how to use them. But they are entirely relevant to the thread. Did you comment in the wrong place?

[–] BB_C@programming.dev 2 points 4 months ago (1 children)

Not sure how what I write is this confusing to you.

  • Tests don't necessarily live in paths containing test.
  • Code in paths containing test is not necessarily all tests.
  • cargo expand gives you options for correctly and coherently expanding Rust code, and doesn't expand tests by default.
  • rg was half a joke since it's Rust's grep. You can just pipe cargo expand [OPTIONS] [ITEM] output to vim '+set ft=rust' - or bat --filename t.rs and search from there.
[–] FizzyOrange@programming.dev 1 points 4 months ago (1 children)

Ok cool but how does that help when I'm searching a non-Rust project via the GitHub web search interface? I don't know why I'd want to search cargo expand output anyway. Using that just to avoid searching tests is a super ugly hack.

[–] BB_C@programming.dev 1 points 4 months ago

how does that help when I’m searching a non-Rust project via the GitHub web search interface

Fair.
But you are writing a comment under a topic regarding a Rust-flavored IDE, posted to a Rust community. With neither the IDE nor Rust involved, your quoted problem statement is 100% off-topic.