Skip to content

Commit 09d8dac

Browse files
authored
Merge pull request #14 from tmr232/small-highlight-fixes
Prep for release 0.0.6
2 parents 1a3cad8 + 8a1067a commit 09d8dac

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
66

77
## [Unreleased]
88

9+
## [0.0.6] - 2024-09-26
10+
911
### Added
1012

1113
- The CFG view now highlights (in black) the node matching the cursor position.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"//": "START EXTENSION ATTRIBUTES",
6060
"publisher": "tamir-bahar",
6161
"name": "function-graph-overview",
62-
"version": "0.0.5",
62+
"version": "0.0.6",
6363
"description": "Function Graph Overview",
6464
"displayName": "Function Graph Overview",
6565
"icon": "./media/icon.png",
@@ -109,4 +109,4 @@
109109
"engines": {
110110
"vscode": "^1.86.0"
111111
}
112-
}
112+
}

src/vscode/extension.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,10 @@ export async function activate(context: vscode.ExtensionContext) {
234234
}
235235
// TODO: Highlighting in the DOT is a cute trick, but might become less effective on larger functions.
236236
// So it works for now, but I'll probably need to replace it with CSS so that I only render once per function.
237-
const nodeToHighlight = highlightCurrentNode
237+
238+
// Only highlight if there's more than one node to the graph.
239+
const shouldHighlight = highlightCurrentNode && cfg.graph.order > 1;
240+
const nodeToHighlight = shouldHighlight
238241
? getValue(cfg.offsetToNode, offset)
239242
: undefined;
240243
const dot = graphToDot(cfg, false, nodeToHighlight);

0 commit comments

Comments
 (0)