JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 15
  • Score
    100M100P100Q46157F
  • License MIT

Utilities for creating VSCode Python extension

Package Exports

  • vscode-python-extension-core
  • vscode-python-extension-core/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vscode-python-extension-core) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

vscode-python-extension-core

npm package Build Status Downloads Issues Code Coverage Commitizen Friendly Semantic Release

Core package to create VSCode Python extension. Use 34j/vscode-python-extension-cookiecutter to create a new extension.

See the above package for usage.

Install

npm install vscode-python-extension-core

Usage

// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import * as vscode from "vscode";
import * as core from "vscode-python-extension-core";
import { PackageInfo } from "vscode-python-extension-core";

// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
export function activate(context: vscode.ExtensionContext) {
  const packageInfo: PackageInfo = {
    packageName: "{{cookiecutter.module_name}}",
    packageDisplayName: "{{cookiecutter.module_name}}",
    extensionName: "{{cookiecutter.ext_name}}",
    runCommandName: "{{cookiecutter.ext_name}}.run",
    runForWorkspaceCommandName: "{{cookiecutter.ext_name}}.runForWorkspace",
    packageConfigurationSection: "{{cookiecutter.ext_name}}.settings",
    useIntegratedTerminalConfigurationSectionFullName:
      "{{cookiecutter.ext_name}}.useIntegratedTerminal",
  };
  const disp = new core.commandDispatcher.EasyCommandDispatcher(
    context,
    packageInfo,
    new core.packageRunner.EasyOptionsBuilder(
      packageInfo,
      [], [], [], []
    )
  );
  disp.activate();
}

// this method is called when your extension is deactivated
export function deactivate() {}

API

commandDispatcher

Helper class to dispatch VSCode commands.

packageRunner

Helper class to run Python packages.

pythonTerminal

Helper class to run Python commands in VSCode terminal or child_process.

PackageInfo

Information about the Python package to run. This class is used everywhere.