formatter_test.md: link to src + specific method

This commit is contained in:
Yann Cébron 2021-06-23 17:14:00 +02:00
parent a72b2ea89c
commit bf6a7b958d

View File

@ -21,19 +21,8 @@ Add the `testFormatter()` method to the `SimpleCodeInsightTest` class [previousl
* The formatted file is compared to the expected results in the benchmark file `DefaultTestData.simple`.
```java
public void testFormatter() {
myFixture.configureByFile("FormatterTestData.simple");
CodeStyle.getLanguageSettings(myFixture.getFile()).SPACE_AROUND_ASSIGNMENT_OPERATORS = true;
CodeStyle.getLanguageSettings(myFixture.getFile()).KEEP_BLANK_LINES_IN_CODE = 2;
WriteCommandAction.writeCommandAction(getProject()).run(() ->
CodeStyleManager.getInstance(getProject()).reformatText(
myFixture.getFile(),
ContainerUtil.newArrayList(myFixture.getFile().getTextRange())
)
);
myFixture.checkResultByFile("DefaultTestData.simple");
}
```
{src="simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleCodeInsightTest.java" include-symbol="testFormatter"}
## Run the Test
[Run](completion_test.md#run-the-test) the test and make sure it's green.