Quick start
Install the toolkit, generate the language data from your 1C:Element distribution and get the first check running.
To check sources, install XBSL, generate the language data from a 1C:Element distribution and, if needed, select the output language.
How the pieces fit
The engine is available through the CLI, an LSP server for editors and an MCP server for agents. All three interfaces work with the sources on disk.
Installation details
pip install xbsl # or, from a clone: pip install -e .
xbsl path/to/sources # or: python -m xbsl path/to/sources
xbsl self-update # upgrade to the latest PyPI version
self-update unpacks the new wheel straight into site-packages. That works even when
pip install --upgrade fails with WinError 32 over a busy exe. Usually the busy one is
xbsl-lsp.exe, held by the VS Code LSP server, or xbsl-mcp.exe, held by an agent. The command
leaves busy stubs alone, and they call the new code the next time they start. Restart the
long-living processes yourself after the update. --version X.Y.Z installs a specific version.
When a running process keeps the package itself busy, the command names it by pid and command
line and refuses. The previous installation stays in place. --stop-holders stops the servers
first: the LSP server, the worker of the MCP supervisor, the web server. A running xbsl command
of another session, a lint or a scaffolding call, is left alone, so wait for it to finish.
--stop-holders=all stops it too, and it ends without a result.
In an editable install from a clone the command refuses: git pull updates that one.
For a release published minutes ago, both PyPI lists of releases may still name the previous
one. Without --version the command reads both of them and also asks for the page of the next
version, which PyPI serves as soon as the release is out. When the sources disagree, the
command prints what each of them said. It never replaces an installation with an older release.
The lexer and parser can be compiled into C extensions using mypyc. Set
XBSL_MYPYC=1 at build time; you need mypy and a C compiler for that, which means MSVC Build
Tools on Windows, Xcode CLT on macOS, gcc on Linux. Users never need a compiler. CI builds the
native wheels (native-wheels.yml), and where no wheel matches, the package runs as plain
Python, with the same functionality at a lower speed.
Language data
The linter uses language tables with bilingual keywords and operators, the stdlib type catalog
and the configuration metamodel with element properties. The data is extracted from the
1C:Element distribution: the InternalBsl.g grammar, documentation and .xcore metamodel.
The XBSL language is built on Eclipse Xtext and ANTLR. The data is not bundled with the
repository, so generate it locally:
xbsl extract --dist "<path to the 1C:Element distribution>" # the whole dataset in one go
xbsl extract --dist ... --only stdlib,terms # a subset of the steps
xbsl extract --dist ... --skip docs # docs builds a large index
The command runs the six extractors in dependency order: uischema reads what the docs step
produced. From a repository clone the same entry points are python tools/extract.py and the
individual tools/extract_<step>.py. The extractors detect the 1C:Element version themselves and
place the data under xbsl/data/element/<version>/, a folder listed in .gitignore. Without the
data the linter and the tests will tell you to generate it. To write the data elsewhere, pass
--data-dir or set XBSL_DATA_DIR – for instance into a private package that ships it, see
Extending.
Output language
Rule titles and diagnostic messages come in Russian and English. The language is picked in this
order: the --lang ru|en flag, then the XBSL_LANG environment variable, then the system locale,
otherwise Russian. Type names, keywords and other XBSL text inside a message stay as they are;
only the wording around them is translated. The MCP server and the web panel follow the same
setting, and the web panel adds an RU/EN toggle on the page itself.