Commit fedefae
committed
Fix leaf-function extraction dropping part of the label
pv_print_hot_paths() stripped the trailing " (file:line)" from a stack
entry with sub(" \\(.*\\)$", "", x). The greedy .* begins at the first
" (" in the string, so any label containing a space before an open paren
lost that part too:
"if (x > 1) (file.R:3)" -> "if"
The truncated name then fed is_user_function() and the pv_focus(p, "...")
next-step suggestion, which could name a function that does not exist.
Extracted strip_location() into utils.R, anchored on the file:line shape,
which the location always has and a label never does.1 parent 65307c8 commit fedefae
3 files changed
Lines changed: 22 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
143 | 151 | | |
144 | 152 | | |
145 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
0 commit comments