Skip to content

Commit 6f250d2

Browse files
authored
Merge pull request #10 from tmr232/release-0.0.5
Release 0.0.5
2 parents e493040 + e2a0c49 commit 6f250d2

File tree

4 files changed

+27
-26
lines changed

4 files changed

+27
-26
lines changed

CHANGELOG.md

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

77
## [Unreleased]
88

9-
### Language Support
9+
## [0.0.5] - 2024-09-18
1010

11-
- Add initial support for Python
12-
13-
### Visualization
14-
15-
- Add support for node clusters. This is used heavily in Python, for context-managers and exception-handling.
16-
17-
### Demo
11+
### Added
1812

19-
- Add Python support
20-
- Add sharing - click the "Share" button to get a sharable link to what you currently see
13+
- Initial support for Python.
14+
- Support for node clusters. This is used heavily in Python, for context-managers and exception-handling.
15+
- A "share" feature to the demo
16+
- A "save SVG" option to the demo
2117

22-
### Testing
18+
#### Testing
2319

2420
- Enable live-testing with the web viewer. Requires that you run both `bun web-tests --watch` and `bun web` at the same time.
2521
- By default, `bun web` only shows failing tests
2622
- `bun web` color-codes tests to note which are failing
23+
- `bun lint` added `tsc --noEmit`
24+
- DOT output in `bun web` is not pretty-printed, and can be automatically opened in [GraphvizOnline](https://dreampuf.github.io/GraphvizOnline/)
2725

28-
### Extension
29-
30-
- No changes
31-
32-
### Known Issues
26+
### Fixed
3327

34-
- Backlinks are no longer thicker than normal links. That said, they were half-broken to begin with and were somewhat arbitrary.
28+
- Switch-like structures in flatSwitch now show an alternative edge from the head to the exit node.
29+
This was previously missing.
30+
- Thick-backlinks (for loops) are now generated correctly based on loop detection.
3531

3632
## [0.0.4] - 2024-09-10
3733

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@ Note that the demo only supports a single function and ignores the cursor locati
1818

1919
## Supported Languages
2020

21-
- Go
22-
- C
23-
- Python (experimental, only in the [interactive demo](https://tmr232.github.io/function-graph-overview/?language=2))
24-
- Since this adds _a lot_ of new visualization types, this is marked "experimental"
25-
as it is very likely to change.
21+
- [Go](https://tmr232.github.io/function-graph-overview/?language=0)
22+
- [C](https://tmr232.github.io/function-graph-overview/?language=1)
23+
- [Python](https://tmr232.github.io/function-graph-overview/?language=2)
2624

2725
## Development
2826

package.json

Lines changed: 1 addition & 1 deletion
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.4",
62+
"version": "0.0.5",
6363
"description": "Function Graph Overview",
6464
"displayName": "Function Graph Overview",
6565
"icon": "./media/icon.png",

src/vscode/extension.ts

Lines changed: 10 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 {
@@ -24,11 +25,17 @@ const supportedLanguages: SupportedLanguage[] = [
2425
language: "Go" as Language,
2526
parserName: "tree-sitter-go.wasm",
2627
},
28+
{
29+
languageId: "python",
30+
language: "Python" as Language,
31+
parserName: "tree-sitter-python.wasm",
32+
},
2733
];
2834

2935
const functionNodeTypes: { [key: string]: string[] } = {
3036
go: ["function_declaration", "method_declaration", "func_literal"],
3137
c: ["function_definition"],
38+
python: ["function_definition"],
3239
};
3340

3441
const supportedLanguageIds = supportedLanguages.map((lang) => lang.languageId);
@@ -176,7 +183,7 @@ export async function activate(context: vscode.ExtensionContext) {
176183
.getConfiguration("functionGraphOverview")
177184
.get("simplify")
178185
) {
179-
cfg = simplifyCFG(cfg);
186+
cfg = simplifyCFG(cfg, mergeNodeAttrs);
180187
}
181188
const dot = graphToDot(cfg);
182189
const svg = graphviz.dot(dot);
@@ -189,7 +196,7 @@ export async function activate(context: vscode.ExtensionContext) {
189196
}
190197

191198
// This method is called when your extension is deactivated
192-
export function deactivate() {}
199+
export function deactivate() { }
193200

194201
//------------------------------------------------
195202

@@ -198,7 +205,7 @@ class OverviewViewProvider implements vscode.WebviewViewProvider {
198205

199206
private _view?: vscode.WebviewView;
200207

201-
constructor(private readonly _extensionUri: vscode.Uri) {}
208+
constructor(private readonly _extensionUri: vscode.Uri) { }
202209

203210
public setSVG(svg: string) {
204211
if (this._view) {

0 commit comments

Comments
 (0)