Skip to content

Commit

Permalink
Merge pull request #10 from tmr232/release-0.0.5
Browse files Browse the repository at this point in the history
Release 0.0.5
  • Loading branch information
tmr232 authored Sep 18, 2024
2 parents e493040 + e2a0c49 commit 6f250d2
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 26 deletions.
30 changes: 13 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,28 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how

## [Unreleased]

### Language Support
## [0.0.5] - 2024-09-18

- Add initial support for Python

### Visualization

- Add support for node clusters. This is used heavily in Python, for context-managers and exception-handling.

### Demo
### Added

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

### Testing
#### Testing

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

### Extension

- No changes

### Known Issues
### Fixed

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

## [0.0.4] - 2024-09-10

Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ Note that the demo only supports a single function and ignores the cursor locati

## Supported Languages

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

## Development

Expand Down
2 changes: 1 addition & 1 deletion 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.4",
"version": "0.0.5",
"description": "Function Graph Overview",
"displayName": "Function Graph Overview",
"icon": "./media/icon.png",
Expand Down
13 changes: 10 additions & 3 deletions src/vscode/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Graphviz } from "@hpcc-js/wasm-graphviz";
import { graphToDot } from "../control-flow/render";
import { simplifyCFG, trimFor } from "../control-flow/graph-ops";
import { newCFGBuilder, type Language } from "../control-flow/cfg";
import { mergeNodeAttrs } from "../control-flow/cfg-defs";

let graphviz: Graphviz;
interface SupportedLanguage {
Expand All @@ -24,11 +25,17 @@ const supportedLanguages: SupportedLanguage[] = [
language: "Go" as Language,
parserName: "tree-sitter-go.wasm",
},
{
languageId: "python",
language: "Python" as Language,
parserName: "tree-sitter-python.wasm",
},
];

const functionNodeTypes: { [key: string]: string[] } = {
go: ["function_declaration", "method_declaration", "func_literal"],
c: ["function_definition"],
python: ["function_definition"],
};

const supportedLanguageIds = supportedLanguages.map((lang) => lang.languageId);
Expand Down Expand Up @@ -176,7 +183,7 @@ export async function activate(context: vscode.ExtensionContext) {
.getConfiguration("functionGraphOverview")
.get("simplify")
) {
cfg = simplifyCFG(cfg);
cfg = simplifyCFG(cfg, mergeNodeAttrs);
}
const dot = graphToDot(cfg);
const svg = graphviz.dot(dot);
Expand All @@ -189,7 +196,7 @@ export async function activate(context: vscode.ExtensionContext) {
}

// This method is called when your extension is deactivated
export function deactivate() {}
export function deactivate() { }

//------------------------------------------------

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

private _view?: vscode.WebviewView;

constructor(private readonly _extensionUri: vscode.Uri) {}
constructor(private readonly _extensionUri: vscode.Uri) { }

public setSVG(svg: string) {
if (this._view) {
Expand Down

0 comments on commit 6f250d2

Please sign in to comment.