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

Debugging on Windows Does Not Work with MSVC Installed #54

Closed
Elephant1214 opened this issue Jul 16, 2024 · 13 comments
Closed

Debugging on Windows Does Not Work with MSVC Installed #54

Elephant1214 opened this issue Jul 16, 2024 · 13 comments

Comments

@Elephant1214
Copy link

Elephant1214 commented Jul 16, 2024

I recently installed ZigBrains and noticed that completion did not work for external libraries. When I looked around for answers, I saw the instructions for setting up the debugger, but I already had MSVC installed. There's no option to set a path to it and the download button does nothing and the "Download and update the debugger automatically" button just bricks the IDE when I open a Zig project. I am using IntelliJ IDEA Ultimate 2024.1.4 and ZigBrains 15.2.0-241.

@Elephant1214
Copy link
Author

Elephant1214 commented Jul 16, 2024

A more detailed description of what is happening is in the latest comments on #37

@FalsePattern
Copy link
Owner

The server endpoint that ZigBrains was trying to fetch the debugger metadata from was not functioning correctly, the downloading should be fixed now.

@FalsePattern
Copy link
Owner

I'll also add a fallback system to 16.0.0 so that it still works even if that server is down

@Elephant1214
Copy link
Author

Updated to the latest 2024.1.* beta and now the update button works, but I can't open zig files at all.

@FalsePattern
Copy link
Owner

FalsePattern commented Jul 19, 2024

Updated to the latest 2024.1.* beta and now the update button works, but I can't open zig files at all.

you can try installing the nightly version of ZigBrains by:

  1. Adding the zigbrains updater URL to your custom plugin repositories (see: https://github.com/FalsePattern/ZigBrains?tab=readme-ov-file#installing)
  2. Adding the lsp4ij nightlies updater URL to your custom plugin repositories(same way, URL: https://plugins.jetbrains.com/plugins/nightly/23257)
  3. Restart the IDE, and you should be able to download ZB 16.0.0-pre2

@Elephant1214
Copy link
Author

I already had 16.0.0-pre2-241, I updated LSP4IJ to 0.3.0-20240718-013045. The ZLS status icon is missing no matter what I do and ZLS appears to work occasionally.

@FalsePattern
Copy link
Owner

The ZLS status icon is no longer a thing, the language server connection is now managed by LSP4IJ in ZigBrains 16.0.0:
https://github.com/redhat-developer/lsp4ij

@FalsePattern
Copy link
Owner

Is MSVC debugging still not working in the latest 16.x releases?

@Elephant1214
Copy link
Author

No, it's not. It sometimes freezes, which is fine, but it still can't find anything from external libraries and can sometimes take a while to update things like errors.

@mattrudder
Copy link

mattrudder commented Jul 31, 2024

Came to post about a similar issue, not sure if this is exactly what OP is seeing though...

I've been using the plugin on Windows including debugging for about a week straight very consistently (great work!), but last night I started seeing hangs when launching the debugger, with the following in the Notifications timeline in version 16.1.2-242:

Debugger metadata downloading failed
Debugger fallback metadata fetch failed

Looking through the code for the error, it seems like the plugin is likely timing out trying to download the debugger metadata from https://falsepattern.com/zigbrains/msvc.properties, which is currently returning 504 Gateway Timeout errors. FWIW, I have the "Download and update the debugger automatically" option disabled,with "Use Clion toolchains instead" selected, so its not clear why the plugin is attempting to download anything. Seems like it's effectively doing a version check on each launch, is that accurate?

IMO, it would be a nice feature to have an opt-out or override to only rely on the local filesystem / embedded resources. The download request currently takes about a minute by default to timeout before the current fallback code executes, which for some reason doesn't appear to be working either in my version.

I'd be interested to figure out how to contribute this myself if it's welcome, but I've got a bit of a learning curve before I could be productive in the codebase I think. 😅

As a workaround, I've lowered the HTTP timeout thresholds for IntelliJ via Help > Edit Custom VM Options... to make the hang a little less impactful until there's an alternative:

-Didea.connection.timeout=1000
-Didea.read.timeout=1000

@FalsePattern
Copy link
Owner

FalsePattern commented Jul 31, 2024

I'll add an override for the version check in the next update (and decrease the timeout too), sorry about the inconvenience.
The hosting provider I use for my website seems to be having issues lately.

@FalsePattern
Copy link
Owner

It should be fixed properly in 16.1.3. I've added the metadata download consent prompt, and I also made it cache the metadata, so it will only download it once per IDE launch.

The fallback metadata parsing has also been fixed, i accidentally had a typo in the resource path.

@mattrudder
Copy link

Incredible, thanks for the quick action on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants