Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -109,4 +109,4 @@
"engines": {
"vscode": "^1.86.0"
}
}
}
5 changes: 4 additions & 1 deletion src/vscode/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down