fix: stop server and clean up ports on extension deactivate#19
Merged
TPreece101 merged 1 commit intomainfrom Feb 13, 2026
Merged
fix: stop server and clean up ports on extension deactivate#19TPreece101 merged 1 commit intomainfrom
TPreece101 merged 1 commit intomainfrom
Conversation
When the extension was uninstalled and reinstalled, the old HTTP server kept running on the original port. The new instance would detect the port conflict, fall back to a different port, and VS Code would show a port notification. The root cause was that deactivate() had no reference to the DebugServer instance (it was a local variable inside activate()). - Add module-level refs for the server instance and port cleanup - Push a disposable into context.subscriptions as a safety net - Implement deactivate() to await server.stop() and clean up ports Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #19 +/- ##
==========================================
+ Coverage 74.30% 75.70% +1.39%
==========================================
Files 7 7
Lines 1195 1210 +15
Branches 151 153 +2
==========================================
+ Hits 888 916 +28
+ Misses 306 292 -14
- Partials 1 2 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
deactivate()had no reference to theDebugServerinstance (local variable insideactivate())context.subscriptions, and a properdeactivate()implementationTest plan
npm run compile— no errorsnpm test— all 72 tests pass🤖 Generated with Claude Code