ols icon indicating copy to clipboard operation
ols copied to clipboard

Put shorter variable attributes on one line with the attribute target

Open renpenguin opened this issue 1 year ago • 1 comments

Currently, ols formats @static x := 3 to:

@(static)
x := 3

which, for such a short decorator, is unnecessary. ols should (by default, or as an option) format attributes to appear on the same line as their target, as well as dropping parenthesis when no arguments are passed (as shown in the https://odin-lang.org/docs/overview/#private example)

renpenguin avatar Jun 28 '24 02:06 renpenguin

Yes that should be the default.

DanielGavin avatar Jun 29 '24 22:06 DanielGavin

i think there should be an option for ols to instead format it as:

@static x := 3

renpenguin avatar Jul 17 '24 13:07 renpenguin

Maybe you misunderstood me. The default should be @static x := 3 for variables with no other attributes in the variables, and that have short variable names.

I just need to implement it as some point.

DanielGavin avatar Jul 17 '24 18:07 DanielGavin

ah you meant should be as in should be implemented? i see, i was a bit confused by the wording

renpenguin avatar Jul 17 '24 21:07 renpenguin

Fixed. It should now be able to be one lined.

DanielGavin avatar Aug 12 '24 10:08 DanielGavin