Skip to content

Commit

Permalink
Fix module imports in main causing captions compile to be registered …
Browse files Browse the repository at this point in the history
…twice
  • Loading branch information
StefanH-AT committed Mar 24, 2023
1 parent 256c0ea commit 43f356a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions src/compiler/captions-compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ import { compileSomething } from "./compiler-base";
let ccChannel: OutputChannel;

export async function init(context: ExtensionContext): Promise<void> {
const commandList = await commands.getCommands(true);
const exists = commandList.some(c => c === "captions.compile");
if(!exists) {
const ccCommand = commands.registerTextEditorCommand("captions.compile", compileCaptions);
context.subscriptions.push(ccCommand);
}
const ccCommand = commands.registerTextEditorCommand("captions.compile", compileCaptions);
context.subscriptions.push(ccCommand);
}

async function compileCaptions(editor: TextEditor): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import * as vmt from "./language/LangVmt";
import * as captions from "./language/LangCaptions";
import * as keyvalue from "./language/LangKv";
import * as captionsCompile from "./compiler/captions-compile";
import * as modelCompile from "./compiler/captions-compile";
import * as performance from "./compiler/model-compile";
import * as modelCompile from "./compiler/model-compile";
import * as performance from "./performance";
import * as kvDetect from "./KvFileDetection";

import * as packageJson from "../package.json";
Expand Down

0 comments on commit 43f356a

Please sign in to comment.