Skip to content

BSL Language ServerLink

Actions Status

Language Server Protocol implementation for 1C (BSL) - 1C:Enterprise 8 and OneScript languages.

Perfomance measurement - SSL 3.1

CapabilitiesLink

  • File formatting
  • Selected region formatting
  • Symbol definition for current file (regions, procedures, functions, variables, defined via Var keyword)
  • Folding regions definition #Region, #If, procedures and functions, code blocks
  • Methods "Cognitive Complexity" and "Cyclomatic Complexity" scores
  • Diagnostics
  • Quick fixes for several diagnostics
  • Run diagnostics engine from command line
  • Run formatter engine from command line

Run from command lineLink

jar-files run through java -jar path/to/file.jar.

java -jar bsl-language-server.jar --help  BSL language server Usage: bsl-language-server [-h] [-c=<path>] [COMMAND [ARGS]]   -c, --configuration=<path>                Path to language server configuration file   -h, --help   Show this help message and exit Commands:   analyze, -a, --analyze  Run analysis and get diagnostic info   format, -f, --format    Format files in source directory   version, -v, --version  Print version   lsp, --lsp              LSP server mode (default)

Starting BSL Language Server in standard mode will run the Language Server communicating via LSP. stdin and stdout are used for communication.

By default diagnostics texts are displayed in Russian. To switch the diagnostics text language you need to set parameter language in configuration file or raise an event workspace/didChangeConfiguration:

Run in analyzer modeLink

To run in analyzer mode use parameter --analyze (short -a).

Usage: bsl-language-server analyze [-hq] [-c=<path>] [-o=<path>] [-s=<path>]                                    [-r=<keys>]... Run analysis and get diagnostic info   -c, --configuration=<path>                            Path to language server configuration file   -h, --help               Show this help message and exit   -o, --outputDir=<path>   Output report directory   -q, --silent             Silent mode   -r, --reporter=<keys>    Reporter key (console, junit, json, tslint, generic)   -s, --srcDir=<path>      Source directory   -w, --workspaceDir=<path>                             Workspace directory

To set source code folder for analysis use parameter --srcDir (short -s) followed by the path (relative or absolute) to the source code folder. To generate an analysis report you need to specify one or more reporters. To specify reporter use parameter --reporter or -r, followed by reporter key. You may specify several reporters. The list of reporters see in section Reporters.

Command line example to run analysis:

java -jar bsl-language-server.jar --analyze --srcDir ./src/cf --reporter json

When run analysis for large code base it is recommended to set parameter {code0}-Xmx{/code0} to set maximum limit of memory being allocated to java process. The size of allocated memory depends on the size of code base for analysis.

java -Xmx4g -jar bsl-language-server.jar ... other parameters

Run in formatter modeLink

To run in formatter mode use parameter --format (short -f).

Usage: bsl-language-server format [-hq] [-s=<path>] Format files in source directory   -h, --help            Show this help message and exit   -q, --silent          Silent mode   -s, --srcDir=<path>   Source directory

To set source code folder for formatting use parameter --srcDir (short -s) followed by the path (relative or absolute) to the source code folder.

Command line example to run formatting:

java -jar bsl-language-server.jar --format --srcDir ./src/cf

Configuration fileLink

A detailed description of the configuration file is given on this page

Special thanksLink

Many thanks to all contributors to the project, to all who participated in the discussions, who helped with the testing.

You are awesome!

Thanks to companies supporting open source projects, and especially to those who supported us:


YourKit

{a0 href="https://www.yourkit.com"}YourKit, LLC{/a0} is the creator of innovative and intelligent tools for profiling Java and .NET applications. YourKit has offered an open source license YourKit Java Profiler for BSL Language Server to improve its performance.

With YourKit Java Profiler we profile and improve project performance.


JetBrains

JetBrains is the creator of professional software for development. JetBrains has offered an open source license for his products, including IntelliJ IDEA Ultimate.

IntelliJ IDEA Ultimate is one of the best tools in its class.