WI-35278 Make easier to distinguish PHP and JS debugger in Debug/Run menu

This commit is contained in:
Svetlana.Zemlyanskaya
2018-03-02 16:19:02 +01:00
parent 458bc4cd16
commit c67112d0bd
3 changed files with 16 additions and 3 deletions
@@ -56,6 +56,7 @@ public abstract class LocatableConfigurationBase extends RunConfigurationBase im
@Nullable
public String getActionName() {
String name = getName();
return name.length() < 20 ? name : name.substring(0, 20) + "...";
final String shortName = name.length() < 20 ? name : name.substring(0, 20) + "...";
return shortName + getPresentableType();
}
}
@@ -8,6 +8,9 @@ import com.intellij.execution.runners.ProgramRunner;
import com.intellij.openapi.actionSystem.DataKey;
import com.intellij.openapi.options.SettingsEditor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.PlatformUtils;
import com.intellij.util.xmlb.annotations.Transient;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -111,6 +114,15 @@ public interface RunConfiguration extends RunProfile, Cloneable {
return System.identityHashCode(this);
}
@NotNull
@Transient
default String getPresentableType() {
if (PlatformUtils.isPhpStorm()) {
return " (" + StringUtil.first(getType().getDisplayName(), 10, true) + ")";
}
return "";
}
/**
* Checks whether the run configuration settings are valid.
* Note that this check may be invoked on every change (i.e. after each character typed in an input field).
@@ -353,7 +353,7 @@ public class ChooseRunConfigurationPopup implements ExecutorProvider {
@Override
public String getText() {
return Executor.shortenNameIfNeed(getValue().getName());
return Executor.shortenNameIfNeed(getValue().getName()) + getValue().getConfiguration().getPresentableType();
}
@Override
@@ -1076,7 +1076,7 @@ public class ChooseRunConfigurationPopup implements ExecutorProvider {
@Override
public String getText() {
return Executor.shortenNameIfNeed(configuration.getName());
return Executor.shortenNameIfNeed(configuration.getName()) + configuration.getConfiguration().getPresentableType();
}
@Override