zls icon indicating copy to clipboard operation
zls copied to clipboard

autocompletion and jump to definition don't work for packages with generated files

Open ethernetsellout opened this issue 4 years ago • 1 comments

Using Windows. Ran into this problem using vulkan-zig, which generates a vk.zig file in the zig-cache directory and adds it as a package. Autocompletion/jump to definition does not work at all with this package.

Here's an example of a build script which also causes this problem: https://zigbin.io/bd15a1. Autocompletion/jump to definition work again when hi.zig is moved to the build directory, so zls might be confused about where it is.

ethernetsellout avatar Sep 12 '21 00:09 ethernetsellout

#369 should fix this.

maringuu avatar Sep 13 '21 08:09 maringuu

As the GeneratedFile has its path set in the init instead of the make the provided build.zig now has correct completion provided for the hi package.

However if the GeneratedFile has it's path set in the make function then these will not be resolved as zls does not want to run make functions as they can be arbitrarily complex (currently only std.build.OptionsStep's with no dependencies have their make function run)

leecannon avatar Oct 10 '22 22:10 leecannon