mark-wiemer-org/ahkpp

Extension hangs and prevents other extensions from running

Closed this issue · 9 comments

Description

I have been noticing that the Intellisense feature has been very spotty after installing the new pre-release version of ahk++.
This issue is happening even with the stable release version.

Sometimes I get no suggestions, even when I press Ctrl+Space. Restarting Code.exe not always helps.
I have found that switching to another lexer like HTML or CSV sometimes fixes the issue.

Reproduction steps

Even though this might happen at random times it usually happens when I start vscode with a new ahk file open.

Expected behavior

No error should occur.

Additional context

This bug might be related to #65

I have noticed that sometimes I get the following notification with the newest version of ahk++:
image

After some troubleshooting I found that we can see the extension as unresponsive:
image

And some valuable information can be seen in the window log:

[2022-07-31 11:43:25.841] [renderer1] [warning] {}
[2022-07-31 11:52:23.769] [renderer1] [info] UNRESPONSIVE extension host: starting to profile NOW
[2022-07-31 11:52:28.855] [renderer1] [warning] UNRESPONSIVE extension host: 'mark-wiemer.vscode-autohotkey-plus-plus' took 99% of 6544.599ms, saved PROFILE here: 'file:///c%3A/Users/RaptorX/AppData/Local/Temp/exthost-e537b6.cpuprofile' [{"id":"gc","total":77637,"percentage":1},{"id":"mark-wiemer.vscode-autohotkey-plus-plus","total":6465380,"percentage":99},{"id":"program","total":149,"percentage":0},{"id":"self","total":1233,"percentage":0}]

Here you can find the file in question:
exthost-e537b6.zip

This can happen multiple times in a session.

Thanks for reporting this. I'll definitely fix this before we move to the stable release :)

Hey @RaptorX , are you by chance working on a large repo that you can share with me? I'm seeing the issue is with this line of code:

https://github.com/mark-wiemer/vscode-autohotkey-plus-plus/blob/1cdf6c46f1cee178eaf1442cb5be293985bd1e24/src/parser/parser.ts#L19

It reads all files in the build directory, so if it's a large directory it could take a while. I'm not able to reproduce the issue on the projects I have :/

Additionally, this logic shouldn't have changed much since 2.8.4. Can you confirm you're only seeing this issue with 2.8.5?

Most of my repos are not that large, that's the reason I was surprised by this.
I will have to try again since I updated VSCode and I havent experienced any other similar issues.

I will give it some testing and let you know.

Hey @RaptorX, I'm curious if you're having this issue with the latest version of AutoHotkey Plus as well. Knowing how frequently it happens would help me prioritize. I initially thought this would be an easy task to debug but of course it's never as simple as it seems :( I still haven't been able to repro the issue.

This issue is extremely intermittent. It is not happening recently, but just comes back from time to time

But maybe it is related to another extension.

zero-plusplus/vscode-autohotkey-debug#242 (comment)

In that other thread we are discussing an unrelated issue, but the only common thing that Thomas Khan and I have in common is that we both have the same extensions for autohotkey.

I am using Autohotkey v2 Language Support and Autohotkey Debug beside your script.

So there might be some overlapping functions going on.

OK, that's good to know. I think we're going to go ahead and release without addressing this bug, as I'm still unable to reproduce it. Plus, it looks like when it does happen, restarting VS Code is able to mitigate the issue?

OK, that's good to know. I think we're going to go ahead and release without addressing this bug, as I'm still unable to reproduce it. Plus, it looks like when it does happen, restarting VS Code is able to mitigate the issue?

When it was happening, no. Restarting VSCode didnt fix the issue. Thats the reason why I suspect is more of a conflict with another extension more than anything and I really suspect is the Autohotkey V2 language support one.

OK, thanks for the update. Let me look into this one a bit further. If you're ever able to repro, I'd greatly appreciate if you could post the list of active extensions and the folder you were trying to open. Additionally, once you repro, you could try disabling other extensions to see if they might be the cause. There is a great extension bisect built in to VS Code that you can try to isolate the problem.

For now, I'm going to close this as "cannot reproduce", but I'm happy to re-open if you're able to provide additional details. Just @mark-wiemer so I'll be sure to see it :)