Skip to content

Commit

Permalink
Fix check not getting formatted in binary expr
Browse files Browse the repository at this point in the history
  • Loading branch information
NipunaMarcus committed Jun 22, 2019
1 parent cbf62c2 commit 9e0cc42
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ public void formatBinaryExprNode(JsonObject node) {
// Handle left expression whitespaces.
if (node.has("leftExpression")) {
node.getAsJsonObject("leftExpression").add(FormattingConstants.FORMATTING_CONFIG, formatConfig);
node.getAsJsonObject("leftExpression").addProperty(FormattingConstants.IS_EXPRESSION, true);
}

// Handle right expression whitespaces.
Expand All @@ -440,6 +441,7 @@ public void formatBinaryExprNode(JsonObject node) {
JsonObject rightExprFormatConfig = this.getFormattingConfig(0, 1, 0, false,
this.getWhiteSpaceCount(indentWithParentIndentation), true);
rightExpression.add(FormattingConstants.FORMATTING_CONFIG, rightExprFormatConfig);
rightExpression.addProperty(FormattingConstants.IS_EXPRESSION, true);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,13 @@ check
parse(num)
;
return x * 10;
}

public function test1() returns string | error {
return "";
}

public function test2() returns error? {
string sd = check name();
io:println("Response from organization count query from DB: " +check test1());
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,12 @@ function scale5(string num) returns int | error {
;
return x * 10;
}

public function test1() returns string | error {
return "";
}

public function test2() returns error? {
string sd = check name();
io:println("Response from organization count query from DB: " + check test1());
}

0 comments on commit 9e0cc42

Please sign in to comment.