Skip to content

alelavelli/vscode-launcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VSCode Launcher

VSCode Launcher is a simple CLI tool that helps to run vscode configuration without opening it avoiding the resource usage derived from extensions and vscode itself.

Pain in the ass

VSCode launch.json is very useful when we want to define and store run configurations with other people in our team. However, when I just want to run a specific configuration I need to start vscode and getting all the overhead in resource consumption.

An obvious solution is to run directly the Python application from terminal but I need to copy all the environment variables from the launch.json configuration to a .env file and then using python-dotenv library with load_dotenv() method to load them.

This is not a scalable solution because I need to remember every time I run the command to align the .env file that is in the .gitignore and therefore, not versioned.

Solution

So, I decided to leave the environment variables and all the other configuration directly inside the launch.json file and use a CLI tool to parse it and run the proper configuration.

Yes, I'm over engineering all of this BUT it is just an excuse to develop a CLI tool with Rust ;)

Usage

vscl CLI has two simple commands: one to list the available launch configurations and the other to run a specific configuration.

List configurations

vscl ls -w <WORKSPACE>

expected output:

The workspace <WORKSPACE> contains the following configurations:
┌──────────────────────────────────────────────┬──────────────┐
│ name                                         │ language     │
├──────────────────────────────────────────────┼──────────────┤
│ Python Debugger: Current File                │ Python       │
├──────────────────────────────────────────────┼──────────────┤
│ Backend                                      │ Rust         │
├──────────────────────────────────────────────┼──────────────┤
│ Frontend                                     │ JavaScript   │
└──────────────────────────────────────────────┴──────────────┘

Run configuration

vscl run -w <WORKSPACE> -n <CONFIGURATION>

Supported Languages

VSCL supports Python, Rust and JavaScript launch configurations.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages