From 0c095725c613b272269c1851168b54707b5ec373 Mon Sep 17 00:00:00 2001 From: Googler Date: Fri, 23 Oct 2020 09:50:01 -0700 Subject: [PATCH] Scala parts: Compatibility fixes for 2020.2 PiperOrigin-RevId: 338692237 --- ...lazeScalaTestRunLineMarkerContributor.java | 6 ++--- .../ScalaTestRunLineMarkerProviderCompat.java | 24 +++++++++++++++++++ .../ScalaTestRunLineMarkerProviderCompat.java | 24 +++++++++++++++++++ .../ScalaTestRunLineMarkerProviderCompat.java | 24 +++++++++++++++++++ 4 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 sdkcompat/v193/com/google/idea/sdkcompat/scala/ScalaTestRunLineMarkerProviderCompat.java create mode 100644 sdkcompat/v201/com/google/idea/sdkcompat/scala/ScalaTestRunLineMarkerProviderCompat.java create mode 100644 sdkcompat/v202/com/google/idea/sdkcompat/scala/ScalaTestRunLineMarkerProviderCompat.java diff --git a/scala/src/com/google/idea/blaze/scala/run/producers/BlazeScalaTestRunLineMarkerContributor.java b/scala/src/com/google/idea/blaze/scala/run/producers/BlazeScalaTestRunLineMarkerContributor.java index e2563194530..90e5b32534b 100644 --- a/scala/src/com/google/idea/blaze/scala/run/producers/BlazeScalaTestRunLineMarkerContributor.java +++ b/scala/src/com/google/idea/blaze/scala/run/producers/BlazeScalaTestRunLineMarkerContributor.java @@ -17,6 +17,7 @@ import com.google.idea.blaze.base.run.smrunner.SmRunnerUtils; import com.google.idea.blaze.scala.run.Specs2Utils; +import com.google.idea.sdkcompat.scala.ScalaTestRunLineMarkerProviderCompat; import com.intellij.codeInsight.TestFrameworks; import com.intellij.execution.lineMarker.ExecutorAction; import com.intellij.execution.lineMarker.RunLineMarkerContributor; @@ -35,18 +36,17 @@ import org.jetbrains.plugins.scala.lang.psi.api.expr.ScInfixExpr; import org.jetbrains.plugins.scala.lang.psi.api.statements.ScFunctionDefinition; import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScClass; -import org.jetbrains.plugins.scala.testingSupport.test.ScalaTestRunLineMarkerProvider; import org.jetbrains.plugins.scala.testingSupport.test.structureView.TestNodeProvider; /** * Generates run/debug gutter icons for scala_test, and scala_junit_tests. * - *

{@link ScalaTestRunLineMarkerProvider} exists in the scala plugin, but it does not currently + *

{@code ScalaTestRunLineMarkerProvider} exists in the scala plugin, but it does not currently * try to handle scalatest and specs2 at all. For JUnit tests, it has a bug that causes it to not * generate icons for a test without run state (i.e., newly written tests). * https://github.com/JetBrains/intellij-scala/pull/381 */ -public class BlazeScalaTestRunLineMarkerContributor extends ScalaTestRunLineMarkerProvider { +public class BlazeScalaTestRunLineMarkerContributor extends ScalaTestRunLineMarkerProviderCompat { @Nullable @Override public Info getInfo(PsiElement element) { diff --git a/sdkcompat/v193/com/google/idea/sdkcompat/scala/ScalaTestRunLineMarkerProviderCompat.java b/sdkcompat/v193/com/google/idea/sdkcompat/scala/ScalaTestRunLineMarkerProviderCompat.java new file mode 100644 index 00000000000..e08815f36c7 --- /dev/null +++ b/sdkcompat/v193/com/google/idea/sdkcompat/scala/ScalaTestRunLineMarkerProviderCompat.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 The Bazel Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.idea.sdkcompat.scala; + +import org.jetbrains.plugins.scala.testingSupport.test.ScalaTestRunLineMarkerProvider; + +/** + * Compat class for {@link ScalaTestRunLineMarkerProvider} which was moved to a different package in + * 2020.2. #api193 + */ +public class ScalaTestRunLineMarkerProviderCompat extends ScalaTestRunLineMarkerProvider {} diff --git a/sdkcompat/v201/com/google/idea/sdkcompat/scala/ScalaTestRunLineMarkerProviderCompat.java b/sdkcompat/v201/com/google/idea/sdkcompat/scala/ScalaTestRunLineMarkerProviderCompat.java new file mode 100644 index 00000000000..1dd4cf99fb5 --- /dev/null +++ b/sdkcompat/v201/com/google/idea/sdkcompat/scala/ScalaTestRunLineMarkerProviderCompat.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 The Bazel Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.idea.sdkcompat.scala; + +import org.jetbrains.plugins.scala.testingSupport.test.ScalaTestRunLineMarkerProvider; + +/** + * Compat class for {@link ScalaTestRunLineMarkerProvider} which was moved to a different package in + * 2020.2. #api201 + */ +public class ScalaTestRunLineMarkerProviderCompat extends ScalaTestRunLineMarkerProvider {} diff --git a/sdkcompat/v202/com/google/idea/sdkcompat/scala/ScalaTestRunLineMarkerProviderCompat.java b/sdkcompat/v202/com/google/idea/sdkcompat/scala/ScalaTestRunLineMarkerProviderCompat.java new file mode 100644 index 00000000000..bd348160611 --- /dev/null +++ b/sdkcompat/v202/com/google/idea/sdkcompat/scala/ScalaTestRunLineMarkerProviderCompat.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 The Bazel Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.idea.sdkcompat.scala; + +import org.jetbrains.plugins.scala.testingSupport.test.ui.ScalaTestRunLineMarkerProvider; + +/** + * Compat class for {@link ScalaTestRunLineMarkerProvider} which was moved to a different package in + * 2020.2. #api201 + */ +public class ScalaTestRunLineMarkerProviderCompat extends ScalaTestRunLineMarkerProvider {}