@xeno-by xeno-by released this Apr 26, 2017 · 2273 commits to master since this release

Assets 2

Syntactic API

Our parser has been updated to implement recent additions to the language:
literal types (SIP-23)
and trailing commas (SIP-27).

These features are supported in the newly introduced Typelevel family of dialects
that correspond to the recent releases of the Typelevel Scala compiler.
The upcoming Scala 2.12.2 release is also going to support these features,
so, shortly after it's out, we will update the Scala212 dialect as well.

Semantic API

We are extremely excited to announce the first release of the scala.meta semantic API!
Our general idea for this module is to start small, and then progressively support
more and more functionality until we've covered most, if not all, use cases of scala.reflect.

In this first release, we're introducing the notion of a Symbol, i.e. a unique identifier of a definition,
and the accompanying Ref.symbol API that can be used to resolve references. This functionality is backed
by something that we call a semantic database, i.e. a storage of semantic information about Scala programs.
Our current implementation can create such a database from an instance of the Scala compiler
and save it to disk for future consumption.

In the near future, we're planning to rapidly iterate on the design and functionality of the semantic API.
As a result, until further notice, the semantic API will have experimental status.
This means lower than usual quality standards, but this also means an opportunity
to shape the future of Scala tooling together. We have already hacked some very cool functionality,
and more is to arrive soon!

To get started with the semantic API,
check out https://github.com/scalameta/sbt-semantic-example.
To ask questions, provide feedback and join the discussion, visit our Gitter channel.

contrib

Scala.meta contrib is a new module that provides common utilities for handling scala.meta data structures.
This first release of contrib contains:

  • an Equal type-class (similar to cats.Eq or scalaz.Equal) with instances
    to compare trees for either structural or syntactic equality.
  • collection methods on scala.meta.Tree such as find, contains, collectFirst and exists.
  • an AssociatedComments data type for finding leading and trailing comments for tree nodes.
  • Converters for Name allowing Term.Name("foo").asType
  • implicit enrichments are now provided more a-la-carte. You can now import exactly what you need.
    eg. import scala.meta.contrib.implicits.Equality._

More utilities are planned for future release, such as extracting Seq[Stat] from various trees and parsing docstrings.
Modules for interoperability with third-party libraries such as cats or scalaz have been considered as well.

As the module name suggests, contributions to contrib are very welcome!
If you have implemented scala.meta helpers that you believe might benefit the larger community,
consider sending us a PR.

Cross-compilation against Scala 2.11 and 2.12

Since 1.6.0, we are committed to supporting scala.meta for two most recent major versions of Scala.
The library part of scala.meta supports entire Scala series (at the time of writing, this is _2.11 or _2.12).
Our compiler plugins are built against most recent minor versions of supported Scala series
(at the time of writing, this is _2.11.8 and _2.12.1).

Scala.meta still needs porting to Scala 2.10. Despite being two major version behind, Scala 2.10
is still used to develop sbt plugins, so at the time of writing it is quite relevant.
If you'd like to help us out with Scala 2.10 support, take a look at #295.

Prerelease builds

We have set up an infrastructure that automatically publishes prerelease builds of scala.meta
after a pullrequest to scalameta/scalameta gets merged.

You can distinguish these builds from regular builds by looking at their version strings.
Prerelease versions contain a dash (e.g. 1.6.0-344-a9f6f83e), while regular builds don't (e.g. 1.6.0).
The portion after the dash includes the number of commits since v1.0.0 and the sha of the corresponding commit,
which allows to easily establish version precedence and look up associated code.
The most recent prerelease version can be found at
https://bintray.com/scalameta/maven/scalameta/_latestVersion.

Prerelease builds are hosted on Bintray, so you'll need to explicitly add a Bintray resolver
to your sbt configuration to make use of them: resolvers += Resolver.bintrayIvyRepo("scalameta", "maven").

Bugfixes

  • show[Structure] should lowercase Literal.{Float,Double,Long} (#459)
  • Pretty printer missing for synthetic trait params (#545)
  • Incorrect unquotation of type lambda trick (#565)
  • Pat.Interpolate Syntax does not extract Strings from Lits (#587)
  • SIP-23 literal types syntax support (#620)
  • Parse error in Paradise211 dialect (#684)

Upgrade guide

  • If you use scala.meta macro annotations, you should upgrade to paradise 3.0.0-M7
  • If you use equal, you will no longer have to import Structurally or Syntactically
    as they are included under scala.meta.contrib._
  • Equality related classes are now in contrib.equality, implicit traits are in contrib.implicits
    This only affects those who did not use import scala.meta.contrib._

Contributors

We would like to heartily thank everyone who has contributed to scala.meta by participating in discussions,
reporting bugs, submitting and reviewing pull requests. It is an honor to be part of our great community!

git shortlog -sn --no-merges v1.5.0..v1.6.0 tells us that 9 people contributed to this release:
Eugene Burmako, Ólafur Páll Geirsson, Xavier Fernández Salas, Daniel Dudson, Tamer AbdulRadi,
Xavier Fernández Salas, Shane Delmore, David Dudson, Martynas Mickevičius.