About
Create vscode extensions and color themes with python.
Installation
Stable version:
pip install vscode-ext
Why use this?
Why should you use this for building VScode extensions when you can use typescript? Here are some reasons:
- vscode-ext builds the package.json for you! No need to switch between your extension.py and package.json in order to add commands. It also handles adding Activity Bars, Keybinds and Views.
- vscode-ext provides a more pythonic way of creating the extension. Python also has some powerful modules that Javascript doesn't and you can include these with vscode-ext
- vscode-ext extensions work perfectly with vsce and you can publish your extensions just like you would publish any other extension.
Example Extension
import vscode
ext = vscode.Extension(name = "testpy", display_name = "Test Py", version = "0.0.1")
@ext.event
def on_activate():
return f"The Extension '{ext.name}' has started"
@ext.command()
def hello_world():
vscode.window.show_info_message(f'Hello World from {ext.name}')
@ext.command(keybind="ALT+5")
def ask_question():
res = vscode.window.show_info_message('How are you?', 'Great', 'Meh')
if res == "Great":
vscode.window.show_info_message('Woah nice!!')
elif res == "Meh":
vscode.window.show_info_message('Sorry to hear that :(')
vscode.build(ext)
Tutorial
Step 1
Create a python file inside a folder.
Step 2
Write the code for your extension. For this tutorial we have used the Example Extension
Step 3
Run the python file. It will build the files.
Step 4
Press F5. This will run the extension and open a new vscode window in development mode.
Step 5
Finally, test your command.
- Open the command palette with Ctrl+P in the development window.
- Type
>Hello World
- It should show a popup like this in the bottom right corner
Color Theme Example
import vscode
theme = vscode.ColorTheme(name='my-theme', display_name='My Theme', version='0.0.1')
theme.set_colors(
background='#12171F',
foreground='#EFEFEF',
accent_colors=['#399EF4', '#DA6771', '#4EB071', '#FFF099']
)
vscode.build_theme(theme)
Extensions built using vscode-ext
Here's a list of some extensions built using vscode-ext. If you'd like to include your extension here feel free to create a PR.
Documentation
The docs are coming soon! In the meantime you can look at the examples in order to learn how vscode-ext works and what it offers!
Metadata
Release files for vscode-ext 1.5.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vscode-ext-1.5.4.tar.gz | 29.3 kB | Without provenance | Details for vscode-ext-1.5.4.tar.gz |
Release files / vscode-ext-1.5.4.tar.gz
| Download URL | vscode-ext-1.5.4.tar.gz |
|---|---|
| Size | 29.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7381c24b441ee176f62a5110cd1d469f81e16d4df4b83dd70291897ad77bb04a
|
|
BLAKE2b-256 checksum How to use checksums |
eae4a10252c0d9678229b32844d3bf93c6052efc59341241dd63018672e52bbc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.10.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.8.5
|
Security for vscode-ext 1.5.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.