Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account for unwanted messages appearing in output #15115

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions src/interactive-window/debugger/interactiveWindowDebugger.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,19 +291,23 @@ export class InteractiveWindowDebugger implements IInteractiveWindowDebugger {

// Pull our connection info out from the cells returned by enable_attach
if (outputs.length > 0) {
let enableAttachString = getPlainTextOrStreamOutput(outputs);
if (enableAttachString) {
enableAttachString = trimQuotes(enableAttachString);

// Important: This regex matches the format of the string returned from enable_attach. When
// doing enable_attach remotely, make sure to print out a string in the format ('host', port)
const debugInfoRegEx = /\('(.*?)', ([0-9]*)\)/;
const debugInfoMatch = debugInfoRegEx.exec(enableAttachString);
if (debugInfoMatch) {
return {
port: parseInt(debugInfoMatch[2], 10),
host: debugInfoMatch[1]
};
// Debugger can log warning messages, we need to exclude those.
// Simplest is to test each output.
for (const output of outputs) {
let enableAttachString = getPlainTextOrStreamOutput([output]);
if (enableAttachString) {
enableAttachString = trimQuotes(enableAttachString);

// Important: This regex matches the format of the string returned from enable_attach. When
// doing enable_attach remotely, make sure to print out a string in the format ('host', port)
const debugInfoRegEx = /\('(.*?)', ([0-9]*)\)/;
const debugInfoMatch = debugInfoRegEx.exec(enableAttachString);
if (debugInfoMatch) {
return {
port: parseInt(debugInfoMatch[2], 10),
host: debugInfoMatch[1]
};
}
}
}
}
Expand Down
Loading