Skip to content

Commit 7565b81

Browse files
authoredJul 23, 2024··
docs: Update notes on neovim and packaging (#934)
Signed-off-by: Charlie Egan <charlie@styra.com>
1 parent c0348af commit 7565b81

File tree

3 files changed

+45
-16
lines changed

3 files changed

+45
-16
lines changed
 

‎README.md

+6-9
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ brew install styrainc/packages/regal
6060
```
6161

6262
<details>
63-
<summary><strong>Manual download options</strong></summary>
63+
<summary><strong>Other Installation Options</strong></summary>
64+
65+
Please see [Packages](https://docs.styra.com/regal/adopters#packaging)
66+
for a list of package repositories which distribute Regal.
67+
68+
Manual installation commands:
6469

6570
**MacOS (Apple Silicon)**
6671
```shell
@@ -88,16 +93,8 @@ curl.exe -L -o regal.exe "https://github.com/StyraInc/regal/releases/latest/down
8893
docker pull ghcr.io/styrainc/regal:latest
8994
```
9095

91-
**asdf**
92-
```shell
93-
asdf plugin add regal
94-
asdf install regal latest
95-
asdf global regal latest
96-
```
97-
9896
See all versions, and checksum files, at the Regal [releases](https://github.com/StyraInc/regal/releases/) page, and
9997
published Docker images at the [packages](https://github.com/StyraInc/regal/pkgs/container/regal) page.
100-
10198
</details>
10299

103100
### Try it out!

‎docs/adopters.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ The following package managers include Regal in their repositories, either nativ
4343
- [Homebrew](https://brew.sh/) via Styra's [homebrew-packages](https://github.com/StyraInc/homebrew-packages)
4444
- [asdf](https://asdf-vm.com/) via [asdf-regal](https://github.com/asdf-community/asdf-regal)
4545
- [pkgsrc](https://www.pkgsrc.se/) and the [regal](https://pkgsrc.se/devel/regal) package
46-
- [Nix](https://nixos.org/): [regal](https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/re/regal/package.nix)
46+
- [Nix](https://nixos.org/): [regal](https://search.nixos.org/packages?channel=24.05&show=regal&from=0&size=50&sort=relevance&type=packages&query=regal)
47+
- [mason.vim](https://github.com/williamboman/mason.nvim): [regal](https://github.com/mason-org/mason-registry/blob/main/packages/regal/package.yaml)
4748

4849
## Companies and Organizations
4950

‎docs/editor-support.md

+37-6
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,32 @@ Zed supports Rego via Regal and the [zed-rego](https://github.com/StyraInc/zed-r
1818
community. The extension provides syntax highlighting, linting, and all the other language server features provided by
1919
Regal.
2020

21-
## Neovim via nvim-lspconfig
21+
## Neovim
22+
23+
There are a number of different plugins available for Neovim which integrate
24+
with language servers using the Language Server Protocol.
25+
26+
Generally, the Regal binary should be [installed](https://docs.styra.com/regal#getting-started)
27+
first. [`mason.vim`](https://github.com/williamboman/mason.nvim) users can install the
28+
Regal binary with `:MasonInstall regal`
29+
([package definition](https://github.com/mason-org/mason-registry/blob/2024-07-23-asian-hate/packages/regal/package.yaml)).
30+
31+
Below are a number of different plugin options to configure a language server
32+
client for Regal in Neovim.
33+
34+
### nvim-lspconfig
2235

2336
[nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) has native support for the
24-
Regal language server. Provided that you already have the `regal` binary installed,
25-
use the configuration below to enable LSP features in [Neovim](https://neovim.io).
37+
Regal language server. Use the configuration below to configure Regal:
2638

2739
```lua
2840
require('lspconfig').regal.setup()
2941
```
3042

31-
## Neovim via none-ls
43+
## none-ls
3244

33-
[none-ls](https://github.com/nvimtools/none-ls.nvim) - Use Neovim as a language server to inject LSP diagnostics,
34-
code actions, and more via Lua.
45+
[none-ls](https://github.com/nvimtools/none-ls.nvim) - Use Neovim as a
46+
language server to inject LSP diagnostics, code actions, and more via Lua.
3547

3648
Minimal installation via [VimPlug](https://github.com/junegunn/vim-plug)
3749

@@ -58,3 +70,22 @@ default allowRbac := true
5870
Example of the diagnostics in as shown in the UI:
5971

6072
![regal in none-ls](./assets/editors-neovim.png)
73+
74+
## nvim-cmp
75+
76+
[nvim-cmp](https://github.com/hrsh7th/nvim-cmp) supports the adding of language
77+
servers as a source.
78+
79+
To use Regal with `nvim-cmp`, it is recommended that you use
80+
the [`nvim-lspconfig` source](https://github.com/hrsh7th/cmp-nvim-lsp) and
81+
follow the instructions above to configure `nvim-lspconfig`.
82+
83+
## Other plugins
84+
85+
To see live linting of Rego, your plugin must support
86+
[`textDocument/diagnostic`](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_diagnostic)
87+
messages.
88+
89+
There are many language server integrations for Neovim, if you'd like to see
90+
another one listed, please [open an issue](https://github.com/StyraInc/regal/issues/new)
91+
or drop us a message in [Slack](http://communityinviter.com/apps/styracommunity/signup).

0 commit comments

Comments
 (0)
Please sign in to comment.