@olafurpg olafurpg released this Sep 18, 2018 · 52 commits to master since this release

Assets 2

We are excited to announce the release of Scalameta v4.0.0. Scalameta is a library to read, analyze, transform and generate Scala programs.

This release has been under development since April 2018 and includes contributions from 15 contributors closing 189 tickets.

Documentation 📘

We have a new website! https://scalameta.org/

The website aggregates all Scalameta documentation in one place:

SemanticDB 🌳

SemanticDB is a data model for semantic information such as symbols and types about programs in Scala and other languages. Scalameta v4.0 introduces several SemanticDB improvements.

The symbol format has gone through several iterations, with highlights including:

  • package symbols end with slash / instead of dot . making it easier to perform common tasks like "find enclosing top-level class".
    • before: java/lang/ and scala/collection/
    • after: java.lang. and scala.collection.
  • method symbols no longer include parameter types making it possible to produce valid method symbols with a parser alone.
    • before: assert(). and assert(String).
    • after: assert(). and assert(+1).
  • VAL METHOD symbols exceptionally use dot . instead of method format ().
    • before: scala.Either().
    • after: scala/Either.

Synthetics are now an official part of SemanticDB and documented in the spec. Synthetics are code such as inferred type arguments, implicit parameters and desugarings that are added by the compiler and don't appear in the original source code.

Type has been split into Type (value types like TypeRef, SingletonType, etc) and Signature (non-value types like ClassSignature, MethodSignature, etc). This has improved the precision of the data model - both for SymbolInformation and other parts of SemanticDB, because signatures and types no longer intersect. Additionally, SingletonType has been split into SingleType, ThisType, SuperType and ConstantType.

The TextDocument message now has an md5: String field to verify SemanticDB payloads are up-to-date with files on disk even when text is empty.

The following modules have been updated:

  • semanticdb-scalac: updated to include latest SemanticDB spec changes including new additions such as synthetics.
  • semanticdb-javac: new Java compiler plugin to produce SemanticDB symbols.
  • metap: improved command-line interface to support latest SemanticDB spec changes.
  • metacp: improved command-line interface with finer-grained control over error handling.

Scala Native 🚀

The syntactic API (parsers, trees, tokens, ...) is now published for Scala Native. This makes it possible to use Scalameta to build binaries with fast startup.

Breaking changes ⚠️

  • There are no breaking changes for the syntactic API such as scala.meta.{Tree,Token}.
  • scala.meta.{Database,Denotation,Synthetic,ResolvedName,ResolvedSymbol,Document} have been removed. There is no longer a public API to access SemanticDB payloads, and we encourage tool authors to use SemanticDB protobuf bindings directly.
  • scala.meta.Input.{Denotation,Synthetic} have been removed along with scala.meta.{Denotation,Synthetic}
  • scala.meta.{Multipath,Sourcepath,Fragment} have been removed along with scala.meta.Database.
  • The package org.langmeta has moved to scala.meta, to migrate
    find . -type f -name '*.scala' -exec sed -i '' 's/org.langmeta/scala.meta/g' {} +
    

Milestone release notes

Contributors

$ git shortlog -sn --no-merges v3.7.4..v4.0.0
Eugene Burmako
Ólafur Páll Geirsson
Max Ovsiankin
Guillaume Massé
Gabriele Petronella
Loïc Girault
Seth Tisue
Dmytro Mitin
Hugo van Rijswijk
Devon Stewart
Filip Krikava
Andy Scott
Marcelo Cenerino
tanishiking24
Jozef Koval