P403n1x87 / austin-vscode

Austin extension for Visual Studio Code
MIT License
21 stars 4 forks source link

Set environment variables when running Austin task #37

Closed Oblynx closed 1 year ago

Oblynx commented 2 years ago

Hello,

I tried using Austin to profile my python process (as a Task following the docs), but the python process needs to be launched with some environment variables. VSCode launch.json supports the field envFile: eg "envFile": "${workspaceFolder}/.env". Is it possible to support the same field in Austin tasks?

This is my tasks.json:

{
  "version": "2.0.0",
  "tasks": [
    {
      "type": "austin",
      "label": "Profile tests",
      "command": ["poetry", "run"],
      "args": ["pytest", "test/"]
    }
  ]
}
P403n1x87 commented 2 years ago

@Oblynx that's a very good point. Have you tried setting the envFile field on the off chance that it just works like other extensions? Otherwise I'll look into it as this is quite a useful feature!

Oblynx commented 2 years ago

Yeah I did, but it's not recognized unfortunately!

cwerner commented 2 years ago

I have the same problem...

ben-ikt commented 1 year ago

Is there a way to run austin via launch.json instead of tasks.json? In this case envFile is supported.

P403n1x87 commented 1 year ago

No unfortunately the launch.json file is used for running under a debugger AFAIK. We would have to add support for env and/or envFile to the Austin task. I'll look into it.