BSL Gradual Type System
VS Code extension for BSL (1C:Enterprise) projects. It packages the gradual type system and BSL language server from this repository and provides diagnostics, navigation, type information, syntax highlighting, formatting, and operator-facing observability tools for large EDT-style workspaces.
Marketplace identity:
- Publisher:
bsl-analyzer-team
- Extension name:
bsl-type-safety-analyzer
- Extension id:
bsl-analyzer-team.bsl-type-safety-analyzer
The Marketplace extension name is kept for update compatibility with the previously published extension.
Repository: https://github.com/defin85/bsl-gradual-types
Features
- BSL language support for
.bsl and .os files.
- Tree-sitter based syntax parsing and LSP diagnostics.
- Semantic diagnostics for unresolved variables, member access, type compatibility, and related type-safety checks.
- Hover, completion, signature help, go to definition, references, document symbols, and workspace symbol search.
- Inlay type hints, configurable hover detail, and optional flow-sensitive analysis.
- AST-based formatting through the LSP server.
- Platform documentation loading from 1C Syntax Helper archives or extracted
rebuilt.shcntx_ru / rebuilt.shlang_ru folders.
- Configuration metadata discovery and indexing for EDT/workspace source trees.
- Cache controls, type repository views, diagnostics tree, observability panel, snapshot readiness view, and completion timeline tools.
- Incident bundle export for performance and diagnostics troubleshooting.
Requirements
- VS Code
1.75.0 or newer.
- A bundled or locally built
bsl-lsp-server binary.
- For platform-aware type information: 1C Syntax Helper documentation for the target platform version.
- For configuration-aware analysis: a path to the exported/EDT 1C configuration source.
The extension can use bundled binaries by default. For local development builds, set bslAnalyzer.useBundledBinaries to false and point bslAnalyzer.indexServerPath to the directory containing the server binaries.
Basic Setup
Open a workspace with BSL files and configure the project settings:
{
"bslAnalyzer.platformVersion": "8.3.27",
"bslAnalyzer.platformDocsArchive": "/path/to/syntax-helper-parent",
"bslAnalyzer.configurationPath": "/path/to/configuration",
"bslAnalyzer.useBundledBinaries": true
}
bslAnalyzer.platformDocsArchive should point to the parent folder or archive that contains platform documentation. For extracted Syntax Helper docs, the parent folder should contain rebuilt.shcntx_ru and rebuilt.shlang_ru.
Choose platformVersion so it is not lower than the configuration compatibility mode. For example, a configuration with compatibility mode 8.3.27 must not be opened as 8.3.24.
After changing binary, platform documentation, or configuration paths, run:
BSL Analyzer: Restart LSP Server
Useful Commands
BSL Analyzer: Restart LSP Server
BSL Analyzer: Analyze Current File
BSL Analyzer: Analyze Workspace
BSL Analyzer: Reindex Now
BSL Analyzer: Build Unified BSL Index
BSL Analyzer: Show Index Statistics
BSL Analyzer: Search BSL Type
BSL Analyzer: Search Method in Type
BSL Analyzer: Explore Type Methods & Properties
BSL Analyzer: Add Platform Documentation
BSL Analyzer: Parse Platform Documentation
BSL Analyzer: Dump LSP Metrics
BSL Analyzer: Export Observability Incident Bundle
BSL Analyzer: Open Snapshot Readiness
Important Settings
{
"bslAnalyzer.enabled": true,
"bslAnalyzer.enableRealTimeAnalysis": true,
"bslAnalyzer.serverMode": "stdio",
"bslAnalyzer.trace.server": "off",
"bslAnalyzer.diagnosticsDebounceMs": 250,
"bslAnalyzer.cacheEnabled": true,
"bslAnalyzer.rulesConfig": "",
"bslAnalyzer.enableTypeHints": false,
"bslAnalyzer.enableCodeActions": false,
"bslAnalyzer.enableFlowSensitiveAnalysis": false,
"bslAnalyzer.formatting.enabled": true
}
For local diagnostics-save timeline debugging, enable:
{
"bslAnalyzer.debugDiagnosticsSaveCoherence": true
}
This setting is intended for local troubleshooting and requires BSL Analyzer: Restart LSP Server.
Troubleshooting
Check bslAnalyzer.platformDocsArchive. In WSL/Linux use a normal absolute Linux path, for example:
/home/egor/code/bp-unicom-sdd/docs/syntax_helper
Do not omit the leading slash. A path like home/egor/... is relative and will not resolve as /home/egor/....
Diagnostics are noisy for external EPF files
Set bslAnalyzer.configurationPath to the main configuration source when analyzing external processing modules. Without the configuration context, common modules and metadata types may be missing.
Some managed-form runtime symbols and dynamic table/query shapes are still best-effort semantic checks. Treat semantic diagnostics as a smoke signal and confirm strict syntax/runtime behavior with platform tooling when needed.
The server does not start
- Check
BSL Analyzer in the VS Code Output panel.
- If using bundled binaries, reinstall or republish the extension package.
- If using local binaries, check
bslAnalyzer.indexServerPath.
- Run
BSL Analyzer: Restart LSP Server.
Development
From the repository root:
cd vscode-extension
npm run lint
npm run compile:fast
npm run package
Publishing uses the Marketplace identity from package.json:
{
"publisher": "bsl-analyzer-team",
"name": "bsl-type-safety-analyzer"
}
Support
License
MIT License. See the repository license file.