OpenHandler not called

I am afraid this is a beginners questions, but I got stuck with it

In my use-case I have files, ending with extension “.dlt”, that should be imported into a database.
The files can be located anywhere, usually not in the opened workspace.
For that I did implement a dedicated import-contribution with corresponding menus, keybindings and commands.
That works perfect.

But it could also be the case, that a *.dlt file is located in the workspace.
So I provide a OpenHandler for that and try to redirect the open() call to the command from my import-contribution.

But my handler is never called/instantiated (I add some logs) and I don’t know why.

the frontend-module:


export default new ContainerModule(bind => {

bind(OpenDltHandler).toSelf().inSingletonScope();
bind(OpenHandler).toService(OpenDltHandler);

bind(ImportDltContribution).toSelf().inSingletonScope();

bind(CommandContribution).toService(ImportDltContribution);
bind(MenuContribution).toService(ImportDltContribution);
bind(KeybindingContribution).toService(ImportDltContribution);

});

the Handler:


@injectable()
export class OpenDltHandler implements OpenHandler {

id: "open.dlt";
label = "Open DLT";

@inject(CommandService)
protected readonly commands: CommandService;

constructor() {
    console.log("**** OpenDltHandler constructor()")
}

canHandle(uri: URI): number {
    console.log("**** OpenDltHandler canHandle"+uri.toString)
    if(uri.path.ext === ".dlt") {
        return 50;
    }
    else {
        return 0;
    }
}

async open(uri: URI): Promise<boolean> {
    await this.commands.executeCommand('ImportRecent.command', uri);
    return true;
}

}

Any ideas/hints?

[original thread by surrender70]

[surrender70]

Damn. Forget this question please. Unbelievable mistake on my side. I had two local clones of my project. I’ve changed and built the one and executed the other, thas was unchanged. Everything is working now…

happens :smiley: