Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: drop 213: Remove unused Scala compatibility methods #6688

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.google.idea.blaze.base.run.testmap.FilteredTargetMap;
import com.google.idea.blaze.base.sync.SyncCache;
import com.google.idea.blaze.java.run.RunUtil;
import com.google.idea.sdkcompat.scala.ScalaCompat;
import com.intellij.execution.JavaExecutionUtil;
import com.intellij.execution.Location;
import com.intellij.execution.actions.ConfigurationContext;
Expand All @@ -36,8 +35,10 @@
import java.io.File;
import java.util.Collection;
import javax.annotation.Nullable;

import org.jetbrains.plugins.scala.lang.psi.api.ScalaFile;
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScObject;
import org.jetbrains.plugins.scala.util.ScalaMainMethodUtil;
import scala.Option;

/** Creates run configurations for Scala main classes sourced by scala_binary targets. */
Expand All @@ -56,7 +57,7 @@ public BinaryRunContext getRunContext(ConfigurationContext context) {
if (target == null) {
return null;
}
Option<PsiMethod> mainMethod = ScalaCompat.findMainMethod(mainObject);
Option<PsiMethod> mainMethod = ScalaMainMethodUtil.findScala2MainMethod(mainObject);
PsiElement sourceElement = mainMethod.getOrElse(() -> mainObject);
return BinaryRunContext.create(sourceElement, target.toTargetInfo());
}
Expand Down Expand Up @@ -86,7 +87,7 @@ private static ScObject getMainObjectFromElement(PsiElement element) {
for (; element != null; element = element.getParent()) {
if (element instanceof ScObject) {
ScObject obj = (ScObject) element;
if (ScalaCompat.hasMainMethod(obj)) {
if (ScalaMainMethodUtil.hasScala2MainMethod(obj)) {
return obj;
}
} else if (element instanceof ScalaFile) {
Expand All @@ -103,7 +104,7 @@ private static ScObject getMainObjectFromFile(ScalaFile file) {
continue;
}
ScObject obj = (ScObject) aClass;
if (ScalaCompat.hasMainMethod(obj)) {
if (ScalaMainMethodUtil.hasScala2MainMethod(obj)) {
// Potentially multiple matches, we'll pick the first one.
// TODO: prefer class with same name as file?
// TODO: skip if not main_class of a rule.
Expand Down
22 changes: 0 additions & 22 deletions sdkcompat/v221/com/google/idea/sdkcompat/scala/ScalaCompat.java

This file was deleted.

22 changes: 0 additions & 22 deletions sdkcompat/v222/com/google/idea/sdkcompat/scala/ScalaCompat.java

This file was deleted.

22 changes: 0 additions & 22 deletions sdkcompat/v223/com/google/idea/sdkcompat/scala/ScalaCompat.java

This file was deleted.

22 changes: 0 additions & 22 deletions sdkcompat/v231/com/google/idea/sdkcompat/scala/ScalaCompat.java

This file was deleted.

22 changes: 0 additions & 22 deletions sdkcompat/v232/com/google/idea/sdkcompat/scala/ScalaCompat.java

This file was deleted.

22 changes: 0 additions & 22 deletions sdkcompat/v233/com/google/idea/sdkcompat/scala/ScalaCompat.java

This file was deleted.

38 changes: 0 additions & 38 deletions sdkcompat/v241/com/google/idea/sdkcompat/scala/ScalaCompat.java

This file was deleted.

38 changes: 0 additions & 38 deletions sdkcompat/v242/com/google/idea/sdkcompat/scala/ScalaCompat.java

This file was deleted.

Loading