zls icon indicating copy to clipboard operation
zls copied to clipboard

Fix builtin-based completions such as with Vectors

Open data-man opened this issue 5 years ago • 6 comments

I wonder why vector definitions isn't exists in std ast. :confused:

data-man avatar May 28 '20 12:05 data-man

They do! Vectors are classified builtins, I believe. Also, they don't have their own builtin anymore, and use @Type(.Vector) now, so we'll have to add support for that.

SuperAuguste avatar May 28 '20 12:05 SuperAuguste

Just grep vector in lib/std/zig :smile:

data-man avatar May 28 '20 12:05 data-man

Oh! You mean the vector type in meta? That should definitely have completion. I guess the only time it shouldn't is when using builtins as at the moment, ZLS doesn't complete the result of builtins.

SuperAuguste avatar May 28 '20 12:05 SuperAuguste

Just checked, std.meta.Vector actually uses builtins to create vectors, and that's why they don't receive completions within ZLS! I'll rename this issue accordingly!

SuperAuguste avatar May 28 '20 12:05 SuperAuguste

And good question on why Vector doesn't exist in std.ast! No builtins exist in std.ast, as they are instead seemingly handled by the non-self-hosted portions of the code generator.

SuperAuguste avatar May 28 '20 12:05 SuperAuguste

arrays is also builtin, but it exist in std.ast.

data-man avatar May 28 '20 12:05 data-man