Fix duplicate server handlers on concurrent restarts#259
Merged
Conversation
… handling Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix multiple LSP server handlers registration issues
Fix multiple LSP server handlers from concurrent restarts
Feb 25, 2026
…cel timer and handle stop errors Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
Copilot
AI
changed the title
Fix multiple LSP server handlers from concurrent restarts
Fix duplicate LSP server handlers from concurrent and post-deactivate restarts
Feb 25, 2026
…PR pattern Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
Copilot
AI
changed the title
Fix duplicate LSP server handlers from concurrent and post-deactivate restarts
Fix concurrent restart race and unsafe shutdown in extension lifecycle
Feb 25, 2026
…bling the server Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
Copilot
AI
changed the title
Fix concurrent restart race and unsafe shutdown in extension lifecycle
Add Feb 25, 2026
getServerEnabled support and remove unnecessary restart timer
…opped concurrent restarts Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
Copilot
AI
changed the title
Add
Add Feb 25, 2026
getServerEnabled support and remove unnecessary restart timergetServerEnabled setting and debounce concurrent server restarts
… restartServer regardless of lsClient Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
Copilot
AI
changed the title
Add
Prevent duplicate server handlers and dropped restart requests
Feb 25, 2026
getServerEnabled setting and debounce concurrent server restartsCo-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
Copilot
AI
changed the title
Prevent duplicate server handlers and dropped restart requests
Fix duplicate server handlers on concurrent restarts; deduplicate stop logic via Feb 25, 2026
deactivate()
deactivate()Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
Copilot
AI
changed the title
Fix duplicate server handlers on concurrent restarts
Revert: restore original inline stop block in runServer()
Feb 25, 2026
rchiodo
approved these changes
Feb 25, 2026
connor4312
approved these changes
Feb 25, 2026
github-actions bot
pushed a commit
to microsoft/vscode-flake8
that referenced
this pull request
Feb 25, 2026
- Move _disposables cleanup outside lsClient guard in restartServer() so disposables are always released, even when no previous client existed. - Wrap lsClient.stop() in deactivate() with try/catch to prevent unhandled rejections during extension deactivation. Source: microsoft/vscode-python-tools-extension-template#259 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
github-actions bot
pushed a commit
to microsoft/vscode-black-formatter
that referenced
this pull request
Feb 25, 2026
- Move _disposables cleanup outside the if(oldLsClient) block in restartServer() so disposables are always cleared even when no prior client exists - Wrap lsClient.stop() in deactivate() with try/catch to handle errors gracefully Upstream: microsoft/vscode-python-tools-extension-template#259 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
github-actions bot
pushed a commit
to microsoft/vscode-mypy
that referenced
this pull request
Feb 26, 2026
- Move _disposables cleanup outside the if(oldLsClient) block in restartServer() so disposables are always cleaned up even if the old client is undefined - Add try/catch around lsClient.stop() in deactivate() to prevent unhandled exceptions during extension deactivation Source: microsoft/vscode-python-tools-extension-template#259 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
edvilme
added a commit
to microsoft/vscode-mypy
that referenced
this pull request
Feb 26, 2026
…rts (#442) - Move _disposables cleanup outside the if(oldLsClient) block in restartServer() so disposables are always cleaned up even if the old client is undefined - Add try/catch around lsClient.stop() in deactivate() to prevent unhandled exceptions during extension deactivation Source: microsoft/vscode-python-tools-extension-template#259 Co-authored-by: Copilot <copilot@github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
github-actions bot
pushed a commit
to microsoft/vscode-isort
that referenced
this pull request
Feb 26, 2026
- Move _disposables cleanup outside the if(oldLsClient) block in restartServer() so disposables are always cleared, not just when a previous client exists. - Add try/catch around lsClient.stop() in deactivate() to prevent unhandled rejections if the server stop fails during extension deactivation. Source: microsoft/vscode-python-tools-extension-template#259 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous change replaced the inline client-stop logic in
runServer()with a call todeactivate(), introducing a subtle behavioural difference:deactivate()does not null outlsClient, requiring an extralsClient = undefinedafter the call and splitting the cleanup across two statements. The revert restores the original self-contained inline block, which is clearer and keeps thelsClientlifecycle management in one place.Changes
src/extension.ts— Restored the original inlinelsClient.stop()block inside the!getServerEnabledbranch ofrunServer(), replacing thedeactivate()delegation introduced in the prior commit.Original prompt
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.