treewalker.nvim icon indicating copy to clipboard operation
treewalker.nvim copied to clipboard

Rust fn-where construction seems to break Treewalker constraining down movement to next nodes

Open I-Own-You opened this issue 3 months ago • 3 comments

https://github.com/user-attachments/assets/ae35fbb1-a150-4a50-9553-c097b5642b35

here is the code to reproduce:

struct SocialPost {
    username: String,
    content: String,
    reply: bool,
    repost: bool,
}

trait Summary {}

impl Summary for SocialPost {}

fn some_function<T: std::fmt::Display + Clone, U: Clone + std::fmt::Debug>(t: &T, u: &U) -> i32 {
    2
}

fn some_function2<T, U>(t: &T, u: &U) -> i32
where
    T: std::fmt::Display + Clone,
    U: Clone + std::fmt::Debug,
{
    2
}

fn returns_summarizable() -> impl Summary {
    SocialPost {
        username: String::from("horse_ebooks"),
        content: String::from("of course, as you probably already know, people"),
        reply: false,
        repost: false,
    }
}

fn main() {}

how it should behave

i suppose when i am at fn it should just go to the next node in the same scope without going down to:

  1. where if where is on the next line
  2. { if where is on the same line as fn

I-Own-You avatar Aug 19 '26 11:08 I-Own-You

Fixed - give it a shot now

aaronik avatar Aug 19 '26 15:08 aaronik

its fixed, thank you very much

I-Own-You avatar Aug 19 '26 16:08 I-Own-You

My pleasure! Thank you for the issue, please keep them coming!

aaronik avatar Aug 19 '26 20:08 aaronik