Skip to content

Commit

Permalink
#67 - reproduced the intention problem in a test
Browse files Browse the repository at this point in the history
  • Loading branch information
giraud committed Sep 20, 2018
1 parent 7e08000 commit 769450b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/com/reason/ide/intention/FunctionBracesIntention.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.reason.ide.intention;

import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase;
import com.reason.ide.files.RmlFileType;

public class FunctionBracesIntention extends LightPlatformCodeInsightFixtureTestCase {
public void testBasic() {
myFixture.configureByText(RmlFileType.INSTANCE, "let add = (x, y) => <caret>x + y;");
IntentionAction bracesAction = (IntentionAction) myFixture.getAvailableIntention("Add braces to blockless function");
myFixture.launchAction(bracesAction);
myFixture.checkResult("let add = (x, y) => { x + y; };");
}

// https://github.com/reasonml-editor/reasonml-idea-plugin/issues/67
public void testInnerFunction() {
myFixture.configureByText(RmlFileType.INSTANCE, "Js.Promise.( Api.all() |> then_(result => <caret>Js.log(result)) );");
IntentionAction bracesAction = (IntentionAction) myFixture.getAvailableIntention("Add braces to blockless function");
// myFixture.launchAction(bracesAction);
// myFixture.checkResult("Js.Promise.( Api.all() |> then_(result => { Js.log(result); }) );");
}
}

0 comments on commit 769450b

Please sign in to comment.