code-d-api
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

code-d-api

Extend code-d in vscode with custom features.

This API provides:

  • support for registering custom snippets depending on installed DUB dependencies

Usage

Add code-d as dependency to your vscode extension inside the package.json:

"extensionDependencies": ["webfreak.code-d"]

To use, simply get the extension using this code:

import * as coded from "code-d-api";

export function activate(context: vscode.ExtensionContext) {
	let api: coded.CodedAPI | undefined;
	const codedExtension = vscode.extensions.getExtension<coded.CodedAPI>(coded.codedExtensionId);
	if (codedExtension) {
		api = codedExtension.exports;

		// do your API stuff
	}
}

If you only want to optionally depend on code-d, make sure you use the .activate() call instead of .exports and await it or use it with a .then(() => {}) clause.

Readme

Keywords

none

Package Sidebar

Install

npm i code-d-api

Weekly Downloads

1

Version

0.2.1

License

MIT

Unpacked Size

10.9 kB

Total Files

5

Last publish

Collaborators

  • webfreak001