No longer maintained
IntelliJ Code Server is an example project how IntelliJ platform can be used as a server to provide some IntelliJ functionality (like code quality analysis) for side services.
The project consist of several modules:
-
ij-core is responsible for opening a project (e.g. Python or Kotlin project) and working with its PSI. Also, it has IJCodeInspector that can find inspections by language and perform them on a code fragment.
-
ij-server is responsible for listening a port and apply services, e.g. CodeInspectionServiceImpl that finds a file and returns a list of inspections that were found.
-
ij-starter is responsible for starting a new instance of the ij-server by a config file.
-
ij-model is responsible for storing models for the server, e.g. the server's input and output etc.
Run ./gradlew :ij-starter:runIde -Pconfig=path/to/config/file command from the root of the project.
The config file must be a JSON file with several fields (see CodeServerConfig.kt file). An example of the config file can be found here. Possible options for language are listed below:
kotlinfor KotlinPythonfor Python
You could also specify several optional arguments:
| Argument | Description |
|---|---|
| ‑‑PloggingLevel | Logging level. The available options are listed here. By default, INFO. |
| ‑‑PlogsPath | Path to a file where to save logs. By default, all logs are outputted to stdout. |
This repository already contains predefined template projects for different language. To run inspections correctly, you should additionally set up templates. Instructions on how to do it you could find in the corresponding README file. In this file you could also find notes about requirements for your own custom template projects.
TODO
This repository contains an example of client in Python, you just need to navigate to the scripts folder and follow the README instructions.