Various Formatter Improvements - #746
Conversation
|
Breaks on lines in a multiline string: 👇 |
|
Thanks @limbonaut! That one's fixed now. |
|
An issue with quotes and unique name specifier: @onready var main_menu: Button = %"Main Menu"👇 @onready var main_menu: Button = % "Main Menu" |
|
That's all I found. Nice to see the old issues fixed, and it's shaping up to be a really solid formatter. |
| { | ||
| "name": "constant.numeric.float.gdscript", | ||
| "match": "(?x)\n (?<! \\w)(?:\n (?:\n \\.[0-9](?: _?[0-9] )*\n |\n [0-9](?: _?[0-9] )* \\. [0-9](?: _?[0-9] )*\n |\n [0-9](?: _?[0-9] )* \\.\n ) (?: [eE][+-]?[0-9](?: _?[0-9] )* )?\n |\n [0-9](?: _?[0-9] )* (?: [eE][+-]?[0-9](?: _?[0-9] )* )\n )([jJ])?\\b\n", | ||
| "captures": { "1": { "name": "storage.type.imaginary.number.gdscript" } } |
There was a problem hiding this comment.
Imaginary number with j suffix? Are complex numbers supported syntax in GDScript now?
Is there a source proposal/docs or something?
There was a problem hiding this comment.
Nope, I copied it from MagicPython and didn't notice the j's! Thanks for the catch.
There was a problem hiding this comment.
You probably want to double-check by testing whether it supports, e.g. lower and uppercase e, E and f, F suffix (I don't think there's a LF suffix, as its float is always a double). Also whether it supports _ separators and . cases like 0. or .5. Float literals syntax can vary a lot depending on the language, e.g. GDShader (or whatever it's going to be called) technically accepts even weird cases like 0.f IIRC.
This introduces a new syntax for defining snapshot tests, and fixes at least #717, #734, #728.
Snapshot tests can now be defined in a single file using "blocks":
I also FINALLY found a solution to remove leading empty newlines from blocks: