markw65 / prettier-extension-monkeyc

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

using statements are not supported #13

Closed sudface closed 1 year ago

sudface commented 1 year ago

Hi! Trying to optimise my program with the extension throws an error, because it doesn't appear to recognise the "using" keyword. I've attached a screenshot below.

In the prettier plugin, using statements do appear to be recognised (v1.0.10) but they don't seem to work with the optimiser extension. I suspect that the issue could also be because my using statement is inside the main class, not outside?

Cheers, Sudarshan

image

markw65 commented 1 year ago

Interesting, I remember testing this, and thinking that import/using were not allowed at Class scope - so I assumed this was a change in behavior. But I've tried with old sdks, and they all seem to accept it.

Shouldn't be too hard to fix. But yes, moving the using's out of the Class should work for now...

markw65 commented 1 year ago

In the prettier plugin, using statements do appear to be recognised (v1.0.10)

That's a very old version of the plugin. But as far as I can tell it doesn't accept using/import inside a class either - I get errors when I try to format such code using prettier.

But the fix to the plugin was trivial. I've just published a fix (v1.0.52). Hopefully the fixing the extension will be similarly straightforward.

markw65 commented 1 year ago

Fixed by f7a3d278ecd0f60ce7b0d993788425d298f87c21, and released as v2.0.71

sudface commented 1 year ago

Legend, all working now! The Monkey C language documentation really is a funny thing.