GithubHelp home page GithubHelp logo

vincederprince / vscode.py Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codewithswastik/vscode.py

0.0 0.0 0.0 1 MB

Create VSCode Extensions with python

Home Page: https://vscodepy.readthedocs.io/

License: MIT License

JavaScript 5.21% Python 94.79%

vscode.py's Introduction

vscode.py logo

Maintenance Downloads PyPI version Code style: black

About

Create vscode extensions with python.

Installation

Stable version:

pip install vscode.py

Why use vscode.py?

Why should you use this for building VScode extensions when you can use typescript? Here are some reasons:

  • vscode.py 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.py provides a pythonic way of creating the extension. Python has some powerful modules that Javascript doesn't and you can include these with vscode.py
  • vscode.py extensions work perfectly with vsce and you can publish your extensions just like you would publish any other extension.

Example Extension

import vscode
from vscode import InfoMessage

ext = vscode.Extension(name="Test Extension")

@ext.event
async def on_activate():
    vscode.log(f"The Extension '{ext.name}' has started")


@ext.command()
async def hello_world(ctx):
    return await ctx.show(InfoMessage(f"Hello World from {ext.name}"))

ext.run()

Tutorial

Step 1

Create a python file inside a folder.

image

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 required extension files.

image image

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.

image

  • Type >Hello World

image

  • It should show a popup like this in the bottom right corner

image

Extensions built using vscode.py

Here's a list of some extensions built using vscode.py. 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.py works and what it offers!

vscode.py's People

Contributors

codewithswastik avatar makiyu-py avatar driftasimov avatar truemyst avatar dorukyum avatar nicholas-schaub avatar sohamghugare avatar timskovjacobsen avatar tducret avatar grace-codes avatar skullcrusher0003 avatar yo56789 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.