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

Publish as web extension #139

Open
anderseknert opened this issue Apr 9, 2024 · 5 comments
Open

Publish as web extension #139

anderseknert opened this issue Apr 9, 2024 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@anderseknert
Copy link
Member

Web extensions are extensions that can be installed in the web interface for VS Code, such as presented in GitHub et. al.

While we can't do things like calling out to the OPA binary in this context, we could still provide basic features like syntax highlighting.

Note that extensions can be published both as a "desktop" version and a web one, which is what we'll want to do here. We don't want to limit the capabilities of the desktop one, so this would be a new additional part of the project.

More info here: https://code.visualstudio.com/api/extension-guides/web-extensions

(It's even possible to run a language server inside of a web worker, so we could compile Regal to Wasm (as @srenatus previously demonstrated) or if not that, at least the Regal policies, and have linting enabled too. But let's start with the basics)

@anderseknert anderseknert added enhancement New feature or request help wanted Extra attention is needed labels Apr 9, 2024
@srenatus
Copy link
Collaborator

srenatus commented Apr 9, 2024

While we can't do things like calling out to the OPA binary in this context, we could still provide basic features like syntax highlighting.

It has to be tried, but if we can compile regal to Wasm and use it, then it should work for opa eval, too.

@anderseknert
Copy link
Member Author

That's true, but things like evaluation isn't covered by a language server, at least not without custom extensions. I guess it's possible to run parts of the client in Wasm too, and if so we could have OPA run there. Considering the size and performance of Regal compiled to Wasm last time we tried, perhaps a good middle ground, or at least first step, would be to compile the Regal policies only, and invoke those inside of the LSP web worker 🤔 Oh well, things may look very different when we get there.

@anderseknert
Copy link
Member Author

@charlieegan3
Copy link
Collaborator

charlieegan3 commented Aug 19, 2024

In response to:

TCP StyraInc/regal#764 on the LSP server side won't solve the problem with connecting extensions from the Web?

It'd be part of it for sure, if we didn't go the WASM route, the other major parts to this as I understand it are:

  • something to read in the file contents (rather than just the open buffers), the local version of the server reads from disk.
  • some system of hosting a TCP Regal LS instance that supports multiple users. Even if this were to be a self hosted component, we'd need to think of a good way to make this available for users (container image etc.).

@nikpivkin
Copy link
Contributor

I think I accidentally deleted the comment

TCP support on the LSP server side won't solve the problem with connecting extensions from the Web?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants