zls
                                
                                 zls copied to clipboard
                                
                                    zls copied to clipboard
                            
                            
                            
                        incorrect completions on nested generic type like std.ArrayList
Zig Version
0.12.0-dev.1+155c27f build with -Ddata-version="0.11.0"
Zig Language Server Version
0.12.0-dev.28+81bfc90
Steps to Reproduce
code completion of std.ArrayList is completely broken
Expected Behavior
should give me either x or y of struct Foo
Actual Behavior
Sometimes will EVEN give the wrong complete items
But my 
collected_data_list is ArrayList of ArrayList
P.S.
Other code completion works
The code
const std = @import("std");
pub fn main() !void {
    const allocator = std.heap.page_allocator;
    const Foo = struct {
        x: u8,
        y: u8,
    };
    
    const ArrayList = std.ArrayList;
    const list_of_list = ArrayList(Foo).init(allocator);
    defer list_of_list.deinit();
    list_of_list.
    for (list_of_list.items) |list| {
        _ = list;
        // list.
    }
}
Would you happen to be using Copilot?
Would you happen to be using Copilot?
Yes, I am using Copilot
did you tried latest commit, code completion was not working for me before but right now it does
did you tried latest commit, code completion was not working for me before but right now it does
no, just checkout the latest commit same for me, and I disabled copilot as well
There's nothing wrong w/ Copilot, it's just that I knew ZLS doesn't provide completions for any of those but list_of_list.
(there's https://github.com/zigtools/zls/pull/1373 but it is quite partial and pretty sure doesn't work for any of these)
the latest commit without copilot still gives me the wrong completion items of list_of_list
definition
usage
const std = @import("std");
const Foo = struct {
    a: i32
};
const ListOfListOfFoo = std.ArrayList(std.ArrayList(Foo));
pub fn main() !void {
    var foo_list_of_list: ListOfListOfFoo = undefined;
    for (foo_list_of_list.items) |foo_list| {
        foo_list. // gives me `a`
    }
}
This is caused by #1373 as commenting out the below shows no completion. @Techatrix It happens no matter the level of array list nesting. https://github.com/zigtools/zls/blob/81bfc90d609e688cd7179d6b02921cbd2146d1c7/src/analysis.zig#L1438-L1446
here is a reduction that doesn't use std.ArrayList:
fn Boxed(comptime T: type) type {
    return struct { inner: T };
}
const Some = struct { alpha: u32 };
const boxed_boxed_some: Boxed(Boxed(Some)) = undefined;
const boxed_some = boxed_boxed_some.inner;
const some = boxed_some.inner;
//    ^^^^ hovering here will show 'Boxed(...)' but should be 'Some'