Skip to content

Commit

Permalink
Merge pull request #14 from tmr232/small-highlight-fixes
Browse files Browse the repository at this point in the history
Prep for release 0.0.6
  • Loading branch information
tmr232 authored Sep 26, 2024
2 parents 1a3cad8 + 8a1067a commit 09d8dac
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
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

0 comments on commit 09d8dac

Please sign in to comment.