Skip to content

Do not set breakpoint on non-PowerShell files #575

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

Conversation

rkeithhill
Copy link
Contributor

@rkeithhill rkeithhill commented Nov 6, 2017

Fix #574

There's still an associated but separate bug when a user is attempting to start debug on the current file when the active window is a Git diff window. I opened an issue on vscode-debugadpter-node project: microsoft/vscode-debugadapter-node#134

@@ -490,7 +490,12 @@ protected void Stop()
// VSCode sends breakpoint requests with the original filename that doesn't exist anymore.
try
{
scriptFile = editorSession.Workspace.GetFile(setBreakpointsParams.Source.Path);
// When you set a breakpoint in the right pane of a Git diff window on a PS1 file,
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we're checking for this prefix in another place, maybe it's time to pull this out into a helper method?

@rkeithhill
Copy link
Contributor Author

Good idea. Any suggestions on where this centralized check should be?

@rkeithhill
Copy link
Contributor Author

BTW I'm pretty sure the test errors are because we set line breakpoints in tests with a filename of "". That should be easy for me to fix.

@daviwil
Copy link
Contributor

daviwil commented Nov 8, 2017

I think you could add a static method to ScriptFile for that. Ouch, we shouldn't be sending empty strings for paths in those tests...

@rkeithhill
Copy link
Contributor Author

rkeithhill commented Nov 8, 2017

Yeah, that was probably me ... those chickens have come home to roost. :-/ I will try to finish this PR up tonight - add that static method.

@rkeithhill
Copy link
Contributor Author

OMG, the Travis build is taking forever to start.

@rkeithhill rkeithhill merged commit 40d718b into PowerShell:master Nov 10, 2017
@rkeithhill rkeithhill deleted the rkeithhill/do-not-set-breakpoint-non-ps-files branch November 10, 2017 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants