-
Notifications
You must be signed in to change notification settings - Fork 182
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
use & support scala 2.13.12 #1861
Conversation
3637ed9
to
2e7a113
Compare
case i @ Defn.Def(_, name, _, _, _, _) if isUnusedTerm(name.pos) => | ||
defnTokensToRemove(i).map(Patch.removeTokens).asPatch.atomic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compiler warnings for defs are now emitted on a more narrow tree.
--- metap ./scalafix-tests/input/target/jvm-2.13.11/meta/META-INF/semanticdb/scalafix-tests/input/src/main/scala-2/test/removeUnused/RemoveUnusedTerms.scala.semanticdb
+++ metap ./scalafix-tests/input/target/jvm-2.13.12/meta/META-INF/semanticdb/scalafix-tests/input/src/main/scala-2/test/removeUnused/RemoveUnusedTerms.scala.semanticdb
Diagnostics:
-[7:10..7:10) [warning] procedure syntax is deprecated: instead, add `: Unit =` to explicitly declare `foo`'s return type
+[7:10..7:10) [warning] procedure syntax is deprecated: instead, add `: Unit =` to explicitly declare `foo`'s return type [quickfixable]
[8:4..8:20) [warning] local val a in method foo is never used
[9:4..9:23) [warning] local val aa in method foo is never used
[10:4..10:13) [warning] local var b in method foo is never used
[11:4..11:23) [warning] local var bb in method foo is never used
-[13:4..13:20) [warning] local method c in method foo is never used
+[13:8..13:9) [warning] local method c in method foo is never used
-[14:4..14:25) [warning] local method cc in method foo is never used
+[14:8..14:10) [warning] local method cc in method foo is never used
[15:4..15:15) [warning] local val xy in method foo is never used
-[20:2..20:35) [warning] private method ff in object RemoveUnusedTerms is never used
+[20:14..20:16) [warning] private method ff in object RemoveUnusedTerms is never used
case i: Defn if isUnusedTerm(i.pos) => | ||
defnTokensToRemove(i).map(Patch.removeTokens).asPatch.atomic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping the old matcher for compatibility with semanticdb generated with compiler <2.13.12.
@@ -43,11 +43,11 @@ class RuleCompiler( | |||
List(new BatchSourceFile(label, new String(input.chars))) | |||
) | |||
val errors = reporter.infos.collect { | |||
case reporter.Info(pos, msg, reporter.ERROR) => | |||
case r: reporter.Info if r.severity == reporter.ERROR => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid using unapply as signature is now inconsistent between 2.12 and 2.13
Towards #1860