Skip to content

Commit

Permalink
Scala parts: Compatibility fixes for 2020.2
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 338692237
  • Loading branch information
Googler authored and copybara-github committed Oct 23, 2020
1 parent 1b8cb0f commit 0c09572
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.
*
* <p>{@link ScalaTestRunLineMarkerProvider} exists in the scala plugin, but it does not currently
* <p>{@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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {}
Original file line number Diff line number Diff line change
@@ -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 {}
Original file line number Diff line number Diff line change
@@ -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 {}

0 comments on commit 0c09572

Please sign in to comment.