opa icon indicating copy to clipboard operation
opa copied to clipboard

Provide a Language Server for Rego

Open scevallos opened this issue 2 years ago • 5 comments

What part of OPA would you like to see improved?

I would really like to see improvements to the developer experience of writing complex Rego policies (for example: jump to declaration of some element, find all usages of some element, etc.) and some aspects of making these improvements would be facilitated through the production of a Language Server for Rego.

The OPA VSCode plugin currently only provides a small set of features which could be expanded to include more, such as hover information, auto completion, jump to definition, among others through the use of a language server.

The production of a language server would allow use of these features by any tool that can leverage the Language Server Protocol (LSP).

Describe the ideal solution

A fully-featured Rego language server and its integration within the OPA VSCode plugin.

Describe a "Good Enough" solution

A Rego language server with a limited set of capabilities (at least find references and go-to definition as "must-haves")

Nice-to-have: integration with the current OPA VSCode plugin, but that could be done independently.

Additional Context

Related: I've created an issue in the IDEA plugin Repo for the same functionality to be added, however it would be done through extending the existing plugin. It appears that IntelliJ IDEs do not have 1st party support for LSP, just a 3rd party plugin.

scevallos avatar Nov 18 '21 15:11 scevallos

That would indeed be awesome! There are a lot of ideas around improving the OPA/Rego development and debugging experience in the pipeline, so this is a great one to keep in mind in that space!

anderseknert avatar Nov 19 '21 09:11 anderseknert

The new JetBrains IDE Fleet seems to provide language integrations via LSP as well:

Fleet provides a polyglot experience, offering smart support for many languages and technologies out of the box, with support for even more planned via dedicated plugins. With the help of LSPs you will also be able to use other language services in Fleet.

anderseknert avatar Nov 29 '21 12:11 anderseknert

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.

stale[bot] avatar Dec 29 '21 15:12 stale[bot]

Is there any news on this? Having an LSP for rego would really improve the daily workflow of developers working with rego.

msvechla avatar Jul 21 '22 13:07 msvechla

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.

stale[bot] avatar Aug 30 '22 22:08 stale[bot]

There is this project but it seems to not be fully featured yet: https://github.com/kitagry/regols.

RmStorm avatar Feb 10 '23 08:02 RmStorm

Cool! I hope we'll see more progress there 😃 Great work so far @kitagry 👍

anderseknert avatar Feb 10 '23 11:02 anderseknert