@@ -18,20 +18,32 @@ Zed supports Rego via Regal and the [zed-rego](https://github.com/StyraInc/zed-r
18
18
community. The extension provides syntax highlighting, linting, and all the other language server features provided by
19
19
Regal.
20
20
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
22
35
23
36
[ 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:
26
38
27
39
``` lua
28
40
require (' lspconfig' ).regal .setup ()
29
41
```
30
42
31
- ## Neovim via none-ls
43
+ ## none-ls
32
44
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.
35
47
36
48
Minimal installation via [ VimPlug] ( https://github.com/junegunn/vim-plug )
37
49
@@ -58,3 +70,22 @@ default allowRbac := true
58
70
Example of the diagnostics in as shown in the UI:
59
71
60
72
![ 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