Rename: analyzeWithDeclarations --> analyzeWithContent()
This commit is contained in:
+2
-2
@@ -10,7 +10,7 @@ import com.intellij.psi.PsiFile
|
||||
import com.intellij.testFramework.UsefulTestCase
|
||||
import org.jetbrains.kotlin.diagnostics.Severity
|
||||
import org.jetbrains.kotlin.diagnostics.rendering.DefaultErrorMessages
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.analyzeWithDeclarations
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.analyzeWithContent
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.test.InTextDirectivesUtils
|
||||
|
||||
@@ -22,7 +22,7 @@ object DirectiveBasedActionUtils {
|
||||
|
||||
val expectedErrors = InTextDirectivesUtils.findLinesWithPrefixesRemoved(file.text, "// ERROR:").sorted()
|
||||
|
||||
val actualErrors = file.analyzeWithDeclarations().diagnostics
|
||||
val actualErrors = file.analyzeWithContent().diagnostics
|
||||
.filter { it.getSeverity() == Severity.ERROR }
|
||||
.map { DefaultErrorMessages.render(it).replace("\n", "<br>") }
|
||||
.sorted()
|
||||
|
||||
@@ -32,7 +32,7 @@ import com.intellij.util.Consumer
|
||||
import org.jetbrains.kotlin.diagnostics.Severity
|
||||
import org.jetbrains.kotlin.diagnostics.rendering.DefaultErrorMessages
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.LibraryModificationTracker
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.analyzeWithDeclarations
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.analyzeWithContent
|
||||
import org.jetbrains.kotlin.idea.decompiler.KotlinDecompiledFileViewProvider
|
||||
import org.jetbrains.kotlin.idea.decompiler.KtDecompiledFile
|
||||
import org.jetbrains.kotlin.idea.util.application.runWriteAction
|
||||
@@ -73,7 +73,7 @@ fun Module.configureAs(kind: ModuleKind) {
|
||||
}
|
||||
|
||||
fun KtFile.dumpTextWithErrors(): String {
|
||||
val diagnostics = analyzeWithDeclarations().diagnostics
|
||||
val diagnostics = analyzeWithContent().diagnostics
|
||||
val errors = diagnostics.filter { it.severity == Severity.ERROR }
|
||||
if (errors.isEmpty()) return text
|
||||
val header = errors.map { "// ERROR: " + DefaultErrorMessages.render(it).replace('\n', ' ') }.joinToString("\n", postfix = "\n")
|
||||
|
||||
Reference in New Issue
Block a user