guardrail-dev / guardrail

Principled code generation from OpenAPI specifications
https://guardrail.dev
MIT License
523 stars 132 forks source link

Issue with Dependency Resolution during Project Import in IntelliJ (and VSCode using Metals) #1823

Closed daveoggy closed 11 months ago

daveoggy commented 1 year ago

Hello,

I am encountering an issue when importing the guardrail project into IntelliJ IDEA and Visual Studio Code with Metals. The project builds successfully via the terminal using sbt build, resolving the wartremover_2.12.17/3.0.6 dependency without any issues. However, both IntelliJ and VSCode attempt to resolve wartremover_2.12.18/3.0.6 instead, which does not exist, leading to errors.

Steps to reproduce:

  1. Import the project into IntelliJ IDEA using new -> New Project From Version Control.
  2. Observe the failed import due to an attempt to resolve wartremover_2.12.18/3.0.6.
  3. Run sbt build in the terminal - the project builds successfully with wartremover_2.12.17/3.0.6.

I would appreciate any guidance on how to properly import the project into IntelliJ or VSCode without encountering this dependency resolution issue. Is there any additional configuration or step I am missing during the import process?

Thank you for your assistance!

blast-hardcheese commented 1 year ago

This seems like metals not picking up the hint of which scalaVersion to use, possibly due to the version being defined in project/src instead of in a top level build.sbt.

Bumping to the latest point release of 2.12 and a compatible wartremover seems like the quickest path to resolution, though it is still just kicking the can down the road.

While I do intend to keep 2.12 around for as long as is reasonable, no specific point release is critical, I likely missed a Scala steward PR.

Thank you for reaching out, sorry you ran into this!

blast-hardcheese commented 11 months ago

Closing this due to inactive, please feel free to follow up if this is still an issue.

fwiw, I'm running scalameta/nvim-metals in neovim, the project imports well enough, so I'm not convinced I'd be able to debug this further.