I'm writing a VSCode extension which I bundle with esbuild, as suggested in VSCode docs. Following the docs, I added new script entries in my package.json, including:
"esbuild": "yarn run esbuild-base -- --sourcemap"
Now I must run yarn run esbuild, then hit f5 each time I want to test my extension. This is a source of confusion, because if I forget the first part, I'm going to test my old code.
To avoid this I wonder if it's possible to automatically run yarn run esbuild when I press f5.
Create a task to perform the yarn call
add this task as a preLaunchTask to your debug launch config
Or maybe you can setup an npm-watch script
Related
We have a new team member trying to get started with our Godot project. VSCode is our standard editor. Everyone is using Fedora Linux. You can find the relevant files here:
https://github.com/redhat-gamedev/srt-godot-server/tree/main/.vscode
On my machine, when trying to run the launch configuration, the build task succeeds, and then the program is launched. Everything works fine.
On the new team member's machine, when trying to run the launch configuration, the build task succeeds, and then nothing happens. There are no errors. There is no output.
We tried running VSCode with an increased log level (debug), but the VScode log files don't show anything meaningful or related. We tried executing the equivalent launch command from the terminal/shell and it works fine. There are no errors, but the resulting built program executes successfully. Interestingly, running code --verbose does produce a ton of output but nothing super specific to the execution of the steps in the launch configuration. Also, code --verbose --log debug does not cause messages spit out of VSCode to be at the DEBUG log level. Everything is still INFO:
[4183395:0112/092541.932947:INFO:CONSOLE(616)] "%cTRACE color: #888 [File Watcher (parcel)] [CHANGED] ...
How can I debug a launch configuration in VSCode to see what's going on? Is there a way to make the launch configuration system of VSCode be more verbose?
I just recently discovered the npm scripts section in VSCode. Now I'm wondering, is there also a way to run npm scripts from the command pallete?
I wasn't able to find any documentation on this, besides defining and launching build and test tasks. In a few results from Google, people were able to run npm scripts by typing > npm: taskname, but for some reason this won't work for me. I suspect this changed when VSCode natively implemented the script runner.
I am using Visual Studio as my IDE. I have multiple run tasks defined in launch.json which I can run it from Run/Debug menu.
I want to run few specific tasks in some order from launch.json very frequently,
So If there is any way to achieve this via command line or aggregrate those tasks into a new launch file and run it.
Any thoughts how can I achieve this?
I tried to compile VSCode source for the first time ever, I ran the "yarn run watch" command and eventually the compilation finished with the message "Finished Compilation with 0 errors" but then the console just gets stuck there. I tried using different consoles but still facing the same problem.
I killed the process and had no later problems using VS Code from this build.
In the directory where vscode was cloned, I checked with du -s that nothing was changing over a few minutes of testing will the logging was stopped on your message above.
Having stopped yarn run watch I then carried out the next instruction of the build process: yarn watch.
This also hung with the same message. I used du again. And again there was no change in the size of the directory. I stopped yarn watch and was then able to run vscode, editing files without a problem.
All custom commands like watch that you can yarn run are defined in the file package.json in the project root. In this case, it's package.json on Github. Even before looking at it, I assumed from the name that what the command does is probably to build once and then go into a loop that watches for new changes and then rebuilds. In the section called scripts of package.json we see that watch is defined to be gulp watch --max_old_space_size=4095. Google gulp watch, and you'll see that that's what it does.
I think you're looking for yarn run compile, which the vscode team setup to build the project once and then exit.
I would like to be able to run an npm script in the Protractor tool window rather than npm. This is easily doable creating a new Protractor Run/Debug config but I need to add a command line argument which the Run config doesnt currently support.
More specifically I am trying to run
protractor --capabilities.chromeOptions.args=--headless --capabilities.chromeOptions.args=--disable-gpu
Would like to do this without modifying the protractor config file.
Essentially, I want to be able to do this without having to provide multiple config files in my project. One for headless, one without.
There is currently no way to specify cmd options in Protractor run configuration, please follow WEB-25165 for updates