qjebbs/vscode-plantuml

What is the supported way to call `plantuml.preview` from another extension?

esmasth opened this issue · 1 comments

I have used the extension for a long while and appreciate the quality of work here. I have a use case in my own extension to generate a preview of data via plantuml code and it would be great if it was simple to call executeCommand('plantuml.preview') from my extension on the active editor context. Is that supported, and if yes are there any considerations or additional arguments required? I seem to trigger the command correctly but the execution bails out at the following check in previewer.ts

let diagrams = (0, tools_1.diagramsOf)(editor.document);
if (!diagrams.length)
    return;

I figured it was a timing issue.