Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Show warning if 'program' attribute is used in 'remote' - #2999

Merged
Ramya Rao (ramya-rao-a) merged 3 commits into
microsoft:masterfrom
quoctruong:quoct/show_warning
Mar 24, 2020
Merged

Show warning if 'program' attribute is used in 'remote'#2999
Ramya Rao (ramya-rao-a) merged 3 commits into
microsoft:masterfrom
quoctruong:quoct/show_warning

Conversation

@quoctruong

Copy link
Copy Markdown
Contributor

When using the debugger in remote attach mode, users have to use cwd instead of program. This can be confusing so we should show a warning message.

@ramya-rao-a Ramya Rao (ramya-rao-a) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any idea why the whole file is appearing in the diff?

Comment thread src/goDebugConfiguration.ts Outdated
* Show warningMessage to the user if warningCondition is met.
* If the user chooses not to see the warning again, sets it to the global state.
*/
private showWarning(warningKey: string, warningMessage: string, warningCondition: boolean) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If warningCondition is true, then the entire code path in this method is a no-op. It would be easier to read the code if this condition was checked outside and this function called only if it were true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also would suggest renaming warningKey to ignoreWarningKey

@quoctruong Quoc Truong (quoctruong) left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread src/goDebugConfiguration.ts Outdated
`Request type of 'launch' with mode 'remote' is deprecated, please use request type 'attach' with mode 'remote' instead.`);
}

if (debugConfiguration.request === 'launch' && debugConfiguration['mode'] === 'remote') {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't the request here be attach?

@quoctruong

Copy link
Copy Markdown
Contributor Author

Ramya Rao (@ramya-rao-a) PTAL

@ramya-rao-a
Ramya Rao (ramya-rao-a) merged commit 28bab92 into microsoft:master Mar 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants