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

Run python file in terminal should run unsaved file #22280

Closed
Thaina opened this issue Oct 23, 2023 · 4 comments
Closed

Run python file in terminal should run unsaved file #22280

Thaina opened this issue Oct 23, 2023 · 4 comments
Labels
area-editor-* User-facing catch-all feature-request Request for new features or functionality

Comments

@Thaina
Copy link

Thaina commented Oct 23, 2023

I have made a short unsaved script (around <20 line of code) and I wish I could just run and debug with python tools without saving it first. Is it possible?

@Thaina Thaina added the feature-request Request for new features or functionality label Oct 23, 2023
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Oct 23, 2023
@karthiknadig karthiknadig changed the title Run python file in terminal should support virtual file Run python file in terminal should run unsaved file Oct 23, 2023
@karrtikr
Copy link

karrtikr commented Oct 23, 2023

You can use VS Code tasks to accomplish that, add the following to tasks.json:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Run Python Script",
            "type": "shell",
            "command": "${command:python.interpreterPath}",
            "args": ["-c", "${selectedText}"],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": false,
                "panel": "shared"
            },
            "problemMatcher": []
        }
    ]
}

"Run task" command can be used to run the task, note you'll need to select all text before attempting to run the task.

@Thaina
Copy link
Author

Thaina commented Oct 23, 2023

There is already a command to run selected line and I have used that

image

However I just think this feature is wieldy if it just support directly from the plugin, and also allowed to debug unsaved code too

@karrtikr karrtikr removed their assignment Oct 23, 2023
@karrtikr karrtikr added area-editor-* User-facing catch-all needs community feedback Awaiting community feedback and removed triage-needed Needs assignment to the proper sub-team labels Oct 23, 2023
@github-actions
Copy link

Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.

@brettcannon
Copy link
Member

Thank you for submitting your feature request and everyone who considered it! Unfortunately, this issue did not receive enough votes over the allotted time, and so we are closing the issue.

@brettcannon brettcannon closed this as not planned Won't fix, can't repro, duplicate, stale Jan 11, 2024
@github-actions github-actions bot removed the needs community feedback Awaiting community feedback label Jan 11, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-editor-* User-facing catch-all feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

3 participants