Skip to content

Commit 186820c

Browse files
authored
Merge branch 'master' into show-exceptions
2 parents 9b5248f + d29f42a commit 186820c

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

pytrace-generator/main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import sys
1313
import traceback
1414
import types
15+
import typing
1516

1617
def eprint(*args, **kwargs):
1718
print(*args, file=sys.stderr, **kwargs)
@@ -30,6 +31,7 @@ def eprint(*args, **kwargs):
3031
str: "str",
3132
type(None): "none",
3233
type: "type",
34+
typing.TypeAliasType: "type",
3335
types.FunctionType: "function"
3436
}
3537
HEAP_TYPES = {
@@ -121,6 +123,8 @@ def format(self):
121123
if search_result is not None:
122124
type_name = f"<class '{search_result.group(1)}'>"
123125
d["value"] = type_name
126+
elif type(d["value"]) == typing.TypeAliasType:
127+
d["value"] = "<TypeAlias>"
124128
elif inspect.isfunction(d["value"]):
125129
function_desc = str(d["value"])
126130
search_result = function_str_regex.search(function_desc)

src/programflow-visualization/frontend/frontend.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { VisualizationPanel } from './visualization_panel';
33
import { MessagePort } from 'worker_threads';
44
import * as TraceCache from '../trace_cache';
55

6+
let panel: VisualizationPanel | undefined = undefined;
7+
68
export async function startFrontend(
79
context: ExtensionContext,
810
filePath: string,
@@ -13,7 +15,8 @@ export async function startFrontend(
1315
trace = await TraceCache.getTrace(context, fileHash);
1416
}
1517

16-
const panel = await VisualizationPanel.getVisualizationPanel(context, filePath, fileHash, trace, tracePort);
18+
panel?.dispose();
19+
panel = await VisualizationPanel.getVisualizationPanel(context, filePath, fileHash, trace, tracePort);
1720
if (!panel) {
1821
return failure("Frontend couldn't be initialized!");
1922
}

src/programflow-visualization/frontend/visualization_panel.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ export class VisualizationPanel {
112112
});
113113
}
114114

115+
public dispose() {
116+
this._panel?.dispose();
117+
}
118+
115119
public static async getVisualizationPanel(
116120
context: vscode.ExtensionContext,
117121
filePath: string,

0 commit comments

Comments
 (0)