vscode-zoterolens/src/extension.ts

37 lines
1.1 KiB
TypeScript
Raw Normal View History

2022-02-04 11:03:05 +00:00
import { commands, ExtensionContext, languages } from "vscode";
2022-02-14 20:37:52 +00:00
import { ZoteroCodeLensProvider } from "./zoteroCodeLensProvider";
2022-02-04 11:03:05 +00:00
import { openZoteroPDF, showInZotero } from "./commands";
export function activate(context: ExtensionContext) {
// Register the command
let commandDisposable2 = commands.registerCommand(
2022-02-14 20:37:52 +00:00
"zoterolens.showInZotero",
2022-02-04 11:03:05 +00:00
showInZotero
);
let commandDisposable3 = commands.registerCommand(
2022-02-14 20:37:52 +00:00
"zoterolens.openZoteroPDF",
2022-02-04 11:03:05 +00:00
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);
2022-02-14 20:37:52 +00:00
2022-02-04 11:03:05 +00:00
}
export function deactivate() {}