@@ -6,6 +6,7 @@ import { Graphviz } from "@hpcc-js/wasm-graphviz";
66import { graphToDot } from "../control-flow/render" ;
77import { simplifyCFG , trimFor } from "../control-flow/graph-ops" ;
88import { newCFGBuilder , type Language } from "../control-flow/cfg" ;
9+ import { mergeNodeAttrs } from "../control-flow/cfg-defs" ;
910
1011let graphviz : Graphviz ;
1112interface 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
2935const functionNodeTypes : { [ key : string ] : string [ ] } = {
3036 go : [ "function_declaration" , "method_declaration" , "func_literal" ] ,
3137 c : [ "function_definition" ] ,
38+ python : [ "function_definition" ] ,
3239} ;
3340
3441const 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