scalameta / metals-feature-requests

Issue tracker for Metals feature requests
37 stars 4 forks source link

Point to `build.properties` when sbt version is too old #347

Open tanishiking opened 1 year ago

tanishiking commented 1 year ago

Is your feature request related to a problem? Please describe.

When sbt is too old to use Metals, Metals shows a warning that says You are using sbt x.x.x, which is not supported in this version of Metals. Please upgrade to y.y.y.

https://github.com/scalameta/metals/blob/5aaddeee26e07b7ee8dbdec8fa167bb146aa8f7d/metals/src/main/scala/scala/meta/internal/metals/Messages.scala#L776-L779

This message makes sense to most of the experienced Scala developers. However, for Scala newbies / students who uses Scala only for the classes, they don't necessarily know how to upgrade sbt's version (even though they can google it).

It might be nice to show how to upgrade the sbt version, in addition to saying Please upgrade to y.y.y.

Describe the solution you'd like

Adding the message something like "You can upgrade sbt versioninbuild.properties`" to the warning message should be enough.

This message is for various build tools, but supporting only sbt should be a good starting point, since most Scala newbies start coding Scala using sbt.

https://github.com/scalameta/metals/blob/5aaddeee26e07b7ee8dbdec8fa167bb146aa8f7d/metals/src/main/scala/scala/meta/internal/metals/Messages.scala#L776-L779

Describe alternatives you've considered

I don't have any other ideas

Additional context

From discord conversation https://discord.com/channels/632642981228314653/632652693013528589/1121313322076217354

tanishiking — 06/22/2023 2:38 PM
Just sharing maybe for better user experience:
Today, My colleague at uni had trouble with Metals, and it turned out it's because Scala and sbt was way too old (Scala 2.12.8 and sbt 1.2.something) 😅 
As he is completely new to Scala, I found he was struggled with
Even though Metals shows sbt is too old, he didn't know how to bump sbt version (it might be nice to navigate to project/build.properties or is it too much?)
I couldn't see any warnings on VSCode that Scala 2.12.8 is no longer supported or something. Is it only in Doctor?

Seth Tisue — 06/23/2023 12:12 AM
Even though Metals shows sbt is too old, he didn't know how to bump sbt version (it might be nice to navigate to project/build.properties or is it too much?)

that sounds like a very good, ticket-worthy suggestion

it's really really common for people not to be aware that project/build.properties determines sbt version, rather than it being systemwide 

Chris Kipp — 06/23/2023 12:17 AM
sounds like something should just offer to fix. we can do that for other things, and we should totally be able to do that here.  however the tricky thing actually may be this could break their build 
say maybe we don't want to just "fix it" in this scenario 🤔

Tomasz Godzik — 06/23/2023 6:09 PM
We can always just point to it's lcoation
So add action Open build.properties to update
that should be a quick fix, anyone wants to take a look?

tanishiking — 06/23/2023 6:14 PM
I think adding a message to a popup like "You can update sbt version in build.properties"  or something is enough 🙂 
Around here https://github.com/scalameta/metals/blob/5aaddeee26e07b7ee8dbdec8fa167bb146aa8f7d/metals/src/main/scala/scala/meta/internal/metals/Messages.scala#L776-L779

Search terms

sbt, user experience