Skip to content

BSL Language Server Configuration

BSL Language Server provides the ability to change settings using a configuration file in JSON format.

Global and Local Configuration

BSL Language Server uses a two-level configuration system:

  • Global configuration — common settings applied to all workspaces. Contains parameters language, sendErrors, traceLog, as well as capabilities (textDocumentSync.change) and workspaceSymbol (syncFuzzySearch).
  • Local (per-workspace) configuration — individual settings for each workspace, including diagnostics, codeLens, inlayHint, and other parameters. Each workspace can have its own configuration file.

Configuration File Search Strategy

Global Configuration

On startup, BSL Language Server searches for a global configuration file in the following order:

  1. File specified via the -c (--configuration) flag, if provided at launch.
  2. File .bsl-language-server.json in the current working directory (CWD).
  3. File .bsl-language-server.json in the user's home directory (%HOMEPATH% / $HOME).

The first found file is used. If no file is found, default settings are applied.

Local Configuration (Per-Workspace)

For each workspace, BSL Language Server searches for a .bsl-language-server.json file in the workspace root directory. If found, its settings are applied to that workspace; otherwise, default settings are used (supplemented by the global configuration).

Change Tracking

BSL Language Server automatically tracks configuration file changes:

  • Changing the global file updates global parameters (language, sendErrors, traceLog, capabilities, workspaceSymbol).
  • Changing a workspace file updates settings only for that workspace, including diagnostics recalculation.
  • When a workspace is added, a file watcher is automatically registered for its configuration file.
  • When a workspace is removed, the file watcher is unregistered.

Settings

Name Type Description
language String Set the language for displaying diagnosed comments. Supported languages:
ru - for Russian (default)
en - for English
codeLens JSON-Object Contains settings for displaying lenses in advanced code/IDEs (eg Visual Studio Code), which displays various information above the code block.
⤷   parameters JSON-Object Collection of lens settings. Collection items are json-objects with the following structure:
object key - string, is lens key
object value - if is boolean, then interpreted as lens off-switch (false) or on-switch with default parameters (true), if is type json-object, collection of lens parameters.
   ⤷   cognitiveComplexity Boolean or JSON-Object Enables displaying the value of the cognitive complexity of the method over its definition. The default is true. Lens options: complexityThreshold - lens response threshold. The default is - -1.
   ⤷   cyclomaticComplexity Boolean or JSON-Object Enables displaying the value of the cyclomatic complexity of the method over its definition. The default is true. Lens options: complexityThreshold - lens response threshold. The default is - -1.
   ⤷   injectionPoint Boolean or JSON-Object Enables the lens above &Пластилин injection points navigating to the producer of the injected bean (OneScript, Autumn DI framework). The default is true.
   ⤷   beanUsages Boolean or JSON-Object Enables the lens above bean producers (component bean constructor and &Завязь factory methods) showing the number of injection points and navigating to them (OneScript, Autumn DI framework). The default is true.
⤷   testRunner JSON-Object Test runner settings used by the "run test" code lenses (Run test, Run all tests, Debug test).
   ⤷   testSources Array String Directories containing test sources. Default ["tests"].
   ⤷   annotations Array String Annotation names that mark test methods. Default ["Тест", "Test"].
   ⤷   executable String Path/name of the test runner executable (Linux and macOS). Default 1testrunner.
   ⤷   executableWin String Path/name of the test runner executable (Windows). Default 1testrunner.bat.
   ⤷   getTestsByTestRunner Boolean Get test method names via the test runner executable. If false, methods are found by the internal parser using the &Тест annotation. Default true.
   ⤷   getTestsArguments String Arguments passed to the test runner to get the list of tests. %s is replaced with the path to the current file. Default -show %s.
   ⤷   getTestsResultPattern String Regular expression to parse the test runner output for method names. Default ^[^<]*Имя\sтеста\s<([^>]+)>.*.
   ⤷   runTestArguments String Arguments to run a single test. The first %s is the file path, the second %s is the test method name. Default -run %s %s.
   ⤷   debugTestArguments String Arguments to debug a single test. Empty by default.
   ⤷   runAllTestsArguments String Arguments to run all tests in the current file. %s is replaced with the path to the current file. Default -run %s.
diagnostics JSON-Object Contains diagnostic settings
⤷   computeTrigger String Event that will trigger the code analysis procedure to diagnose comments. Possible values:
onType -when editing a file (online) on large files can significantly slow down editing
onSave - when saving a file (default)
never - analysis will not be performed
⤷   ordinaryAppSupport Boolean Ordinary client support. Diagnostics will require taking into account the features of a ordinary application. Values:
true - the configuration uses ordinary application (default)
false - ignore ordinary application warnings
⤷   skipSupport String This parameter sets 1C configuration file skipping mode (for example files are not analyzed for issues) which are "on support" from vendor configuration. Possible values:
withSupport - skip all modules set "on support" (all "locks" types)
withSupportLocked - skip modules set "on support" with prohibited modification ("yellow closed lock")
never - skip no modules as support mode is not analyzed (set by default)*
⤷   mode String Setting for controlling the diagnostic settings accounting mode. Possible options:
OFF - All diagnostics are considered to be turned off, regardless of their settings.
ON - All diagnostics enabled by default are considered enabled, the rest - depending on personal settings
EXCEPT - All diagnostics other than those specified are considered enabled.
ONLY - Only the specified diagnostics are considered enabled.
* ALL - All diagnostics are considered enabled
⤷   parameters JSON-Object Parameter is a collection of diagnostics parameters. Collection items are json-objects with the following structure:
object key - string, is diagnostic key
object value - if is boolean, then interpreted as diagnostic off-switch (false) or on-switch with default parameters (true), if is type json-object, collection of diagnostic parameters.

Key, if set to ON by default and all allowed parameters and examples are given on the diagnostic page.
⤷   minimumLSPDiagnosticLevel String This parameter allows setting a minimum LSP severity level for running diagnostics. Diagnostics with severity level lower than specified will not run. Possible values:
Error - error
Warning - warning
Information - information
Hint - hint

By default, the parameter is not set and all diagnostics run according to other settings.
⤷   overrideMinimumLSPDiagnosticLevel String This parameter allows setting a minimum severity level for LSP diagnostics. If the diagnostic severity is lower than specified, it will be raised to the specified level. Possible values:
Error - error
Warning - warning
Information - information
Hint - hint

By default, the parameter is not set and diagnostic levels are used according to their definition.
⤷   metadata JSON-Object Parameter is a collection of diagnostic metadata overrides. Collection items are json-objects with the following structure:
object key - string, is diagnostic key
object value - json-object with diagnostic parameters to override. You can override: type, severity, scope, modules, minutesToFix, activatedByDefault, compatibilityMode, tags, canLocateOnProject, extraMinForComplexity, lspSeverity.

Values from configuration file override those defined in source code. The lspSeverity parameter allows explicitly setting LSP severity level (Error, Warning, Information, Hint), if not specified - calculated automatically.
⤷   subsystemsFilter JSON-Object Filter by configuration subsystems
⤷   analyzeOnStart Boolean Starting the analysis of the entire project at server startup. If enabled, after the context is built on the client, information about diagnostics in all project files will be sent.
⤷   ignoredAuthors Array String List of author email addresses whose lines of code are excluded from analysis based on git blame data. If the list is empty (default), filtering by authorship is not performed.
   ⤷   include Array String List of names of subsystems for which objects the analysis is performed, including child subsystems
   ⤷   exclude Array String List of names of subsystems excluded from analysis, including child subsystems
documentLink JSON-Object Contains documentation link settings
⤷   showDiagnosticDescription Boolean Show additional links to diagnostics documentation. By default, the parameter is off (set to false)
inlayHint JSON-Object ontains settings for displaying inlay hints in advanced code editors/IDEs (for example Visual Studio Code), which displays various information directly in the code line.
⤷   parameters JSON-Object A collection of inlay hints settings. The elements of the collection are json objects of the following structure:
object key - a string that is an identifier of inlay hint
object value - can take either a boolean value, and then it is interpreted as disabling inlay hint (false) or enabling them with parameters by default (true), or a value of type json-object, which is a set of inlay hint settings.
   ⤷   cognitiveComplexity Boolean or JSON-Object Enables displaying the value of the Cognitive Complexity method as inlay hints. By default, the setting is set to true.
   ⤷   cyclomaticComplexity Boolean or JSON-Object Enables displaying the value of the Cyclomatic Complexity method as inlay hints. By default, the setting is set to true.
   ⤷   methodCall Boolean or JSON-Object Enables displaying the parameters of the invoked method (both configuration/library and platform methods) as inlay hints. By default, the setting is set to true. Available parameters:
showParametersWithTheSameName - show parameters with names contained in the passed value. The default parameter value is false.
showDefaultValues - show default values for parameters not passed. The default value of the parameter is true.
   ⤷   sourceDefinedMethodCall Boolean or JSON-Object Deprecated, use methodCall (a single setting for both configuration/library and platform method calls). The key is kept for backward compatibility with older configuration files. Available parameters are the same as for methodCall.
   ⤷   variableType Boolean or JSON-Object Enables displaying the inferred type of variables in assignments as inlay hints. By default, the setting is set to true.
capabilities JSON-Object Settings for LSP capabilities that the server advertises to clients. Use this section to override defaults such as document sync mode.
⤷   textDocumentSync JSON-Object Settings for text document synchronization.
   ⤷   change String Text document sync strategy advertised to the client. Supported values: Incremental (default), Full, None. Changing this value requires restarting BSL Language Server so the new capability is sent to clients.
workspaceSymbol JSON-Object Settings for the workspace/symbol search.
⤷   syncFuzzySearch Boolean Enables a synchronous blocking fuzzy (substring/subsequence) scan appended to the response for clients that do not support partial-result streaming. Supported values: true, false (default). Use true for clients without partial-result streaming (VS Code currently does not support it). In partial/streaming mode the fuzzy tail is always sent regardless of this setting.
useDevSite Boolean When you turn on the settings, the resulting documentation links will lead to the develop version of the site. By default, the parameter is off (set to false)
siteRoot String The path to the root of the site with the documentation. By default, the parameter value is "https://1c-syntax.github.io/bsl-language-server"
traceLog String To log all requests (incoming and outgoing) between BSL Language Server and Language Client from used editor/IDE, this parameter sets log file path. The path can set either absolute or relative (from project root), by default the value is not set.

WARNING

When starting BSL Language Server overwrites this file
Speed of interaction between client and server DRAMATICALLY REDUCED
configurationRoot String This parameter is intended to indicate the root directory the 1C configuration files are located in the project directory. It can be useful if there are several configuration directories in the same project directory or when the structure of the project directory is so complex. By default, the parameter is empty and BSL Language Server determines the location of the configuration root directory independently
sendErrors String Mode for sending error messages to BSL Language Server developers. More Monitoring.Possible values:
ask - ask permission on every error (set by default).
send - always send error messages.
* never - never send error messages.
references JSON-Object Contains reference index settings
⤷   commonModuleAccessors Array String List of 'Module.Method' patterns for methods returning common module references (e.g. CommonUse.CommonModule("ModuleName")). Supports both format with module name (CommonUse.CommonModule) and local call (CommonModule). By default, includes standard BSL patterns: ОбщийМодуль, CommonModule, ОбщегоНазначения.ОбщийМодуль, ОбщегоНазначенияКлиент.ОбщийМодуль, ОбщегоНазначенияСервер.ОбщийМодуль, ОбщегоНазначенияКлиентСервер.ОбщийМодуль, ОбщегоНазначенияПовтИсп.ОбщийМодуль and their English equivalents.
formatting JSON-Object Contains code formatting settings.
⤷   useUpperCaseForOrNotAndKeywords Boolean Case of the And/Or/Not keywords when formatting. Values:
true - uppercase (OR, NOT, AND) (default)
false - CamelCase (Or, Not, And)
⤷   useKeywordsFormatting Boolean Format keywords to canonical view. Default true.
⤷   useOnTypeFormatting Boolean Enable formatting on typing a trigger character (textDocument/onTypeFormatting). Triggers are Enter and ;. Default true.
semanticTokens JSON-Object Contains semantic tokens settings.
⤷   strTemplateMethods Array String List of 'Module.Method' patterns for string template functions similar to СтрШаблон/StrTemplate. Strings inside calls to these functions are highlighted with placeholder detection (%1, %2, etc.). Both the module-qualified format and local call are supported. Default: ПодставитьПараметрыВСтроку, SubstituteParametersToString, СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку, StringFunctionsClientServer.SubstituteParametersToString.
oscript JSON-Object Contains OneScript libraries settings.
⤷   libRoots Array String Additional root directories to search for OneScript libraries (each subdirectory is scanned for lib.config). A path can be absolute or relative (to the workspace). Empty by default.
⤷   useEnvLibLocation Boolean In addition to libRoots, also use paths from the OSCRIPT_LIB_LOCATION environment variable. Default false (to avoid unexpectedly picking up libraries, e.g. on CI).
⤷   showImplicitLibraryEntriesInCompletion Boolean Suggest implicit library entries (.os files not declared in lib.config) in no-dot completion. Default false. Useful for a library author working on their own project.
v8platform JSON-Object Contains 1C:Enterprise platform types settings.
⤷   binPath String Path to the bin directory of an installed 1C:Enterprise platform (where syntax-helper files shcntx_*.hbk, shlang_*.hbk are located). If not set, the most recent installation on the machine is autodetected. Example: C:\Program Files\1cv8\8.3.27.1786\bin.
⤷   enabled Boolean Allow loading platform context from the syntax-helper of an installed 1C. Default true. Can be disabled (e.g. in a test environment) to avoid expensive autodetection and HBK parsing.
⤷   targetVersion String Target 1C platform version for compatibility diagnostics (deprecation, member availability by version). Takes priority over the configuration compatibility mode. When empty, the configuration compatibility mode is used, and if that is unset, the newest platform is assumed. Format: 8.3.21.
excludePaths Array String Path patterns to exclude from indexing. Matched against paths relative to the configuration root (e.g. directory names .git, node_modules or glob **/.git/**, **/.*). Only BSL/OS files under excluded paths are skipped from indexing and analysis. Empty by default.

You can use the following JSON schema to make it easier to compile and edit a configuration file:

https://1c-syntax.github.io/bsl-language-server/configuration/schema.json

Examples

Example 1: Using minimumLSPDiagnosticLevel to filter diagnostics

This example demonstrates filtering diagnostics by LSP severity level:

{
  "$schema": "https://1c-syntax.github.io/bsl-language-server/configuration/schema.json",
  "language": "en",
  "diagnostics": {
    "minimumLSPDiagnosticLevel": "Warning",
    "parameters": {
      "LineLength": {
        "maxLineLength": 140
      },
      "MethodSize": false
    }
  }
}

Example 2: Using overrideMinimumLSPDiagnosticLevel to adjust severity

This example demonstrates adjusting diagnostic severity display:

  • Language of diagnostics messages - English;
  • Enables the calculation of diagnostics in continuous mode (computeTrigger = onType)
  • Diagnostics are calculated only for the objects of the "StandardSubsystems" subsystem, with the exception of "ReportVariants" and " ObjectVersioning"
  • Raises the severity level to Warning for all running diagnostics (diagnostics with Information or Hint will be displayed as Warning)
  • Overrides the diagnostic type EmptyCodeBlock to ERROR and severity to BLOCKER
{
  "$schema": "https://1c-syntax.github.io/bsl-language-server/configuration/schema.json",
  "language": "en",
  "diagnostics": {
    "computeTrigger": "onType",
    "overrideMinimumLSPDiagnosticLevel": "Warning",
    "metadata": {
      "EmptyCodeBlock": {
        "type": "ERROR",
        "severity": "BLOCKER"
      }
    },
    "subsystemsFilter": {
      "include": [
        "StandardSubsystems"
      ],
      "exclude": [
        "ReportVariants",
        "ObjectVersioning"
      ]
    }
  }
}