CodeMirror 6 language support for 1C:Enterprise (BSL) and OneScript.
The package exports three things:
bsl — factory returning a LanguageSupport extension you
drop straight into a CodeMirror EditorState.
bslLanguage — the underlying LRLanguage instance, useful
if you want to attach extra LanguageSupport extras
(autocompletion data, lint sources, …) without re-creating the parser.
sdblLanguage — a stand-alone LRLanguage for the SDBL
query language. You normally don't have to touch it directly: when a BSL
string literal starts with ВЫБРАТЬ/SELECT/УНИЧТОЖИТЬ/DROP the
BSL parser mounts SDBL as an overlay via
parseMixed.
Export is provided for cases where you want to highlight a stand-alone
query buffer.
The styleTags mapping is informed by the
bsl-language-serverSemanticTokensProvider tree, which encodes the canonical BSL → LSP
semantic-token mapping used by the official language server.
CodeMirror 6 language support for 1C:Enterprise (BSL) and OneScript.
The package exports three things:
EditorState.LanguageSupportextras (autocompletion data, lint sources, …) without re-creating the parser.ВЫБРАТЬ/SELECT/УНИЧТОЖИТЬ/DROPthe BSL parser mounts SDBL as an overlay via parseMixed. Export is provided for cases where you want to highlight a stand-alone query buffer.The styleTags mapping is informed by the bsl-language-server
SemanticTokensProvidertree, which encodes the canonical BSL → LSP semantic-token mapping used by the official language server.Example
Basic editor:
Example
Highlighting a stand-alone SDBL query buffer: