Kiama is a Scala library for language processing including attribute grammars, term rewriting, abstract state machines and pretty printing.
This is a major release with an important attribution bug fix, support for Scala 2.13, preliminary interfacing with the Language Server Protocol, plus some minor enhancements and updates.
Attribution
: Issue 83
Cached attributes are now synchronized so that cache management is now thread safe. As a side effect of this
change, it is no longer possible to define attribute types that are not inheriting from AnyRef
.
Thanks to Fred Teunissen for reporting and helping with testing.
PrettyPrinter
: The string
method now uses an iterator instead of recursion to avoid
stack overflow for strings that contain many newlines. Thanks to Anton Panasenko for reporting and supplying
a fix.
This version of Kiama comes with basic support for interfacing between Kiama's Compiler
framework and the Language Server Protocol. The result is a relatively low-effort mechanism to send
information from a Kiama-based processor to an LSP-based editor. We have only tested with VSCode so far.
A demonstration instance of using Kiama's LSP support can be found in our MiniJava example. It complements a simple VSCode client.
Services that are at least partially supported are:
We also support generation of products that are additional to the LSP standard protocol. A product is a text artefact that relates in some way to the code that an editor is editing. Normally products are displayed side-by-side related files in the editor. The following products are used in this version of Kiama and the MiniJava example:
At the moment there is very little documentation for the LSP support except what is in the code. Feel free to contact us if you try to use it and have problems.
Attribution
: The version of the down
decorator that takes a default value now
passes that value by name rather than eagerly evaluating it.
Environments
: The defineIfNew
method now takes both of its Environment arguments by
name.
Tree
: The CheckTree
version of Tree
construction now includes more
information in the exception reason if the structure is not a tree. Instead of just including the immediate
parents of the offending node(s), now all ancestors are included. Also, the index of each node in its parent
is shown.
Move to sbt 1.3.5, Scala 2.13.0, 2.12.10, 2.11.12, 2.10.7, ScalaTest 3.1.0, ScalaCheck 1.14.3, LSP4J 0.8.1, Scallop 3.3.2.
Move back to Guava 21.0 for compatibility with LSP4J.