Skip to content

BSL Language Server Configuration

BSL Language Server provides the ability to change the settings using a configuration file in json format.
The created file must be specified using the key --configuration (or -c) when running BSL Language Server as a console application. If you use the editor / IDE with the BSL Language Server client plugin, place it in accordance with the documentation (this is usually the root of a project or workspace).

If there is no configuration file, an attempt will be made to find the ".bsl-language-server.json" file in "%HOMEPATH%"

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.
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.
⤷   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.
   ⤷   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.
   ⤷   sourceDefinedMethodCall Boolean or JSON-Object Enables displaying the parameters of the invoked configuration/library method 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.
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.

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

Example

Setting example:

  • Language of diagnostics messages - English;
  • Changes the diagnostic setting LineLength - Line length limit by setting line length limit of 140 characters;
  • Disable MethodSize - Method size restriction diagnostic.
  • 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"
{
  "$schema": "https://1c-syntax.github.io/bsl-language-server/configuration/schema.json",
  "language": "en",
  "diagnostics": {
    "computeTrigger": "onType",
    "parameters": {
      "LineLength": {
        "maxLineLength": 140
      },
      "MethodSize": false
    },
    "subsystemsFilter": {
      "include": [
        "StandardSubsystems"
      ],
      "exclude": [
        "ReportVariants",
        "ObjectVersioning"
      ]
    }
  }
}