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%"
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 the settings for displaying lens in advanced code editors/IDEs (for example, Visual Studio Code), which displays various information above a block of code. Object properties |
⤷ 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. |
documentLink |
JSON-Object |
Contains documentation link settings |
⤷ showDiagnosticDescription |
Boolean |
Show additional links to diagnostics documentation. By default, the parameter is off (set to false ) |
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 |
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
Setting example:
- Language of diagnostics messages - English;
- Changes the diagnostic setting for LineLength - Line Length limit, set the limit for the length of a string to 140 characters;
- Disable MethodSize - Method size restriction diagnostic.
- Enables the calculation of diagnostics in continuous mode (
computeTrigger = onType
)
{
"$schema": "https://1c-syntax.github.io/bsl-language-server/configuration/schema.json",
"language": "en",
"diagnostics": {
"computeTrigger": "onType",
"parameters": {
"LineLength": {
"maxLineLength": 140
},
"MethodSize": false
}
}
}