Skip to main content

VSCode API for Deno

Works with
It is unknown whether this package works with Bun
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Browsers
JSR Score
100%
Published
4 weeks ago (1.89.0)

vscode

Visual Studio Code Extension Development for Deno

modified for Deno from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/vscode/index.d.ts

esbuild or something similar should be used. ( https://deno.land/x/esbuild )

import { type ExtensionContext, importVsCodeApi } from "jsr:@narumincho/vscode";

export function activate(context: ExtensionContext) {
  const vscode = importVsCodeApi();
  if (vscode === undefined) {
    throw new Error(
      "Could not import vscode api because it was not working within the extension",
    );
  }

  console.log(
    'Congratulations, your extension "helloworld-sample" is now active!',
  );

  const disposable = vscode.commands.registerCommand(
    "extension.helloWorld",
    () => {
      vscode.window.showInformationMessage("Hello World!");
    },
  );

  context.subscriptions.push(disposable);
}

All examples can be found here

Built and signed on
GitHub Actions
View transparency log

Add Package

deno add @narumincho/vscode

Import symbol

import * as mod from "@narumincho/vscode";

Add Package

npx jsr add @narumincho/vscode

Import symbol

import * as mod from "@narumincho/vscode";

Add Package

yarn dlx jsr add @narumincho/vscode

Import symbol

import * as mod from "@narumincho/vscode";

Add Package

pnpm dlx jsr add @narumincho/vscode

Import symbol

import * as mod from "@narumincho/vscode";

Add Package

bunx jsr add @narumincho/vscode

Import symbol

import * as mod from "@narumincho/vscode";