Skip to content

Commit

Permalink
Register open walkthrough command earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
Splines committed Jan 19, 2025
1 parent a67282e commit 1695d08
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ export async function activate(context: vscode.ExtensionContext) {
// Trigger the Manim shell to start listening to the terminal
ManimShell.instance;

// Register the open walkthrough command earlier, so that it can be used
// even while the Python extension is loading and the ManimGL version is
// being detected.
const openWalkthroughCommand = vscode.commands.registerCommand(
"manim-notebook.openWalkthrough", async () => {
Logger.info("💠 Command requested: Open Walkthrough");
await vscode.commands.executeCommand("workbench.action.openWalkthrough",
`${context.extension.id}#manim-notebook-walkthrough`, false);
});

context.subscriptions.push(openWalkthroughCommand);

let manimglPath: string | undefined = undefined;
try {
manimglPath = await waitForPythonExtension();
Expand Down Expand Up @@ -113,13 +125,6 @@ export async function activate(context: vscode.ExtensionContext) {
{ language: "python" }, new ExportSceneCodeLens()),
);

const openWalkthroughCommand = vscode.commands.registerCommand(
"manim-notebook.openWalkthrough", async () => {
Logger.info("💠 Command requested: Open Walkthrough");
await vscode.commands.executeCommand("workbench.action.openWalkthrough",
`${context.extension.id}#manim-notebook-walkthrough`, false);
});

// internal command
const finishRecordingLogFileCommand = vscode.commands.registerCommand(
"manim-notebook.finishRecordingLogFile", async () => {
Expand All @@ -143,7 +148,6 @@ export async function activate(context: vscode.ExtensionContext) {
exitSceneCommand,
clearSceneCommand,
recordLogFileCommand,
openWalkthroughCommand,
exportSceneCommand,
finishRecordingLogFileCommand,
redetectManimVersionCommand,
Expand Down

0 comments on commit 1695d08

Please sign in to comment.