open-policy-agent / opa-idea-plugin

Open Policy Agent plugin for IntelliJ
MIT License
56 stars 23 forks source link

Regal language server integration (linting and language features) #171

Open anderseknert opened 8 months ago

anderseknert commented 8 months ago

Regal, the linter for Rego, recently had a language server added. For now this supports diagnostics (i.e. linting), but more features are in development. The VS Code extension for OPA, as well as Vim integrates Regal for linting, and these integrations will only get better as more capabilities are added to the Regal language server.

Other than linting — and that's no small feat considering Regal already has 70+ linter rules — features we intend to support in the future include things like:

Obviously, it would be great if the OPA plugin for IntelliJ got this for free via a language server integration!

JetBrains have for whatever odd reason decided that plugins that make use of the language server protocol should only be allowed for users of their paid products:

The integration with the Language Server Protocol is created as an extension to the paid IntelliJ-based IDEs. Therefore, plugins using Language Server integration are not available in Community releases of JetBrains products and Android Studio from Google.

I don't believe that's a position they'll be able to maintain over time, but until that changes, perhaps it would be possible have the project build two extensions — one with LSP integration and one without. Users of paid IntelliJ products would then be able to benefit from the extra features provided by Regal, while non-paying users can continue using the plugin as they do today.