Formatting and Highlighting Fixes (#812)

Fixes #805 and #810
This commit is contained in:
David Kincaid
2025-03-04 18:56:21 -05:00
committed by GitHub
parent 34de1b64f0
commit 0203cec293
3 changed files with 12 additions and 4 deletions

View File

@@ -26,4 +26,8 @@ func f():
print(x == 1)
print(x <= 1)
print(x >= 1)
print(x >= 1)
var ij := 1
var k := -ij + 1
var m := 0 + -ij

View File

@@ -186,15 +186,15 @@ function between(tokens: Token[], current: number, options: FormatterOptions) {
if (prev === "@") return "";
if (prev === "-" || prev === "+") {
if (nextToken.identifier) return " ";
if (next === "(") return " ";
if (current === 1) return "";
if (["keyword", "symbol"].includes(tokens[current - 2]?.type)) {
return "";
}
if ([",", "(", "["].includes(tokens[current - 2]?.value)) {
return "";
}
if (nextToken.identifier) return " ";
if (current === 1) return "";
}
if (prev === ":" && next === "=") return "";

View File

@@ -272,7 +272,11 @@
"name": "constant.numeric.float.gdscript"
},
{
"match": "([0-9][0-9_]*)?\\.[0-9_]*([eE][+-]?[0-9_]+)?",
"match": "([0-9][0-9_]*)\\.[0-9_]*([eE][+-]?[0-9_]+)?",
"name": "constant.numeric.float.gdscript"
},
{
"match": "([0-9][0-9_]*)?\\.[0-9_]*([eE][+-]?[0-9_]+)",
"name": "constant.numeric.float.gdscript"
},
{