Ada-IntelliJ is a plugin for IntelliJ IDEs adding support for the Ada programming language, with many planned features including syntax and error highlighting, code completion, reference resolution, project management, building, and more.
Features currently supported:
- Recognizing
.adb
,.ads
and.gpr
files - Syntax highlighting for
.adb
and.ads
files - Basic gprbuild support
- Basic references/usages features (goto definition, usage highlighting, find references)
- Basic code completion
- Quick line commenting
The plugin is currently under development and most supported features are still experimental. If you encounter problems/bugs, please submit an issue to this repository.
Sections:
The project uses Gradle and the Gradle IntelliJ plugin for building, testing, packaging and deploying the plugin. In the following sections, the given instructions involve running Gradle tasks from the command-line using the Gradle wrapper script. A Gradle task called example
can be run as follows:
# Linux / macOS
./gradlew example
@REM Windows
gradlew.bat example
Note that all Gradle tasks can also be run from within IntelliJ IDEA's Gradle plugin interface.
- Clone the project and move into the root directory:
git clone https://github.com/AdaCore/Ada-IntelliJ.git
cd Ada-IntelliJ
Alternatively, you may download the source code of the master branch as a zip archive and extract it:
unzip Ada-IntelliJ-master.zip
cd Ada-IntelliJ-master
- Run the Gradle wrapper script with the
build
task. Thebuild
task involves running JUnit tests (see Testing the plugin) after compiling the Java sources, which is recommended when running the plugin by installing it from disk to ensure that it passes the tests first. If however you wish to build the plugin without running the tests, use thebuildPlugin
task instead.
All build-generated files reside in the build/
directory and can be cleaned up by running the clean
task.
There are currently two ways to run the plugin in an IntelliJ IDE.
This is the easier and recommended method as it does not require any additional installation, not even an IntelliJ IDE! The Gradle wrapper takes care of fetching all the dependencies, including an appropriate version of IntelliJ IDEA, and running it in a sandboxed environment with the plugin installed.
Even though the plugin should in general never affect the configuration of the IDE instance in which it is installed, this may still happen due to a bug that might appear during the development phase, which is why this method is recommended as it does not involve installing the plugin to your IDE installation. If however you wish to try the plugin without giving up all your IDE configurations, or you wish to try it on an IntelliJ IDE other than IDEA, then you may proceed with Installing the Plugin from Disk at your own risk.
- Clone the project and move into the root directory, as in step 1 of Building the Plugin
Before running the plugin, you may want to run the tests and make sure they all pass.
- Run the Gradle wrapper script with task
runIde
That's it! If all goes well, IntelliJ IDEA should start with the plugin installed.
This method requires building the project with Gradle before installing it to an IntelliJ IDE.
-
Clone/Download and build the plugin, making sure that the build is successful
-
Open the IntelliJ IDE of your choice and go to
File | Settings | Plugins
and click onInstall plugin from disk...
-
In the file chooser that opens, navigate to the directory of the cloned/extracted Ada-IntelliJ repo, then from there navigate into
build > distributions
and choose the zip archive namedAda-IntelliJ-<version>.zip
(if thedistributions
directory does not exist than the build in step 1 probably failed) -
Finally, in the
Plugins
tab of theSettings
window, click onRestart <IDE name>
If all goes well, your IDE should restart with the plugin installed.
The project uses JUnit5 to test part of its implementation. Most non-private methods whose function/behavior is not strongly tied to the IntelliJ platform (e.g. registering file types, saving/restoring run configuration settings, etc.) and that are not system-dependent (e.g. searching the PATH for executables) are tested, each with various scenarios.
Test source files are located in src/test/control/
and src/test/ui/
, and test resource files are located in src/test/resources/
.
-
Clone the project and move into the root directory, as in step 1 of Building the Plugin
-
Run the Gradle wrapper script with task
test
If no test failures are reported, then all the tests passed.
A comprehensive test report including success rates and execution durations is automatically generated by Gradle in HTML form and can be found in build/reports/tests/test/
.
- LSP integration
- Ada parser creating PSI trees from Ada source files
- Resolving references (using ALS)
- Finding references (using ALS)
- Completion contributor (using ALS)
- IDE recognizes GPR (.gpr) files (no syntax highlighting)
- Basic gprbuild support, build configurations with limited customization
- gprbuild output hyperlinks to source code (requires gps_cli to be on PATH)
- Basic GPR file management
- IDE recognizes Ada body (.adb) and spec (.ads) files
- Basic syntax highlighting for body and spec files