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

Better IntelliJ support when working on scalafix #1626

Open
bjaglin opened this issue Jun 29, 2022 · 5 comments
Open

Better IntelliJ support when working on scalafix #1626

bjaglin opened this issue Jun 29, 2022 · 5 comments
Labels

Comments

@bjaglin
Copy link
Collaborator

bjaglin commented Jun 29, 2022

Since the introduction of sbt-project-matrix in #1528, there are compilation errors in IntelliJ when working on scalafix itself (apparently for both classic & BSP integrations), which prevents running tests from the IDE.

This is also true for projects bootstrapped with https://github.com/scalacenter/scalafix.g8.

@bjaglin
Copy link
Collaborator Author

bjaglin commented Jun 29, 2022

A first solution would be to only export some of the modules of the matrix as recommended in sbt/sbt-projectmatrix#25 (comment).

@tgodzik
Copy link
Contributor

tgodzik commented Jun 29, 2022

What are the BSP errors that you get? Maybe it's fixable on the Bloop/sbt side?

@bjaglin
Copy link
Collaborator Author

bjaglin commented Jun 29, 2022

@tgodzik I didn't get the time to look at it myself.

@rvacaru can you report your problems here?

@tgodzik
Copy link
Contributor

tgodzik commented Jun 29, 2022

Just checked and I don't get any errors with Bloop + Metals. Project matrix might be problematic for Intellij as it doesn't like multiple targets with the same directory.

@rvacaru
Copy link
Contributor

rvacaru commented Jul 1, 2022

@tgodzik @bjaglin
I've just started working on scalafix with both Intellij and VS Code, so far these are my findings when comparing the IDEs:

  • Just looking at ExplicitResultTypes.scala

    • Intellij: line 9 import buildinfo.RulesBuildInfo is not resolved, even after running sbt compile on the whole scalafix
    • VS Code: the import works and ctrl click on RulesBuildInfo navigates to the scala file
  • Looking at ExplicitResultTypesBug.scala (only in the output folder, not the input)

    • Intellij:
      • line 4 import scala.reflect.runtime.universe._ says runtime isn't a member of reflect
      • line 9 type ClassMirror not found
    • VS Code: runtime package is recognized when hoovering on it and ctrl click on ClassMirror navigates to it
  • Looking at Compat.scala objects

    • Intellij errors SeqView expects only 1 arg, but finds 2 (points to scala-library-2.13.8 jar instead of the 2.11 or 2.12 versions
    • VS Code works as expected
  • Running or debugging ScalafixImplSuite

    • Intellij fails building with Compat is already defined as object Compat
    • VS Code runs and debugs are working fine

@bjaglin bjaglin added the build label Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants