To find the matching expression for a token position the preview uses `findBestMatchExpression` on the parserWorker https://searchfox.org/mozilla-central/rev/f465027ef4d334dbc9ad270718c8a5e8045e7a2b/devtools/client/debugger/src/actions/preview.js#29-32. It falls back to `getExpressionFromCoords` https://searchfox.org/mozilla-central/rev/f465027ef4d334dbc9ad270718c8a5e8045e7a2b/devtools/client/debugger/src/actions/preview.js#36 which uses the codemirror api to match the expressions. Did a quick patch to use `getExpressionFromCoords` by default and is looking good. I think
Bug 1874656 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
To find the matching expression for a token position the preview uses `findBestMatchExpression` on the parserWorker https://searchfox.org/mozilla-central/rev/f465027ef4d334dbc9ad270718c8a5e8045e7a2b/devtools/client/debugger/src/actions/preview.js#29-32. It falls back to `getExpressionFromCoords` https://searchfox.org/mozilla-central/rev/f465027ef4d334dbc9ad270718c8a5e8045e7a2b/devtools/client/debugger/src/actions/preview.js#36 which uses the codemirror api to match the expressions. Did a quick patch to use `getExpressionFromCoords` by default and is looking good. Lets try to move away from using `parserWorker.findBestMatchExpression` to `getExpressionFromCoords` and should give some performance wins.
To find the matching expression for a token position the preview uses `findBestMatchExpression` on the parserWorker https://searchfox.org/mozilla-central/rev/f465027ef4d334dbc9ad270718c8a5e8045e7a2b/devtools/client/debugger/src/actions/preview.js#29-32. It falls back to `getExpressionFromCoords` https://searchfox.org/mozilla-central/rev/f465027ef4d334dbc9ad270718c8a5e8045e7a2b/devtools/client/debugger/src/actions/preview.js#36 which uses the codemirror api to match the expressions. Lets try to move from using `parserWorker.findBestMatchExpression` to a utility based on the lezer parser which should give some performance.wins.