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

codegen: InputOutput Error #2152

Closed
jcalabro opened this issue Jan 27, 2025 · 7 comments
Closed

codegen: InputOutput Error #2152

jcalabro opened this issue Jan 27, 2025 · 7 comments
Labels
bug Something isn't working

Comments

@jcalabro
Copy link

jcalabro commented Jan 27, 2025

Zig Version

0.14.0-dev.2577+271452d22

ZLS Version

0.14.0-dev (specifically 9fc45ca)

Client / Code Editor / Extensions

helix 25.1

Steps to Reproduce and Observed Behavior

Hi all, I'm getting an error unable to codegen: InputOutput on this line of the debugger. This just started happening the other day because I ran 0.13.0 for a long time, and just upgraded both zig and zls.

Not 100% if this is a zig or a zls bug, but the program builds and runs just fine, and countNumberOfDigits isn't dead code; it's used all over this file.

Expected Behavior

I expect zls to be able to handle the linked zig file and give me appropriate suggestions without giving me warnings or errors.

Relevant log output

2025-01-26T18:59:14.142 helix_view::document [ERROR] Formatter error: <stdin>:98:10: error: expected '=', found '('

2025-01-26T18:59:17.026 helix_view::document [ERROR] Formatter error: <stdin>:97:10: error: expected '=', found '('

2025-01-26T19:00:06.410 helix_lsp::transport [ERROR] zls err: <- StreamClosed
2025-01-26T19:12:44.862 helix_view::document [ERROR] Formatter error: <stdin>:2428:17: error: expected ';' after statement

2025-01-26T19:19:03.492 helix_view::document [ERROR] Formatter error: <stdin>:2416:49: error: expected '}', found ')'
@jcalabro jcalabro added the bug Something isn't working label Jan 27, 2025
@Techatrix
Copy link
Member

You did not include the zig file you are refering to. Make sure that your issue includes all the necessary information to reproduce the observed behaviour.

@jcalabro
Copy link
Author

@Techatrix
Copy link
Member

Techatrix commented Jan 27, 2025

Could you elaborate further? Your issue description is a mystery to me. Where are you seeing this error? What exactly are you doing to get this error? How is this related to the countNumberOfDigit function?

@jcalabro
Copy link
Author

All I did was open that file in helix. The reason I pointed that function out is that it was the one that was erroring with the message unable to codegen: InputOutput on the line of the function definition of countNumberOfDigits. Not sure I can elaborate further.

However, I just tried to repro and I can't so I guess we should close.

@Techatrix
Copy link
Member

Oh so you are getting that error displayed as a diagnostic in your editor. This is what I was wondering about. The source of such an error would most likely be Build On Save. Did you enable this feature by chance?

@jcalabro
Copy link
Author

I did enable that at some point, yes! https://github.com/jcalabro/dotfiles/blob/main/fedora/zls.json

This only started happening the other day after updating from zig 0.13.0 -> 0.14.0-dev.2577+271452d22

Still not sure how to repro though...tried from multiple machines but couldn't get it to crop back up

@jcalabro
Copy link
Author

Probably a zig compiler issue rather than zls. I just got a zig build error when invoking the compiler (not zls):

src/safe.zig:109:5: error: unable to codegen: InputOutput
pub fn copySlice(comptime T: type, alloc: Allocator, src: []const T) Allocator.Error![]T {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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