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

Display message if active file being debugged is not a python file #1178

Closed
DonJayamanne opened this issue Mar 24, 2018 · 4 comments
Closed
Labels
area-debugging feature-request Request for new features or functionality needs PR Ready to be worked on

Comments

@DonJayamanne
Copy link

DonJayamanne commented Mar 24, 2018

This applies to both experimental & current debugger

Very often we have users attempting to debug python code with the launch.json file opened.
In such a situation, launch.json is treated as the active file and python debugger will attempt to debug this.

Proposed solution:

  • Display a message if active file is not a python file
  • If there are at least 2 python file opened in the editor, then display a file picker (or drop down list), allowing the user to select a file to debug
  • If there is only one python file opened in the editor, use that for debugging

This will avoid a lot of confusion amongst users (I've seen our own devs get confused fall into this trap).

Might want to consider getting this into March release.

@brettcannon @qubitron
Thoughts

@DonJayamanne DonJayamanne added feature-request Request for new features or functionality area-debugging needs decision labels Mar 24, 2018
@DonJayamanne DonJayamanne self-assigned this Mar 24, 2018
@DonJayamanne DonJayamanne changed the title Display message or similar if json file is selected for debugging Display message if active file being debugged is not a python file Mar 24, 2018
@qubitron
Copy link

@DonJayamanne I think a message is sufficient here: "Your debugging configuration is set to debug the current file, but the current file is not a Python file. Please open a Python file and try again". Once you realize what the problem is it is easy to fix, no need to add UI for displaying a file picker and if we try to be too smart it might be more of a headache to maintain.

@Anapo14
Copy link

Anapo14 commented Oct 24, 2019

We could add a link to this. It has info on trying to debug the launch.json file. Users may be curious to learn more.

@github-actions github-actions bot removed the needs PR label Aug 9, 2022
@karrtikr karrtikr added the needs PR Ready to be worked on label Aug 9, 2022
@cpinamtz
Copy link

cpinamtz commented Apr 7, 2023

Does it makes sense to keep this issue opened (at the moment of writing this, VSCode v1.77.0 and vscode-python extension v2023.6.0) when the IDE distinguishes whether the current opened file is or not a Python file to display the Run Python File and sub-option Debug Python File?
image

@brettcannon
Copy link
Member

@cpinamtz thanks for the ping on this! I think you're right it isn't worth keeping open for the reasons you listed and there's only a single upvote after over 5 years.

@brettcannon brettcannon closed this as not planned Won't fix, can't repro, duplicate, stale Apr 10, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-debugging feature-request Request for new features or functionality needs PR Ready to be worked on
Projects
None yet
Development

No branches or pull requests

6 participants