This repository has been archived by the owner on Dec 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial implementation of the tracker
- Loading branch information
1 parent
5ab2a1b
commit c480348
Showing
4 changed files
with
57 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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,39 @@ | ||
import { | ||
DebugAdapterTracker, | ||
DebugAdapterTrackerFactory, | ||
DebugSession, | ||
DebugConsole, | ||
ProviderResult, | ||
} from "vscode"; | ||
import { DebugProtocol } from "vscode-debugprotocol"; | ||
|
||
export class DebugAdapter implements DebugAdapterTracker { | ||
private readonly console: DebugConsole | undefined; | ||
constructor(debugSession: DebugSession) { | ||
this.console = debugSession.configuration.console; | ||
} | ||
onWillStartSession() { | ||
console.log("--debugadapter onWillStartSession"); | ||
} | ||
onWillReceiveMessage(message: any): void { | ||
console.log("--debugadapter onWillReceiveMessage"); | ||
console.log(JSON.stringify(message)); | ||
} | ||
onExit() { | ||
console.log("--debugadapter onExit"); | ||
} | ||
} | ||
|
||
export class DebugAdapterFactory implements DebugAdapterTrackerFactory { | ||
private debugSession: DebugSession; | ||
constructor(debugSession: DebugSession) { | ||
console.log("New debug factory"); | ||
this.debugSession = debugSession; | ||
} | ||
public createDebugAdapterTracker( | ||
session: DebugSession | ||
): ProviderResult<DebugAdapterTracker> { | ||
console.log("It created an adapter tracker"); | ||
return new DebugAdapter(session); | ||
} | ||
} |