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

Update launch.json schema to add "code" #12500

Closed
int19h opened this issue Jun 23, 2020 · 3 comments
Closed

Update launch.json schema to add "code" #12500

int19h opened this issue Jun 23, 2020 · 3 comments
Assignees
Labels
area-debugging feature-request Request for new features or functionality

Comments

@int19h
Copy link

int19h commented Jun 23, 2020

In addition to "program" and "module", debugpy also supports "code". This maps to Python command line as follows:

  • python ...
    • ... foo.py: "program"
    • ... -m foo: "module"
    • ... -c print(123): "code"

The value can be a single string:

{
  ...
  "code": "import sys; print(sys.version)"
  ...
}

Or it can be an array of strings, in which case each string is treated as a separate line of code (i.e. they're joined together using \n):

{
  ...
  "code": [
    "import sys",
    "print(sys.version)",
  ],
  ...
}
@int19h int19h added feature-request Request for new features or functionality triage-needed Needs assignment to the proper sub-team labels Jun 23, 2020
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Jun 23, 2020
@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
@brettcannon
Copy link
Member

We don't see how this would map back to the editor in order to do something useful. Plus, these hasn't been any upvotes.

@brettcannon brettcannon closed this as not planned Won't fix, can't repro, duplicate, stale Dec 18, 2023
@github-actions github-actions bot removed the needs PR Ready to be worked on label Dec 18, 2023
@int19h
Copy link
Author

int19h commented Dec 19, 2023

FWIW the use case for this is to provide custom startup path for cases where "program" or "module" are inadequate (e.g. import a module and then run some function from it with specified arguments). I'm not sure what you mean by "mapping back to the editor"? The code is not viewable in the editor is a separate file that can be debugged, but for 2-3 lines of code this is supposed to be used with, it's not really a concern.

@brettcannon
Copy link
Member

I'm not sure what you mean by "mapping back to the editor"?

How it ties into VS Code's UI/UX.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2024
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
Projects
None yet
Development

No branches or pull requests

3 participants