From 6384d17f8dcf4bfa1b7d0b2e4c5a7c7fdc83c5ac Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Wed, 16 Feb 2022 21:24:24 -0800 Subject: [PATCH] feat(jsx): provide locator hints while debugging jsx --- .vscode/launch.json | 2 +- src/babelHighlightUtil.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 7d1ec8d73..1a362af23 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,7 +12,7 @@ "runtimeExecutable": "${execPath}", "args": [ "--extensionDevelopmentPath=${workspaceFolder}", - "${workspaceFolder}/../playwright/examples/todomvc" + "${workspaceFolder}/../playwright" ], "outFiles": [ "${workspaceFolder}/out/*.js" diff --git a/src/babelHighlightUtil.ts b/src/babelHighlightUtil.ts index 19d275f71..f463eebdb 100644 --- a/src/babelHighlightUtil.ts +++ b/src/babelHighlightUtil.ts @@ -32,7 +32,7 @@ export function locatorForSourcePosition(text: string, vars: { pages: string[], const cached = astCache.get(fsPath); let ast = cached?.ast; if (!cached || cached.text !== text) { - ast = parse(text, { errorRecovery: true, plugins: ['typescript'], sourceType: 'module' }); + ast = parse(text, { errorRecovery: true, plugins: ['typescript', 'jsx'], sourceType: 'module' }); astCache.set(fsPath, { text, ast }); }