!RENDER_DIAGNOSTICS_FULL_TEXT directive
Compares diagnostics rendered as text with corresponding .diag.txt file
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.cli.common.messages;
|
||||
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.utils.fileUtils.FileUtilsKt;
|
||||
@@ -69,6 +70,23 @@ public interface MessageRenderer {
|
||||
}
|
||||
};
|
||||
|
||||
MessageRenderer SYSTEM_INDEPENDENT_RELATIVE_PATHS = new PlainTextMessageRenderer() {
|
||||
private final File cwd = new File(".").getAbsoluteFile();
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected String getPath(@NotNull CompilerMessageLocation location) {
|
||||
return FileUtil.toSystemIndependentName(
|
||||
FileUtilsKt.descendantRelativeTo(new File(location.getPath()), cwd).getPath()
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "SystemIndependentRelativePath";
|
||||
}
|
||||
};
|
||||
|
||||
MessageRenderer GRADLE_STYLE = new GradleStyleMessageRenderer();
|
||||
|
||||
String renderPreamble();
|
||||
|
||||
Reference in New Issue
Block a user