Quick start¶
The following describes the steps to get started quickly
Create new diagnostics¶
- Create project directory
bsl-language-server
- Clone the project repository to the created directory
https://github.com/1c-syntax/bsl-language-server.git
- Set up the environment according to the instructions
- Execute commands to ignore changes in service files
git update-index --assume-unchanged ./.idea/compiler.xml
git update-index --assume-unchanged ./.idea/encodings.xml
git update-index --assume-unchanged ./.idea/misc.xml
- Open the
build.gradle.kts
file from the project directory, agree to import the dependencies, wait for them to download - Run (from context menu or ide console) command
gradlew test
, if passed then all settings are correct - Make yourself familiar with diagnostics development example, structure and files purpose description, and other articles in the section for developers
Using the AST Debugger¶
To analyze the AST tree when creating diagnostics, you may need to get a visual representation of the tree. To do this, follow these steps
- Create
bsl-parser
project directory - Clone the project repository into the created directory
https://github.com/1c-syntax/bsl-parser.git
- Set up the environment according to the instruction (if not previously performed)
- Install
ANTLR v4 grammar plugin
-
restart IDEA
-
Set up the plugin -
File | Settings | Languages & Frameworks | ANTLR v4 default project settings
ANTLR v4 grammar plugin
- Set up
Case transformation in the Preview window
inTransform to uppercase when lexing
- Open the
build.gradle.kts
file from the project directory, agree to import the dependencies, wait for them to download - After downloading:
- To analyze bsl files (1C code)
- Open
src/main/antlr/BSLParser.g4
- Place the cursor on the line with the rule
file:
(the first rule in the file) and select the context menu itemTest Rule file
- In the opened window, select a bsl-file or paste text from the clipboard
- Open
- To analyze sdbl files (1C queries)
- Open
src/main/antlr/SDBLParser.g4
- Place the cursor on the line with the rule
queryPackage:
(the first rule in the file) and select the context menu itemTest Rule queryPackage
- In the opened window, select a sdbl-file or paste text from the clipboard
- Open