This repository was archived by the owner on Dec 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Properly disconnect socket io on exit #221
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
c480348
Initial implementation of the tracker
xnkevinnguyen f537d35
Create messaging service class
xnkevinnguyen 10f483a
Update with latest debugger changes
xnkevinnguyen b616a7d
Send stacktrace message from adapter
xnkevinnguyen 0dec72d
Establish connection for debug adapter and webview with the messaging…
xnkevinnguyen 6dbfc9d
Debug adapter sends start and stop message to webview
xnkevinnguyen e58caf6
Remove changes on button component
xnkevinnguyen b6abfd5
Reformatting
xnkevinnguyen 1f977c4
Pause input if on breakpoint
xnkevinnguyen da18aa7
Merge branch 'users/t-xunguy/dap' of https://github.com/microsoft/vsc…
xnkevinnguyen 44daa13
Freeze buttons on svg
xnkevinnguyen 9d3265e
added socket message for python process exit
andreamah c6e535e
Send message to python side on disconnect from vscode server side
xnkevinnguyen 8cc304e
backend confirmation message
andreamah 9fe8287
Confirm disconnect on python side
xnkevinnguyen 0ad646b
Update with dev
xnkevinnguyen d82263b
Lint files
xnkevinnguyen eb417fe
Disconnect frontend after timeout
xnkevinnguyen c8f3b9d
Only disconnect socket io server on exit from port and not on restart
xnkevinnguyen b8d46b8
Merge branch 'dev' into users/t-anmah/debugger-socket-fix
xnkevinnguyen 9e10e08
Format files
xnkevinnguyen 04fb8ff
Merge branch 'users/t-anmah/debugger-socket-fix' of https://github.co…
xnkevinnguyen 34be933
Remove unecessary logs
xnkevinnguyen 5be7f32
Save previous debugger to disconnect
xnkevinnguyen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
import { DebugAdapterTracker, DebugConsole, DebugSession } from "vscode"; | ||
import { DebuggerCommunicationService } from "../service/debuggerCommunicationService"; | ||
import { MessagingService } from "../service/messagingService"; | ||
import { DEBUG_COMMANDS } from "../view/constants"; | ||
|
||
export class DebugAdapter implements DebugAdapterTracker { | ||
private readonly console: DebugConsole | undefined; | ||
private readonly messagingService: MessagingService; | ||
private debugCommunicationService: DebuggerCommunicationService; | ||
constructor( | ||
debugSession: DebugSession, | ||
messagingService: MessagingService | ||
messagingService: MessagingService, | ||
debugCommunicationService: DebuggerCommunicationService | ||
) { | ||
this.console = debugSession.configuration.console; | ||
this.messagingService = messagingService; | ||
this.debugCommunicationService = debugCommunicationService; | ||
} | ||
onWillStartSession() { | ||
// To Implement | ||
|
@@ -24,6 +28,13 @@ export class DebugAdapter implements DebugAdapterTracker { | |
break; | ||
case DEBUG_COMMANDS.STACK_TRACE: | ||
this.messagingService.sendPauseMessage(); | ||
break; | ||
case DEBUG_COMMANDS.DISCONNECT: | ||
// Triggered on stop event for debugger | ||
if (!message.arguments.restart) { | ||
this.debugCommunicationService.handleStopEvent(); | ||
} | ||
break; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could also add a default case which would throw an |
||
} | ||
} | ||
} | ||
|
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { DebuggerCommunicationServer } from "../debuggerCommunicationServer"; | ||
|
||
export class DebuggerCommunicationService { | ||
private currentDebuggerServer?: DebuggerCommunicationServer; | ||
private previousDebuggerServerToDisconnect?: DebuggerCommunicationServer; | ||
|
||
public setCurrentDebuggerServer(debugServer: DebuggerCommunicationServer) { | ||
this.currentDebuggerServer = debugServer; | ||
} | ||
// Used for restart and stop event | ||
public resetCurrentDebuggerServer() { | ||
if (this.currentDebuggerServer) { | ||
this.currentDebuggerServer.closeConnection(); | ||
} | ||
this.previousDebuggerServerToDisconnect = this.currentDebuggerServer; | ||
this.currentDebuggerServer = undefined; | ||
} | ||
public getCurrentDebuggerServer() { | ||
return this.currentDebuggerServer; | ||
} | ||
// Only used for stop event | ||
public handleStopEvent() { | ||
if (this.previousDebuggerServerToDisconnect) { | ||
this.previousDebuggerServerToDisconnect.disconnectFromPort(); | ||
} | ||
} | ||
} |
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
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.
Uh oh!
There was an error while loading. Please reload this page.