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

Infinite loops break extension #169

Open
Dieff opened this issue Sep 27, 2023 · 1 comment
Open

Infinite loops break extension #169

Dieff opened this issue Sep 27, 2023 · 1 comment

Comments

@Dieff
Copy link

Dieff commented Sep 27, 2023

I wrote a buggy recursive function which executed forever. When I ran it in the repl, it caused the entire extension to become unresponsive. I couldn't interact with the repl, couldn't kill any threads, and couldn't restart the LSP. I ended up using "Developer: Reload Window" to recover. Obviously, I will try to do less looping in the future, but I was wondering if there is a way to recover from this situation, or one should be added. Some ways I could think of:

  • Add a "Restart LSP" command to Alive
  • Add a maximum execution time for code running in the repl. This could probably be a setting.
@nobody-famous
Copy link
Owner

Reload Window is the standard way to restart an LSP in VSCode. It makes sure the client reconnects, anything cached doesn't get out of sync, etc.

I can try adding a time limit, but I'm not sure how well it'll work. The timer thread would still need to run and try to kill the offending thread, which might not behave very well given the CPU is maxed out.

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

2 participants