Skip to content

Commit 3589f68

Browse files
pfitzsebjkrumbiegel
andcommitted
better debugger buttons
Co-authored-by: Julius Krumbiegel <[email protected]>
1 parent 464e173 commit 3589f68

File tree

2 files changed

+81
-5
lines changed

2 files changed

+81
-5
lines changed

lib/runtime/debugger.js

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,72 @@ const { debugfile, module: getmodule } = client.import(['debugfile', 'module'])
1414

1515
let active, stepper, subs, breakpoints, debuggerPane, ink
1616

17+
const buttonSVGs = {
18+
'step-in': `
19+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80">
20+
<line x1="33.33" y1="20" x2="73.33" y2="20" style="fill:none;stroke:var(--color);stroke-miterlimit:10;stroke-width:8px"/>
21+
<line x1="33.33" y1="33.33" x2="73.33" y2="33.33" style="fill:none;stroke:var(--color);stroke-miterlimit:10;stroke-width:8px"/>
22+
<line x1="53.33" y1="46.67" x2="73.33" y2="46.67" style="fill:none;stroke:var(--color);stroke-miterlimit:10;stroke-width:8px"/>
23+
<polyline points="20 13.33 20 53.33 33.11 53.33" style="fill:none;stroke:var(--color);stroke-miterlimit:10;stroke-width:8px"/>
24+
<polygon points="29.61 65.3 50.33 53.34 29.61 41.37 29.61 65.3" style="fill:var(--color)"/>
25+
<line x1="53.33" y1="60" x2="73.33" y2="60" style="fill:none;stroke:var(--color);stroke-miterlimit:10;stroke-width:8px"/>
26+
</svg>
27+
`,
28+
'step-out': `
29+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80">
30+
<line x1="40" y1="46.67" x2="73.33" y2="46.67" style="fill:none;stroke:var(--color);stroke-miterlimit:10;stroke-width:8px"/>
31+
<line x1="40" y1="60" x2="73.33" y2="60" style="fill:none;stroke:var(--color);stroke-miterlimit:10;stroke-width:8px"/>
32+
<line x1="53.33" y1="20" x2="73.33" y2="20" style="fill:none;stroke:var(--color);stroke-miterlimit:10;stroke-width:8px"/>
33+
<polyline points="46.67 26.67 20 26.67 20 49.45" style="fill:none;stroke:var(--color);stroke-miterlimit:10;stroke-width:8px"/>
34+
<polygon points="8.03 45.94 20 66.67 31.97 45.94 8.03 45.94" style="fill:var(--color)"/>
35+
<line x1="53.33" y1="33.33" x2="73.33" y2="33.33" style="fill:none;stroke:var(--color);stroke-miterlimit:10;stroke-width:8px"/>
36+
</svg>
37+
`,
38+
'step-to-selection': `
39+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80">
40+
<line x1="40" y1="20" x2="73.33" y2="20" style="fill:none;stroke:var(--color);stroke-miterlimit:10;stroke-width:8px"/>
41+
<line x1="40" y1="33.33" x2="73.33" y2="33.33" style="fill:none;stroke:var(--color);stroke-miterlimit:10;stroke-width:8px"/>
42+
<line x1="20" y1="13.33" x2="20" y2="49.44" style="fill:none;stroke:var(--color);stroke-miterlimit:10;stroke-width:8px"/>
43+
<polygon points="8.03 45.94 20 66.67 31.97 45.94 8.03 45.94" style="fill:var(--color)"/>
44+
<line x1="40" y1="46.67" x2="73.33" y2="46.67" style="fill:none;stroke:var(--color-highlight);stroke-miterlimit:10;stroke-width:8px"/>
45+
<line x1="20" y1="13.33" x2="20" y2="49.44" style="fill:none;stroke:var(--color);stroke-miterlimit:10;stroke-width:8px"/>
46+
<polygon points="8.03 45.94 20 66.67 31.97 45.94 8.03 45.94" style="fill:var(--color)"/>
47+
<line x1="73.33" y1="60" x2="40" y2="60" style="fill:none;stroke:var(--color-subtle);stroke-miterlimit:10;stroke-width:8px"/>
48+
</svg>
49+
`,
50+
'step-line': `
51+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80">
52+
<line x1="40" y1="20" x2="73.33" y2="20" style="fill:none;stroke:var(--color);stroke-miterlimit:10;stroke-width:8px"/>
53+
<line x1="40" y1="33.33" x2="73.33" y2="33.33" style="fill:none;stroke:var(--color-subtle);stroke-miterlimit:10;stroke-width:8px"/>
54+
<line x1="40" y1="46.67" x2="73.33" y2="46.67" style="fill:none;stroke:var(--color-subtle);stroke-miterlimit:10;stroke-width:8px"/>
55+
<line x1="20" y1="13.33" x2="20" y2="49.44" style="fill:none;stroke:var(--color);stroke-miterlimit:10;stroke-width:8px"/>
56+
<polygon points="8.03 45.94 20 66.67 31.97 45.94 8.03 45.94" style="fill:var(--color)"/>
57+
<line x1="40" y1="60" x2="73.33" y2="60" style="fill:none;stroke:var(--color-subtle);stroke-miterlimit:10;stroke-width:8px"/>
58+
<line x1="20" y1="13.33" x2="20" y2="49.44" style="fill:none;stroke:var(--color);stroke-miterlimit:10;stroke-width:8px"/>
59+
<polygon points="8.03 45.94 20 66.67 31.97 45.94 8.03 45.94" style="fill:var(--color)"/>
60+
</svg>
61+
`,
62+
'step-expr': `
63+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80">
64+
<path d="M23.08,35.74V40H8.79V17.26H23.08v4.26H13.66v5.06h8.87V30.5H13.66v5.25Z" style="fill:var(--color)"/>
65+
<path d="M33.36,34.33h-.18L30.36,40H25.45l4.94-8.54-4.94-8.68h5.34l2.63,5.63h.19l2.63-5.63h5.11l-5,8.53,5,8.7H36.22Z" style="fill:var(--color)"/>
66+
<path d="M53.35,22.54a5.62,5.62,0,0,1,4.79,2.34,10.78,10.78,0,0,1,1.73,6.52,10.86,10.86,0,0,1-1.71,6.5,6,6,0,0,1-7.74,1.55,4.77,4.77,0,0,1-1.88-2.22h-.18v8.42H43.67V22.77h4.61v2.9h.18a5.05,5.05,0,0,1,1.93-2.3A5.36,5.36,0,0,1,53.35,22.54Zm-1.66,13.7a2.85,2.85,0,0,0,2.46-1.29,6.09,6.09,0,0,0,.91-3.55,6.14,6.14,0,0,0-.91-3.55,3,3,0,0,0-4.91,0,6.18,6.18,0,0,0-.93,3.54,6.17,6.17,0,0,0,.92,3.54A2.84,2.84,0,0,0,51.69,36.23Z" style="fill:var(--color)"/>
67+
<path d="M62.63,40V22.77h4.55v3h.19a4.3,4.3,0,0,1,1.41-2.35,3.82,3.82,0,0,1,2.52-.87,4.63,4.63,0,0,1,1.52.2v4.37A4.77,4.77,0,0,0,71,26.82a3.5,3.5,0,0,0-2.66,1,3.89,3.89,0,0,0-1,2.81V40Z" style="fill:var(--color)"/>
68+
<polyline points="6.67 60 33.33 60 56.69 60" style="fill:none;stroke:var(--color);stroke-miterlimit:10;stroke-width:8px"/>
69+
<polygon points="53.3 71.57 73.33 60 53.3 48.43 53.3 71.57" style="fill:var(--color)"/>
70+
</svg>
71+
`
72+
}
73+
1774
export function activate (_ink) {
1875
ink = _ink
1976
const buttons = [
2077
{icon: 'playback-fast-forward', tooltip: 'Debug: Continue', command: 'julia-debug:continue', color: 'success'},
21-
{icon: 'triangle-down', tooltip: 'Debug: Next Line', command: 'julia-debug:step-to-next-line'},
22-
{icon: 'jump-down', tooltip: 'Debug: Step to Selected Line', command: 'julia-debug:step-to-selected-line'},
23-
{icon: 'triangle-right', tooltip: 'Debug: Next Expression', command: 'julia-debug:step-to-next-expression'},
24-
{icon: 'alignment-align', tooltip: 'Debug: Step Into', command: 'julia-debug:step-into'},
25-
{icon: 'alignment-aligned-to', tooltip: 'Debug: Step Out', command: 'julia-debug:step-out'},
78+
{tooltip: 'Debug: Next Line', command: 'julia-debug:step-to-next-line', svg: buttonSVGs['step-line']},
79+
{tooltip: 'Debug: Step to Selected Line', command: 'julia-debug:step-to-selected-line', svg: buttonSVGs['step-to-selection']},
80+
{tooltip: 'Debug: Next Expression', command: 'julia-debug:step-to-next-expression', svg: buttonSVGs['step-expr']},
81+
{tooltip: 'Debug: Step Into', command: 'julia-debug:step-into', svg: buttonSVGs['step-in']},
82+
{tooltip: 'Debug: Step Out', command: 'julia-debug:step-out', svg: buttonSVGs['step-out']},
2683
{icon: 'x', tooltip: 'Debug: Stop Debugging', command: 'julia-debug:stop-debugging', color: 'error'},
2784
]
2885
const startButtons = [

styles/julia-client.less

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,22 @@ atom-text-editor.editor[data-grammar$="source weave latex"] {
163163
border-top: solid fade(@syntax-text-color, 80%) 1px;
164164
margin-top: -1px;
165165
}
166+
167+
.ink-debug-toolbar {
168+
--color: @text-color;
169+
--color-subtle: @text-color-subtle;
170+
--color-highlight: @text-color-error;
171+
172+
button {
173+
&.custom-svg-icon {
174+
display: flex;
175+
align-items: center;
176+
height: 2.5em!important;
177+
178+
svg {
179+
height: 1.6em;
180+
margin: auto;
181+
}
182+
}
183+
}
184+
}

0 commit comments

Comments
 (0)