Open
Description
Currently, Bracket Expression Parsers can return any ParsedExpression and the information about the bracket expression is lost during the parsing.
Therefore, when using the code-formatter, the Bracket Expressions are replaced by their Parsed-Expression equivalent, which is not optimal for formatting scripts.
Example:
println(<item:minecraft:bedrock>.commandString);
// becomes after a re-format
println(BracketHandlers.getItem("minecraft:bedrock").commandString);
Possible Fixes/Ideas:
- Optionally attach a custom Tag to Parsed expressions which will be used in the code-formatter if present.
return expression.hasTag(FormattingInfo.class) ? expression.getTag(FormattingInfo.class).format() : expression.accept(formatterVisitor);