Skip to content

Commit dab12cd

Browse files
committed
Fix graph simplification in extension
Previously it ignored clusters, but now it's working properly.
1 parent de1728e commit dab12cd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/vscode/extension.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Graphviz } from "@hpcc-js/wasm-graphviz";
66
import { graphToDot } from "../control-flow/render";
77
import { simplifyCFG, trimFor } from "../control-flow/graph-ops";
88
import { newCFGBuilder, type Language } from "../control-flow/cfg";
9+
import { mergeNodeAttrs } from "../control-flow/cfg-defs";
910

1011
let graphviz: Graphviz;
1112
interface SupportedLanguage {
@@ -182,7 +183,7 @@ export async function activate(context: vscode.ExtensionContext) {
182183
.getConfiguration("functionGraphOverview")
183184
.get("simplify")
184185
) {
185-
cfg = simplifyCFG(cfg);
186+
cfg = simplifyCFG(cfg, mergeNodeAttrs);
186187
}
187188
const dot = graphToDot(cfg);
188189
const svg = graphviz.dot(dot);
@@ -195,7 +196,7 @@ export async function activate(context: vscode.ExtensionContext) {
195196
}
196197

197198
// This method is called when your extension is deactivated
198-
export function deactivate() {}
199+
export function deactivate() { }
199200

200201
//------------------------------------------------
201202

@@ -204,7 +205,7 @@ class OverviewViewProvider implements vscode.WebviewViewProvider {
204205

205206
private _view?: vscode.WebviewView;
206207

207-
constructor(private readonly _extensionUri: vscode.Uri) {}
208+
constructor(private readonly _extensionUri: vscode.Uri) { }
208209

209210
public setSVG(svg: string) {
210211
if (this._view) {

0 commit comments

Comments
 (0)