Updates to support the upcoming welcome message

This commit is contained in:
Elio Struyf
2021-08-26 20:28:43 +02:00
parent 939cf94de6
commit 2c1fd2890c
4 changed files with 26 additions and 14 deletions
+3
View File
@@ -1,5 +1,8 @@
const extensionName = "frontMatter";
export const EXTENSION_ID = 'eliostruyf.vscode-front-matter';
export const EXTENSION_STATE_VERSION = 'frontMatter:Version';
export const getCommandName = (command: string) => {
return `${extensionName}.${command}`;
};
+11 -2
View File
@@ -5,11 +5,12 @@ import { Folders } from './commands/Folders';
import { Preview } from './commands/Preview';
import { Project } from './commands/Project';
import { Template } from './commands/Template';
import { COMMAND_NAME } from './constants/Extension';
import { COMMAND_NAME, EXTENSION_ID, EXTENSION_STATE_VERSION } from './constants/Extension';
import { TaxonomyType } from './models';
import { MarkdownFoldingProvider } from './providers/MarkdownFoldingProvider';
import { TagType } from './viewpanel/TagType';
import { ExplorerView } from './webview/ExplorerView';
import { Notifications } from './helpers/Notifications';
let frontMatterStatusBar: vscode.StatusBarItem;
let statusDebouncer: { (fnc: any, time: number): void; };
@@ -18,15 +19,23 @@ let collection: vscode.DiagnosticCollection;
const mdSelector: vscode.DocumentSelector = { language: 'markdown', scheme: 'file' };
export async function activate({ subscriptions, extensionUri, extensionPath }: vscode.ExtensionContext) {
export async function activate({ subscriptions, extensionUri, extensionPath, globalState }: vscode.ExtensionContext) {
collection = vscode.languages.createDiagnosticCollection('frontMatter');
const frontMatter = vscode.extensions.getExtension(EXTENSION_ID)!;
const frontMatterVersoin = frontMatter.packageJSON.version;
const crntVersion = globalState.get<string>(EXTENSION_STATE_VERSION);
// Pages dashboard
Dashboard.init(extensionPath);
subscriptions.push(vscode.commands.registerCommand(COMMAND_NAME.dashboard, () => {
Dashboard.open(extensionPath);
}));
if (!crntVersion) {
vscode.commands.executeCommand(COMMAND_NAME.dashboard);
}
// Register the explorer view
const explorerSidebar = ExplorerView.getInstance(extensionUri);
let explorerView = vscode.window.registerWebviewViewProvider(ExplorerView.viewType, explorerSidebar, {