Skip to main content

Languages

Lonca reads a source file as symbols (functions, types, methods, fields): leases are per symbol, facts are computed per symbol, and the merge joins changes to different symbols of one file. The symbols come from tree-sitter grammars, one for each language in the table below. Markdown, TOML, JSON and YAML files are split into sections, and any other file is one symbol, path#<file> (Concepts).

A grammar is part of the lonca you installed, and it is older than its language: languages get new syntax every year, and a grammar learns it some time later, or not yet. A grammar keeps what it knew, so code that was read stays read, and the gap is always at the new end: the newest syntax of a language may be something the grammar in your build can not read.

A file the grammar can not read​

Valid code is never refused because the grammar is behind. From symbol engine 17, a file with something its grammar can not read counts as a file with no grammar, in every language:

  • The change is not refused. The syntax check lets the file through and names it in details.unread (Daemon protocol).
  • A person has to agree once. The proposal that makes a file unreadable, or adds an unreadable one, waits with the reason unread_file:<path> (Reviewing agents' work). Lonca can not tell new syntax from a mistake, so somebody looks.
  • The file is then one symbol. As long as it stays unreadable it is leased whole (path#<file>), its facts are about its lines, and it merges by lines. A test deleted from it does not show in the facts.
  • The rest of the repository is as before. Only that file loses its symbols, and it gets them back when the syntax goes or a release of Lonca brings a grammar that reads it.

Because Lonca no longer stops a syntax error itself, set build and test in [verification]: your own compiler knows your language's version (Verification).

The last column of the table is a smaller gap: the grammar reads the file, and one kind of definition in it gets no symbol of its own. It can not be leased by itself; a change to it counts as a change to the code around it.

If your code uses syntax that the table does not list and Lonca does not read, open an issue with the few lines that show it. They become a sample, and the table then says so.

What each grammar reads​

A test writes this table (crates/lonca-symbols/tests/corpus.rs) from small samples of the syntax that recent versions of each language brought, and fails when the table and the grammars disagree. A version in it is the language's (for JavaScript the year of the standard), the one that brought the syntax. "Nothing found" is about the samples: a grammar may still miss something no sample has.

LanguageFilesGrammarVersions triedSamplesNot readRead, with no symbol for
Rust.rstree-sitter-rust 0.24.21.65 to 1.89131.82: unsafe externnothing found
Python.py .pyitree-sitter-python 0.25.03.8 to 3.15133.13: type parameter defaults; 3.15: lazy imports3.12: type statement (Pair)
TypeScript.ts .mts .ctstree-sitter-typescript 0.23.24.3 to 5.9124.7: variance annotations; 5.0: export type star; 5.9: import defernothing found
TSX.tsxtree-sitter-typescript 0.23.24.9 to 5.35nothing foundnothing found
JavaScript.js .mjs .cjs .jsxtree-sitter-javascript 0.25.02020 to 202614nothing foundnothing found
C#.cstree-sitter-c-sharp 0.23.59 to 143611: slice pattern with a subpattern; 13: allows ref struct; 14: compound assignment operators, extension blocks, lambda parameter modifiers, null conditional assignmentnothing found
Go.gotree-sitter-go 0.25.01.9 to 1.2771.27: generic methodsnothing found
Java.javatree-sitter-java 0.23.514 to 251125: flexible constructor bodies, module importsnothing found
Kotlin.kt .ktstree-sitter-kotlin-ng 1.1.01.4 to 2.3112.1: guard conditions; 2.2: context parameters, multi dollar interpolationnothing found
C.ctree-sitter-c 0.24.211 to 231623: auto type inference, bit precise integers, embed, enum with an unsigned underlying typenothing found
C++.cc .cpp .cxx .c++ .h .hh .hpp .hxxtree-sitter-cpp 0.23.417 to 262520: modules; 23: deducing this, if consteval; 26: contracts, deleted with reason, pack indexing, reflection20: concepts (Addable)
Ruby.rb .rakelonca-tree-sitter-ruby (tree-sitter-ruby 0.23.1 with a scanner fix)2.7 to 3.413nothing foundnothing found
PHP.phptree-sitter-php 0.25.18.0 to 8.519nothing foundnothing found
Swift.swifttree-sitter-swift 0.7.45.5 to 6.215nothing found5.9: macros (stringify)