Search in sources :

Example 1 with BlockSupportImpl

use of com.intellij.psi.impl.source.text.BlockSupportImpl in project kotlin by JetBrains.

the class KtParsingTestCase method ensureCorrectReparse.

public static void ensureCorrectReparse(@NotNull PsiFile file) {
    String psiToStringDefault = DebugUtil.psiToString(file, false, false);
    String fileText = file.getText();
    DiffLog diffLog = (new BlockSupportImpl(file.getProject())).reparseRange(file, file.getNode(), TextRange.allOf(fileText), fileText, new EmptyProgressIndicator(), fileText);
    diffLog.performActualPsiChange(file);
    TestCase.assertEquals(psiToStringDefault, DebugUtil.psiToString(file, false, false));
}
Also used : EmptyProgressIndicator(com.intellij.openapi.progress.EmptyProgressIndicator) BlockSupportImpl(com.intellij.psi.impl.source.text.BlockSupportImpl) DiffLog(com.intellij.psi.impl.source.text.DiffLog)

Example 2 with BlockSupportImpl

use of com.intellij.psi.impl.source.text.BlockSupportImpl in project intellij-community by JetBrains.

the class ParsingTestCase method ensureCorrectReparse.

public static void ensureCorrectReparse(@NotNull final PsiFile file) {
    final String psiToStringDefault = DebugUtil.psiToString(file, false, false);
    final String fileText = file.getText();
    final DiffLog diffLog = new BlockSupportImpl(file.getProject()).reparseRange(file, file.getNode(), TextRange.allOf(fileText), fileText, new EmptyProgressIndicator(), fileText);
    diffLog.performActualPsiChange(file);
    TestCase.assertEquals(psiToStringDefault, DebugUtil.psiToString(file, false, false));
}
Also used : EmptyProgressIndicator(com.intellij.openapi.progress.EmptyProgressIndicator) BlockSupportImpl(com.intellij.psi.impl.source.text.BlockSupportImpl) DiffLog(com.intellij.psi.impl.source.text.DiffLog)

Aggregations

EmptyProgressIndicator (com.intellij.openapi.progress.EmptyProgressIndicator)2 BlockSupportImpl (com.intellij.psi.impl.source.text.BlockSupportImpl)2 DiffLog (com.intellij.psi.impl.source.text.DiffLog)2