markw65 / prettier-extension-monkeyc

A VSCode extension for Garmin MonkeyC
MIT License
12 stars 1 forks source link

Multiple exclude annotations appear as syntax error #5

Closed andrezunido closed 2 years ago

andrezunido commented 2 years ago

Hi Mark,

I've installed your extension as it appears very promising (I usually do these optimisations manually). But after installation I noticed that functions with more than one exclude annotation appear as syntax errors, see: example

    // Renders grid for stats text in circular screen devices
    (:circle_screen :high_mem)
    function updateStatsGfx(dc) {
        dc.setColor(0xFFFFFF, 0x000000);
        dc.fillCircle(screen_center_pos[0], screen_center_pos[1], (screen_size_px/2));
        dc.setColor(0x000000, 0x000000);
        dc.fillCircle(screen_center_pos[0], screen_center_pos[1], (screen_size_px/2)-(screen_size_px*0.01));

        dc.setColor(0xFFFFFF, 0x000000);
        dc.fillRectangle(0, screen_size_px*0.235, screen_size_px, screen_size_px*0.01);
        dc.fillRectangle(0, screen_size_px*0.495, screen_size_px, screen_size_px*0.01);
        dc.fillRectangle(0, screen_size_px*0.775, screen_size_px, screen_size_px*0.01);
    }

The ":high_mem" annotation will be flag as a syntax error.

markw65 commented 2 years ago

Thanks - I actually thought it was a syntax error. All the examples I've found do (:circle_screen,:high_mem) (with a comma, rather than a space), and looking through the documentation I can't actually find an example with more than one annotation.

But you're right, the compiler does accept a space there, and behaves the same as a comma. I'll upload a fix shortly.

Meanwhile, the quick fix is to use a comma there...

markw65 commented 2 years ago

This is fixed in v2.0.28

andrezunido commented 2 years ago

I'll test ASAP, thanks for the speedy fix!

andrezunido commented 2 years ago

Worked great! Thanks!