Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a Language Server for Rego #4041

Closed
scevallos opened this issue Nov 18, 2021 · 8 comments
Closed

Provide a Language Server for Rego #4041

scevallos opened this issue Nov 18, 2021 · 8 comments

Comments

@scevallos
Copy link
Contributor

scevallos commented Nov 18, 2021

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.

@anderseknert
Copy link
Member

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
Copy link
Member

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.

@stale
Copy link

stale bot commented Dec 29, 2021

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

@stale stale bot added the inactive label Dec 29, 2021
@msvechla
Copy link

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

@stale stale bot removed the inactive label Jul 21, 2022
@stale
Copy link

stale bot commented Aug 30, 2022

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

@RmStorm
Copy link
Contributor

RmStorm commented Feb 10, 2023

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

@anderseknert
Copy link
Member

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

@anderseknert
Copy link
Member

I had forgotten that this was still an open issue! While there are still a few parts of the specification not yet supported, Regal implements most of the LSP features, and reading the original description of this ticket, I'd say it ticks most of the boxes. If there's any specific feature from the LSP spec you find important and that's currently missing, feel free to open an issue in that repo. Closing this as "not planned" as we're not likely to consider this for the OPA project itself, but from any other point of view, it's completed.

@anderseknert anderseknert closed this as not planned Won't fix, can't repro, duplicate, stale Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants