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

feat: add Scala 3 keywords #161

Merged
merged 4 commits into from
Nov 6, 2020
Merged

Conversation

Kazark
Copy link
Contributor

@Kazark Kazark commented Jul 27, 2020

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.

Based on [the docs](https://dotty.epfl.ch/docs/internals/syntax.html).

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
Copy link

CLAassistant commented Jul 27, 2020

CLA assistant check
All committers have signed the CLA.

@Kazark Kazark mentioned this pull request Jul 27, 2020
scala-mode.el Outdated Show resolved Hide resolved
@hvesalai hvesalai added the Dotty label Jul 27, 2020
@Kazark
Copy link
Contributor Author

Kazark commented Jul 27, 2020

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

scala-mode-syntax.el Outdated Show resolved Hide resolved
@hvesalai hvesalai added this to the Dotty support milestone Jul 27, 2020
@hvesalai hvesalai removed the Dotty label Jul 27, 2020
@Kazark
Copy link
Contributor Author

Kazark commented Jul 28, 2020

@hvesalai soft keywords added in 5299b4a

@Kazark Kazark requested a review from hvesalai July 28, 2020 21:16
Copy link

@smarter smarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, it would be nice to see this merged!

@smarter
Copy link

smarter commented Nov 5, 2020

Ping @hvesalai, anything missing to get this merged?

@hvesalai hvesalai merged commit 9d3b56e into hvesalai:master Nov 6, 2020
@hvesalai
Copy link
Owner

hvesalai commented Nov 6, 2020

thank you!

@Kazark Kazark deleted the scala3-keywords branch November 6, 2020 20:59
@fommil
Copy link
Contributor

fommil commented Mar 11, 2021

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

@hvesalai
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants