From 769450b07a7598898d873e1567927f0ee8e8e9bf Mon Sep 17 00:00:00 2001 From: giraud Date: Thu, 20 Sep 2018 19:44:47 +0200 Subject: [PATCH] #67 - reproduced the intention problem in a test --- .../intention/FunctionBracesIntention.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/com/reason/ide/intention/FunctionBracesIntention.java diff --git a/tests/com/reason/ide/intention/FunctionBracesIntention.java b/tests/com/reason/ide/intention/FunctionBracesIntention.java new file mode 100644 index 000000000..6255b00e7 --- /dev/null +++ b/tests/com/reason/ide/intention/FunctionBracesIntention.java @@ -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) => 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 => 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); }) );"); + } +} \ No newline at end of file