hvesalai / emacs-scala-mode

The definitive scala-mode for emacs
http://ensime.org
GNU General Public License v3.0
362 stars 68 forks source link

feat: add Scala 3 keywords #161

Closed Kazark closed 3 years ago

Kazark commented 3 years ago

Based on the docs.

  1. Scala 3 is not perfectly backwards compatible, but is significantly backwards compatible, with Scala 2. Therefore, it seems reasonable at a syntax level to begin with the assumption that they are sufficiently compatible that we can just start migrating towards the grammar of Scala 3.
  2. Scala 3 has reserved more keywords. Arguably it's a benefit, even if you are writing Scala 2 code, to be made aware of the Scala 3 keywords by way of syntax highlighting. That way you have an opportunity to rename your variables before ever upgrading to 3.
  3. The lack of highlighting new keywords is probably the most obvious lack of highlighting w.r.t. to the new syntax; i.e., this is a "do 20%, get 80%" scenario.

Overall this seems to me like a fairly simple and safe step toward adopting Scala 3 syntax.

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.

Kazark commented 3 years ago

@hvesalai fixed weird-looking version in comment in 5058a85

Kazark commented 3 years ago

@hvesalai soft keywords added in 5299b4a

smarter commented 3 years ago

Ping @hvesalai, anything missing to get this merged?

hvesalai commented 3 years ago

thank you!

fommil commented 3 years ago

Uuugh, this highlights things in Scala 2 that shouldn't be.

hvesalai commented 3 years ago

Let's revert / make it configurable when @Kazark decides how we do Scala 3 support