binaryage / binaryage/dirac

Inline breakpoints

Open
#64 0 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
Clojure
Stars
776
Forks
29
PR merge metrics
No merged PRs in 30d

Description

DevTools have this[1] new cool feature called "inline breakpoints".

Unfortunately it is implemented in a way which does not work well with source-mapped clojurescript-generated javascript code. I'm not sure where exactly their code fails but from brief review of the code it looks like they assume lines are fundamental code blocks for scanning for possible breakpoints. While this is true in javascript, it is not the case in clojurescript-generated javascript code. Typically one form in clojurescript code can span multiple lines and compiles into many more lines of javascript. Detection of possible breakpoints examines only first line (or first few lines) of generated javascript code which is usually not sufficient. There may be also some woes caused by source-mapping.

We should examine possibility of fixing this. I believe all low-level tools are available, we just need to scan whole raw source code generated for selected form. For example placing a breakpoint into gutter at some line, we should detect outer-most cljs form beginning on that line, properly find its end possibly many lines down from it. Then map both to raw javascript locations to get proper range for possible breakpoints scan. Then we must make sure that detected possible breakpoints are properly presented in the UI.

[1] https://umaar.com/dev-tips/129-inline-breakpoints/

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.