onr-lsp provides advanced IDE capabilities for editing Open Next Router DSL config files, including provider files, reusable mode preset files, and merged/root config entrypoints such as onr.conf and providers.conf. It is distributed both as a standalone Language Server binary and a packaged VS Code extension.
Feature Highlights
- Syntax Highlighting: Immediate TextMate lexical parsing paired with semantic token coloring from the language server.
- Intelligent Autocomplete: Provides directive completion dynamically depending on the current DSL block, built-in mode suggestions for directives like
req_map,resp_map, andsse_parse, and enum value suggestions such asbalance_unitandmethod. - Preset-Aware Completion: Suggests user-defined top-level preset names for
usage_extract,finish_reason_extract,models_mode, andbalance_mode. - Hover Documentation: Short documentation tooltips injected directly from the ONR DSL metadata definitions.
- Diagnostics: Real-time syntax validation (missing braces, unknown directives) and semantic checks.
- Auto Formatting: Leverages
textDocument/formattingto keep your.conffiles neat and standardized.
Installation
VS Code Extension
You can find the official Open Next Router DSL extension in the VS Code Marketplace. Once installed, the language server will automatically activate for:**/providers/*.conf**/modes/*.conf**/onr.conf**/providers.conf
Default Settings
The extension applies the following default editor settings for ONR DSL files:onrLsp.serverPath in your workspace settings wrapper.