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

failed to translate cimport: error.Timeout #1234

Closed
cactusbento opened this issue Jun 13, 2023 · 2 comments
Closed

failed to translate cimport: error.Timeout #1234

cactusbento opened this issue Jun 13, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@cactusbento
Copy link

Zig Version

0.10.1

Zig Language Server Version

0.11.0-dev.479+c28a59c

Steps to Reproduce

  1. Build zls for 0.10.1 using zig 0.11.0-dev.3395+1e7dcaa3a.
$ git clone https://github.com/zigtools/zls; cd zls
$ ln -sr ~/.local/share/zig/0.11.0-3395/zig zig
$ ./zig build -Ddata_version=0.10.1
  1. import a C header into zig source file
  2. Attempt to get completions
const c = @cImport({
    @cInclude("raylib.h");
});

fn main() !void {
    // No completions provided by zls
    c.SetTarg
}

Expected Behavior

zls generates completions for use in nvim-lspconfig.
Expect completion for c.SetTargetFps(60)

(This works properly with the latest version of zig(0.11.0-3395))

Actual Behavior

zls attempts to generate completions for the C header, but fails with a timeout.

[ERROR][2023-06-13 12:22:56] .../vim/lsp/rpc.lua:734	"rpc"	"/home/cactus/.local/bin/zls"	"stderr"	"error: (translate_c): failed zig translate-c command:\n/usr/bin/zig translate-c --zig-lib-dir /usr/lib/zig --cache-dir /home/cactus/.cache/zls -lc --listen=- -I /usr/local/include -I /usr/include/x86_64-linux-gnu -I /usr/include /home/cactus/.cache/zls/cimport.h\nerror:error.Timeout\n\n"
[ERROR][2023-06-13 12:22:56] .../vim/lsp/rpc.lua:734	"rpc"	"/home/cactus/.local/bin/zls"	"stderr"	"error: (store ): failed to translate cimport: error.Timeout\n"
@cactusbento cactusbento added the bug Something isn't working label Jun 13, 2023
@leecannon
Copy link
Member

leecannon commented Jun 13, 2023

zls master only supports zig master #1020, if you want to use zig 0.10 you need to build zls from the 0.10 tag

the -Ddata_version build option should probably be removed

@cactusbento
Copy link
Author

I see. I'll stick with zls 0.10.0 for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants