Skip to content

Latest commit

 

History

History
224 lines (174 loc) · 21.9 KB

index.md

File metadata and controls

224 lines (174 loc) · 21.9 KB

BSL Language Server

Actions Status Download JitPack GitHub Releases GitHub All Releases Quality Gate Maintainability Coverage Benchmark telegram

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

Perfomance measurement - SSL 3.1

Capabilities

  • 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, queries
  • Methods "Cognitive Complexity" and "Cyclomatic Complexity" scores
  • Tooltip on local methods and methods of common / manager modules
  • Go to method definitions
  • Finding places to use methods
  • Method call hierarchy
  • Expand selection
  • Display color representation and convert between Color and WebColors`
  • Diagnostics
  • Quick fixes for several diagnostics
  • Run diagnostics engine from command line
  • Run formatter engine from command line

Supported protocol operations

??? workspace

Operation Supported Comment
didChangeWorkspaceFolders no
didChangeConfiguration yes with restrictions, see #1431
didChangeWatchedFiles no
symbol yes
executeCommand no
applyEdit no
willCreateFiles no

??? "Text Synchronization"

Opertaion Supported Comment
didOpen yes
didChange yes textDocumentSyncKind = Full
didClose yes
didSave yes
willSave no
willSaveWaitUntil no

??? textDocument

Operation Supported Comment Configurable?
publishDiagnostics yes tagSupport = true
versionSupport = true
список диагностик
yes
completion no resolveProvider = false
completionItem/resolve no
hover yes contentFormat = MarkupContent
signatureHelp no
declaration no not applicable in 1C:Enterprise
definition yes linkSupport = true
typeDefinition no
implementation no not applicable in 1C:Enterprise
references yes
documentHighlight no
documentSymbol yes hierarchicalDocumentSymbolSupport = true
codeAction yes codeActionKinds = ? (see #1433)
isPreferredSupport = true
yes
codeAction/resolve no
codeLens yes resolveProvider = false да
codeLens/resolve no
codeLens/refresh no
documentLink yes Displaying hyperlinks to diagnostics documentation.
tooltipSupport = true
resolveProvider = false
yes
documentLink/resolve no
documentColor yes
colorPresentation yes
formatting yes
rangeFormatting yes
onTypeFormatting no
rename no
prepareRename no
foldingRange yes
selectionRange yes
prepareCallHierarchy yes
callHierarchy/incomingCalls yes
callHierarchy/outgoingCalls yes
semanticTokens no
linkedEditingRange no
moniker no

Run from command line

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](language server protocol). 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 mode

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 mode

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, --src=<path>      Source directory or file

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

Command line example to run formatting:

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

Configuration file

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

Special thanks

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

YourKit, LLC 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.