In Haxe, braces around function bodies are optional in case the body is a single expression.
E.g. the following is valid code
static function formatEvenness(i:Int):String
return i % 2 == 0
? "even"
: "odd";
However it seems support for this style was never added to FD.
E.g. trying to write code like this (note that _ represents the caret, not the _ character):
package;
class Main {
var str:String;
function foo()
st_
}
Press Ctrl-Space.
Expected: str offered as completion.
Actual: static offered as completion and other keywords suitable for class members, line is unindented one level. It's clear that FD thinks we're still in the class context, not inside the body of function foo as should be the case.
This is quite serious limitation when working with code written in this avoid-unnecessary-braces style.
In Haxe, braces around function bodies are optional in case the body is a single expression. E.g. the following is valid code
However it seems support for this style was never added to FD. E.g. trying to write code like this (note that
_
represents the caret, not the_
character):Press Ctrl-Space. Expected:
str
offered as completion. Actual:static
offered as completion and other keywords suitable for class members, line is unindented one level. It's clear that FD thinks we're still in the class context, not inside the body offunction foo
as should be the case.This is quite serious limitation when working with code written in this avoid-unnecessary-braces style.