vscode-zoterolens/src/extension.ts

36 lines
1.1 KiB
TypeScript
Raw Normal View History

2022-02-04 11:03:05 +00:00
import { commands, ExtensionContext, languages } from "vscode";
import ZoteroCodeLensProvider from "./zoteroCodeLensProvider";
import { openZoteroPDF, showInZotero } from "./commands";
export function activate(context: ExtensionContext) {
// Register the command
let commandDisposable2 = commands.registerCommand(
"extension.showInZotero",
showInZotero
);
let commandDisposable3 = commands.registerCommand(
"extension.openZoteroPDF",
openZoteroPDF
);
// Get a document selector for the CodeLens provider
// This one is any file that has the language of javascript
let docSelector = {
language: "markdown",
scheme: "file"
};
// Register our CodeLens provider
let codeLensProviderDisposable = languages.registerCodeLensProvider(
docSelector,
new ZoteroCodeLensProvider()
);
// Push the command and CodeLens provider to the context so it can be disposed of later
context.subscriptions.push(commandDisposable2);
context.subscriptions.push(commandDisposable3);
context.subscriptions.push(codeLensProviderDisposable);
}
export function deactivate() {}