Upgrading from 2.x
Configurations written for 2.x keep working, and each deprecated setting prints a warning naming its replacement. The deprecated settings will be removed in the next major release.
libraryandsymbol. For a language from the built-in list, remove them along with thehighlightspath: the grammar and its queries are fetched instead. Any other grammar is named bygit, its repository URL or a path to a local checkout.- A copy of the bundled stylesheet in
additional-css. The stylesheet is now embedded, so remove the copy, or keep only your own changes in it. A copy that replaces the bundled theme moves totheme/highlight_ts.css.
A 2.x configuration such as
[preprocessor.tsitter.languages.rust]
library = "parsers/rust.so"
highlights = "queries/rust/highlights.scm"
[preprocessor.tsitter.languages.mylang]
library = "parsers/mylang.so"
highlights = "queries/mylang/highlights.scm"
[output.html]
additional-css = ["theme/treesitter.css"]
becomes
[preprocessor.tsitter.languages]
rust = {}
[preprocessor.tsitter.languages.mylang]
git = "https://github.com/someone/tree-sitter-mylang"
rev = "v1.0.0"
and the committed parsers, queries, and stylesheet can be deleted.
Highlighting from nvim-treesitter style queries is also more faithful in 3.0:
#contains? and Vim’s \c regex flag are evaluated, and spell-checking and
helper captures no longer strip the colour from the nodes they mark.