diff --git a/CHANGELOG.md b/CHANGELOG.md index df34d67..fe989b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how ## [Unreleased] +## [0.0.6] - 2024-09-26 + ### Added - The CFG view now highlights (in black) the node matching the cursor position. diff --git a/package.json b/package.json index 51b4100..baf430b 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "//": "START EXTENSION ATTRIBUTES", "publisher": "tamir-bahar", "name": "function-graph-overview", - "version": "0.0.5", + "version": "0.0.6", "description": "Function Graph Overview", "displayName": "Function Graph Overview", "icon": "./media/icon.png", @@ -109,4 +109,4 @@ "engines": { "vscode": "^1.86.0" } -} +} \ No newline at end of file diff --git a/src/vscode/extension.ts b/src/vscode/extension.ts index 690eb3d..59e55d0 100644 --- a/src/vscode/extension.ts +++ b/src/vscode/extension.ts @@ -234,7 +234,10 @@ export async function activate(context: vscode.ExtensionContext) { } // TODO: Highlighting in the DOT is a cute trick, but might become less effective on larger functions. // So it works for now, but I'll probably need to replace it with CSS so that I only render once per function. - const nodeToHighlight = highlightCurrentNode + + // Only highlight if there's more than one node to the graph. + const shouldHighlight = highlightCurrentNode && cfg.graph.order > 1; + const nodeToHighlight = shouldHighlight ? getValue(cfg.offsetToNode, offset) : undefined; const dot = graphToDot(cfg, false, nodeToHighlight);