English | Русский
JSA DSL is a VSCode plugin that helps to create custom DSL rules. It provides advanced highlighting of JSA DSL syntax, smart autocomplete, and comprehensive code diagnostics. The plugin also supports quick bug fixes, code navigation, and automatic formatting when editing .jsa.dsl files.
Syntax highlighting
Support of colored highlighting for all JSA DSL constructs.
Smart autocomplete
Real-time autocompletion of language constructs that considers the context and syntax rules.
Advanced code diagnostics
The plugin provides a comprehensive three-level check that includes:
- Syntax analysis:
- Detection of errors in the code structure (unmatched brackets, missing semicolons, unfinished blocks)
- Name validation for namespaces, classes, and functions
- Validation of arguments of the
Detectandfilterfunctions
- Semantic check:
- Detection of duplicate declarations of classes and functions
- Checking for unknown PVO Grammar IDs and vulnerability types
- Analysis of data type matches and usage of allowed references
- Detection of multiple
returnoperators - Checking for duplicate names of function parameters and base classes
- Disabling of nested class and function declarations
- Code quality analysis:
- Detection of unnecessary
passoperators - Detection of unused parameters in functions
- Detection of unnecessary
Context tooltips
Hovering over a code element shows information about the syntax and semantics.
Quick Fixes
Deletion of unnecessary pass operators and automatic renaming or deletion of unused parameters
Code navigation
Support of the following commands to speed up code navigation and refactoring:
- Go to Definition: go to the source code of functions and classes
- Find References: find all references to the selected element in the project
Real-time formatting
Automatic stylistic unification of code as you enter it (active by default for .jsa.dsl files)
When you install the plugin, the language server is downloaded and started automatically. Server files are saved to the following locations:
- In Windows:
%LOCALAPPDATA%\jsa-dsl\language-server\{server-version} - In Linux and macOS:
~/.config/jsa-dsl/language-server/{server-version}
To use the plugin, just open the .jsa.dsl file.
The plugin requires the JSA DSL language server for correct operation. The server can be installed automatically or manually (by downloading it from the links provided below).
To install the language server manually:
-
Download the language server archive using one of the links:
Note. You can use self-contained versions of the extension for major platforms (Windows, Linux, macOS). These versions already include the language server and do not require additional downloads.
-
Unpack the archive to one of the following locations:
-
In Windows:
%LOCALAPPDATA%\jsa-dsl\language-server\0.1.0.62\ -
In Linux:
~/.config/jsa-dsl/language-server/0.1.0.62/ -
In macOS:
~/.config/jsa-dsl/language-server/0.1.0.62/
Note. You can also extract the server to any other directory and specify the path in the plugin settings using the
jsa.dsl.languageServer.customPathparameter (see the Plugin settings section). -
-
In macOS, run the commands provided below to delete the
com.apple.quarantineattribute, sign the binary file, and set execution permissions:xattr -cr <path_to_server_folder>/JSA.DSL.LSP codesign --sign - --force --deep <path_to_server_folder>/JSA.DSL.LSP
-
In Linux/macOS, set execute permissions for the executable file:
chmod +x <path_to_server_folder>/JSA.DSL.LSP
-
Restart the plugin by running the
JSA DSL: Restart plugincommand.
After restart, the plugin should detect the installed language server and start using it. If the plugin does not detect the server, make sure that:
- The files were extracted to the right directory.
- Access permissions are set correctly (Linux/macOS).
- The logs in View → Output → JSA DSL don't contain any errors.
The plugin is automatically associated with files with the following extensions:
.dsl, the generic extension for DSL files (** enabled by default**).jsa.dsl, the main recommended extension for JSA DSL scripts
This allows you to work with JSA DSL scripts regardless of the file extension used.
Possible conflicts with other plugins
The .dsl extension is also used by other tools and plugins (such as Xtext DSL, Jenkins Job DSL, or Gradle DSL). If you have other plugins for .dsl files installed and experience conflicts, you can disable automatic association.
To disable automatic association:
-
Open the plugin settings.
-
Set the
jsa.dsl.associateAllDslFilesoption tofalse. -
Restart the plugin by running the
JSA DSL: Restart plugincommand.The plugin will then work only with
.jsa.dslfiles.
You can go to the plugin settings by selecting File → Preferences → Settings in the main menu or by pressing Ctrl+,.
The plugin configuration page contains the following settings:
-
jsa.dsl.languageServer.customPath, a custom path to the language server. By default, there's no custom path and the standard path is used (see the Installation and use section). -
jsa.dsl.associateAllDslFilesenables the processing of all.dslfiles along with.jsa.dslfiles. The default value istrue. If changed, plugin restart is required.Note. If you encounter conflicts with other plugins that process
.dslfiles, disable this option. -
jsa.dsl.diagnostics.enableUnusedParameterenables warnings for unused function parameters. The default value isfalse. -
jsa.dsl.diagnostics.enableUnnecessaryPassWarningenables warnings for unnecessarypassstatements. The default value istrue. -
jsa.dsl.diagnostics.enableTypeCheckWarningenables warnings for return type mismatches. The default value istrue.
To work with the plugin, you can enter the following commands into the command palette:
JSA DSL: Install language server. Installs the language server manually. Available if the server is not installed.JSA DSL: Restart plugin. Restarts the plugin and language server. May be needed when updating settings or fixing issues.
If you have any questions about using the plugin, detect an issue, or want to suggest an improvement, leave a message in the project repository.
