question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python extension should activate on onDebugInitialConfigurations

See original GitHub issue

Hi VS Code dev here 👋

  1. Have python extension installed, workspace without a launch.json.
  2. Do not open a python file
  3. Press “Open launch.json” in the Debug viewlet
  4. Python options are not presented 🐛

The issue for this is because Python extension did not get activated since no python file got opened. I suggest that python extension gets activated also for onDebugInitialConfigurations event. This event is fired when the launch.json is about to get populated for the first time.

fyi @luabud

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:18 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
isidorncommented, Jan 14, 2020

@dantup please create an issue in vscode and we can continue the discussion there. Also this event will only be fired the very first time the launch.json is getting created. It will not be fired every time a user wants to debug.

1reaction
DanTupcommented, Jan 13, 2020

the event @DanTup is describing is a corner case

I think it’s more than that. It’s pretty common to open a project and (with no files open) just hit F5. The more languages that do this, the more options the user has to read through to figure out what they need to select 😞

It also means that the extension will almost always be activated (anytime someone wants to debug any type of project your extension will now be activated). The C# extension does this and I’m frequently seeing it start downloading SDK/dependencies when I’m starting to debug a Dart project.

I appreciate this is the wrong issue tracker for it, but I think VS Code really needs better APIs here. In addition to the bad UX, there’s a perf implication - the more languages that subscribe to this, the slower pressing F5 will be as a bunch of extensions all start running activating code (and potentially spawning language servers, etc).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Activation Events | Visual Studio Code Extension API
This activation event is emitted and interested extensions will be activated whenever a file that resolves to a certain language gets opened.
Read more >
Python in Visual Studio Code – November 2021 Release
Nayana Vinod and Jessica Jolly: Python extension now activates on onDebugInitialConfigurations. (#9557). Last but not least, special thanks to ...
Read more >
How would I fix the issue of the python extension loading and ...
Uninstall Python extension (if you have pylance uninstall it first). · Close all instances of VS Code. · Go to, %USERPROFILE%/. · Delete...
Read more >
Using Visual Studio Code Extensions for Persistence - Medium
activationEvents — The event(s) that will trigger the extension, ... a file containing code of a specific language (e.g. Rust, Python, etc.) ...
Read more >
Setting up the Python extension for Microsoft Visual Studio Code
How to set up and get started with the Python extension for Visual Studio Code.Follow TECH(talk) for ... Your browser can 't play...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found