Skip to content

Any way to launch the clprompt webview with a string? #6

@ptc-abrown

Description

@ptc-abrown

So as I work to replace our RDi plugin for Implementer with VSCode we have a way to edit a compilation command using code like this

                                      IBMiConnection  system = subsystem.getConnection();
				CLPrompter cp = new CLPrompter(shell, system, compileCommand);

				if(cp.showDialog() == CLPrompter.OK) {
					compileCommand = cp.getCommandString();     // get command string
				} else {
					okToRun = false;
				}

Now I have opened a text document with clprompter installed like this

const doc = await vscode.workspace.openTextDocument({ language: 'cl', content: command});
await vscode.window.showTextDocument(doc);

And I get a nice dialog and formatted untitle document. If clprompter is not installed I guess I am forced to use the document in some way. Although I am asked to name it and save it which is less that ideal. I might be able to use a temporary disc file to avoid this.

In an ideal world I would test to see if clprompter is installed, activate it, and then have the webview come up directly on the command instead of having to have an editor document. Something like:

const command = await vscode.commands.executeCommand('clPrompter.webview', command);
if (command !== '') {
//run compile
}

And I would rather not import all of the webview into my extension. Much easier if I can inherit from your work (which is very very nice BTW - and thank you).

Image Image

Is this sort of ability on the roadmap?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions