Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added required support for ViZX Extension #469

Merged
merged 2 commits into from
Mar 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion editor/code/src/goals.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Position, Uri, WebviewPanel, window, ViewColumn } from "vscode";
import { Position, Uri, WebviewPanel, window, ViewColumn, extensions, commands } from "vscode";
import {
BaseLanguageClient,
RequestType,
Expand Down Expand Up @@ -78,6 +78,10 @@ export class InfoPanel {
// notify the info panel that we have fresh goals to render
requestDisplay(goals: GoalAnswer<PpString>) {
this.postMessage("renderGoals", goals);
let vizx = extensions.getExtension("inQWIRE.vizx");
if (vizx?.isActive) {
commands.executeCommand("vizx.lspRender", goals);
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me as a prototype, will merge so you can continue your testing.

I propose we indeed move towards a registration mechanism like done in most parts of VSCode, so eventually we can replace this code with your extension doing in activation:

let coq-lsp = extensions.getExtension("coq-lsp").?API_v1
coq-lsp.registerGoalProcessorString((goals) => lspRender(goals))

We may need a bit different API once we need to properly manage the UI resources both extensions handle, but that should be a good start.

}

// notify the info panel that we found an error
Expand Down