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.

isWatching/background task as preLaunchTask in launch.json

See original GitHub issue

It would be nice to have a watcher task as preLaunchTask in launch.json. At the moment this is not possible because the launch task will not start before the preLaunchTask ends. A long running preLaunchTask should have a regex similar to problemMatcher to wait for a specific text in the output window before executing the launch task. In my scenario I’m running webpack dev server as a watcher task. I want this task to run if <kbd>F5</kbd> is hit and the preLaunchTask is not running. To delay the debugger launch it would be useful to test for a specific string in the output window webpack: bundle is now VALID.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:44
  • Comments:63 (29 by maintainers)

github_iconTop GitHub Comments

9reactions
dbaeumercommented, Mar 27, 2017

As mention the real fix is to allow something like

{
    "taskName": "abc",
    "background": {
         "activeOnStart": true,
         "beginsPattern": "^webpack: Compiling\\.\\.\\.$",
         "endsPattern": "^webpack: Compiled successfully\\.$"
    }
}
9reactions
dbaeumercommented, May 10, 2016

We should support defining watch begin / end pattern without a problem pattern as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using "preLaunchTasks" and Naming a Task in Visual Studio ...
FWIW, I'm using VS Code 1.20.1 and here's how I got my preLaunchTask to work: In launch.json : { "version": "0.2.0", "configurations": [...
Read more >
Automatically starting a server when starting a debug session ...
So here is how to do this. We add two more lines to the existing `launch.json`, defining a task to run before debugging...
Read more >
VS Code tips — Debug pre launch tasks - YouTube
Today's VS Code tip: debug pre launch tasksAdd a preLaunchTask to your debug configuration to automatically run a task when you start ......
Read more >
Visual Studio Code 0.9.1
This improvement is based on a protocol change that affects all debug adapters. Debugging - Pre-Launch Task. In a project's launch configurations (launch.json), ......
Read more >
Build before Debug in VSCode - dr. Sybren A. Stüvel
Then we need to update launch.json to run that task before ... Note the preLaunchTask , which is set to the label of...
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