Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL analyzer works better then normal windows #18634

Open
I-ABD-I opened this issue Dec 7, 2024 · 0 comments
Open

WSL analyzer works better then normal windows #18634

I-ABD-I opened this issue Dec 7, 2024 · 0 comments
Labels
C-support Category: support questions

Comments

@I-ABD-I
Copy link

I-ABD-I commented Dec 7, 2024

The last few days i have been doing aoc and i noticed that the type inference on windows is "shitty" in respect to WSL
for example this code snippet

fn to_2d_array(input: &str) -> Vec<Vec<char>> {
    input
        .lines() // Split the string by '\n' into an iterator of &str
        .map(|line| line.chars().collect()) // Convert each line into a Vec<char>
        .collect() // Collect into a Vec<Vec<char>>
}

fn stage1(input: &str) -> i32 {
    let arr = to_2d_array(input);

    let mut count = 0;

    for (i, line) in arr.iter().enumerate() {
        for (j, c) in line.iter().enumerate() {  
        // ...
        }
    }
}

when viewing on VS Code running on windows, rust analyzer does not recognize the types for line and for c
but when i opened the same workspace on WSL suddenly it does know those same types. thats just one example i encountered.

---------------------------------------- ON WINDOWS ----------------------------------------
Image
Image

---------------------------------------- ON WSL ----------------------------------------
Image

is there a fix for this, or is this just a bug?

@I-ABD-I I-ABD-I added the C-support Category: support questions label Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-support Category: support questions
Projects
None yet
Development

No branches or pull requests

1 participant