Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Commit

Permalink
Merge pull request #293 from Shan1024/fix-formattting-issues
Browse files Browse the repository at this point in the history
Fix formatting issue
  • Loading branch information
uthaiyashankar authored May 17, 2017
2 parents a9d982d + 9bafae7 commit 344cad3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void handleInsert(InsertionContext context, LookupElement item) {
Project project = editor.getProject();
if (project != null) {
if (!isCompletionCharAtSpace(editor)) {
EditorModificationUtil.insertStringAtCaret(editor, "();",false,1);
EditorModificationUtil.insertStringAtCaret(editor, "()",false,1);
PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument());
} else {
editor.getCaretModel().moveToOffset(editor.getCaretModel().getOffset() + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public FormattingModel createModel(PsiElement element, CodeStyleSettings setting

private static SpacingBuilder createSpaceBuilder(CodeStyleSettings settings) {
return new SpacingBuilder(settings, BallerinaLanguage.INSTANCE)
.around(OPERATORS).spaceIf(true)
.before(ALL).spaceIf(false)
.after(ALL).spaceIf(true)
.before(ANY).spaceIf(false)
Expand Down Expand Up @@ -119,8 +120,7 @@ private static SpacingBuilder createSpaceBuilder(CodeStyleSettings settings) {
.between(RBRACE, GT).spaceIf(false)
.between(RBRACE, XML_LOCAL_NAME).spaceIf(true)
.between(XML_LOCAL_NAME, GT).spaceIf(false)
.between(NAME_REFERENCE, LBRACE).spaceIf(true)
.around(OPERATORS).spaceIf(true);
.between(NAME_REFERENCE, LBRACE).spaceIf(true);
}

@Nullable
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/BallerinaCompletionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ public void testFunctionBodyWithFunctionLevelKeywords() {
public void testInvokingFunctionInDifferentFile1() {
myFixture.addFileToProject("file.bal", "function test(){}");
doCheckResult("test.bal", "function main(string[] args){ tes<caret> }",
"function main(string[] args){ test(); }", null);
"function main(string[] args){ test() }", null);
}

public void testInvokingFunctionInDifferentFile2() {
Expand Down

0 comments on commit 344cad3

Please sign in to comment.