Skip to content

Remove TS debug adapter subprocess support#12008

Merged
karthiknadig merged 4 commits into
microsoft:logging-changes-and-drop-old-debuggerfrom
karthiknadig:remove-old-subproc-handler
May 27, 2020
Merged

Remove TS debug adapter subprocess support#12008
karthiknadig merged 4 commits into
microsoft:logging-changes-and-drop-old-debuggerfrom
karthiknadig:remove-old-subproc-handler

Conversation

@karthiknadig
Copy link
Copy Markdown
Member

@karthiknadig karthiknadig commented May 27, 2020

This is now replaced by python debug adapter sub-process handler.

Note: This does support the ptvsd == 4.* version of the subprocess event. The behavior of those is same as debugpy subprocess event. It is left as is, since it is possible that people will have containers with old ptvsd installed. They will get a prompt to update the debugger.

@karthiknadig karthiknadig added the no-changelog No news entry required label May 27, 2020
@karthiknadig karthiknadig marked this pull request as ready for review May 27, 2020 07:41
Copy link
Copy Markdown

@karrtikr karrtikr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise

@karthiknadig karthiknadig force-pushed the remove-old-subproc-handler branch from e3244e6 to 575afa8 Compare May 27, 2020 18:49
@karthiknadig karthiknadig merged commit 89d6361 into microsoft:logging-changes-and-drop-old-debugger May 27, 2020
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Copy Markdown

@ericsnowcurrently ericsnowcurrently left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I left a couple comments about simplified code, but I'll leave those up to you.

Comment on lines 34 to 36

let data: ChildProcessLaunchData | (AttachRequestArguments & DebugConfiguration);
if (event.event === DebuggerEvents.ChildProcessLaunched) {
data = event.body! as ChildProcessLaunchData;
} else if (
let data: AttachRequestArguments & DebugConfiguration;
if (
event.event === DebuggerEvents.PtvsdAttachToSubprocess ||
event.event === DebuggerEvents.DebugpyAttachToSubprocess
) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With a single case we can simplify:

        if (
            event.event !== DebuggerEvents.PtvsdAttachToSubprocess &&
            event.event !== DebuggerEvents.DebugpyAttachToSubprocess
        ) {
            return;
        }
        const data = event.body! as AttachRequestArguments & DebugConfiguration;
        if (Object.keys(data).length > 0) {

Comment on lines +31 to +32
public async attach(data: AttachRequestArguments & DebugConfiguration, parentSession: DebugSession): Promise<void> {
const debugConfig: AttachRequestArguments & DebugConfiguration = data;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public async attach(data: AttachRequestArguments & DebugConfiguration, parentSession: DebugSession): Promise<void> {
const debugConfig: AttachRequestArguments & DebugConfiguration = data;
public async attach(data: AttachRequestArguments & DebugConfiguration, parentSession: DebugSession): Promise<void> {
const debugConfig = data;

or

Suggested change
public async attach(data: AttachRequestArguments & DebugConfiguration, parentSession: DebugSession): Promise<void> {
const debugConfig: AttachRequestArguments & DebugConfiguration = data;
public async attach(debugConfig: AttachRequestArguments & DebugConfiguration, parentSession: DebugSession): Promise<void> {

this.appShell.showErrorMessage(`Failed to launch debugger for child process ${processId}`).then(noop, noop);
}
}
/**
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm loving all this deleted code. 😄

@karthiknadig karthiknadig deleted the remove-old-subproc-handler branch June 9, 2020 17:29
karthiknadig added a commit to karthiknadig/vscode-python that referenced this pull request Jun 17, 2020
* Remove TS debug adapter subprocess support
* Address comments
karthiknadig added a commit to karthiknadig/vscode-python that referenced this pull request Jun 18, 2020
* Remove TS debug adapter subprocess support
* Address comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog No news entry required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants