mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-08-06 17:02:54 +02:00
#240 - fix snippet action
This commit is contained in:
@@ -28,6 +28,7 @@ export class ModeListener extends BaseListener {
|
||||
public static async getMode() {
|
||||
const modes = Settings.get<Mode[]>(SETTING_GLOBAL_MODES);
|
||||
if (!modes || modes.length === 0) {
|
||||
await this.resetEnablement();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -46,8 +47,12 @@ export class ModeListener extends BaseListener {
|
||||
this.sendMsg(GeneralCommands.setMode as any, undefined);
|
||||
|
||||
// Enable dashboards
|
||||
await commands.executeCommand('setContext', CONTEXT.isSnippetsDashboardEnabled, true);
|
||||
await commands.executeCommand('setContext', CONTEXT.isDataDashboardEnabled, true);
|
||||
await this.resetEnablement();
|
||||
}
|
||||
}
|
||||
|
||||
public static async resetEnablement() {
|
||||
await commands.executeCommand('setContext', CONTEXT.isSnippetsDashboardEnabled, true);
|
||||
await commands.executeCommand('setContext', CONTEXT.isDataDashboardEnabled, true);
|
||||
}
|
||||
}
|
||||
@@ -30,6 +30,8 @@ export class ModeSwitch {
|
||||
|
||||
ModeSwitch.isInit = true;
|
||||
}
|
||||
|
||||
ModeListener.getMode();
|
||||
|
||||
const modes = Settings.get<string | null>(SETTING_GLOBAL_MODES);
|
||||
if (!modes || modes.length === 0) {
|
||||
@@ -38,7 +40,6 @@ export class ModeSwitch {
|
||||
}
|
||||
|
||||
ModeSwitch.setText();
|
||||
ModeListener.getMode();
|
||||
}
|
||||
|
||||
public static getMode(): string {
|
||||
|
||||
Reference in New Issue
Block a user