mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
SSR: show variable name instead of filename in log
This commit is contained in:
+4
-1
@@ -3,8 +3,11 @@ package com.intellij.structuralsearch.impl.matcher.predicates;
|
||||
|
||||
import com.intellij.notification.NotificationType;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.structuralsearch.plugin.ui.UIUtil;
|
||||
|
||||
import static com.intellij.structuralsearch.impl.matcher.predicates.ScriptSupport.UUID;
|
||||
|
||||
/**
|
||||
* @author Bas Leijdekkers
|
||||
*/
|
||||
@@ -36,7 +39,7 @@ public class ScriptLog {
|
||||
for (StackTraceElement e : stackTrace) {
|
||||
final String methodName = e.getMethodName();
|
||||
if ("run".equals(methodName)) {
|
||||
location = "(" + e.getFileName() + ":" + e.getLineNumber() + ") ";
|
||||
location = "(" + StringUtil.replace(e.getFileName(), UUID + ".groovy", "") + ":" + e.getLineNumber() + ") ";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-2
@@ -24,7 +24,10 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Maxim.Mossienko
|
||||
@@ -35,7 +38,7 @@ public class ScriptSupport {
|
||||
* We use a randomly generated uuid for this, so the chance of accidental collision with an existing variable name is extremely small.
|
||||
* This also enables to filter out this uuid from Groovy error messages, to clarify for which SSR variable the script failed.
|
||||
*/
|
||||
private static final String UUID = "a3cd264774bf4efb9ab609b250c5165c";
|
||||
static final String UUID = "a3cd264774bf4efb9ab609b250c5165c";
|
||||
|
||||
private final Script script;
|
||||
private final ScriptLog myScriptLog;
|
||||
|
||||
Reference in New Issue
Block a user