Skip to content

Commit a8a6753

Browse files
authored
chore: add Next LS to README (#140)
1 parent bb9f59b commit a8a6753

1 file changed

Lines changed: 54 additions & 17 deletions

File tree

README.md

Lines changed: 54 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@
99

1010
`elixir-tools.nvim` provides a nice experience for writing Elixir applications with [Neovim](https://github.com/neovim/neovim).
1111

12-
> Note: This plugin does not provide autocompletion, I recommend using [nvim-cmp](https://github.com/hrsh7th/nvim-cmp).
12+
> **Note**
13+
> This plugin does not provide autocompletion, I recommend using [nvim-cmp](https://github.com/hrsh7th/nvim-cmp).
1314
14-
> Note: This plugin does not provide syntax highlighting, I recommend using [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter).
15+
> **Note**
16+
> This plugin does not provide syntax highlighting, I recommend using [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter).
1517
1618
## Features
1719

20+
- [Next LS](https://github.com/elixir-tools/next-ls) installation and configuration (uses the Neovim built-in LSP client)
21+
- [Credo Language Server](https://github.com/elixir-tools/credo-language-server) integration.
1822
- [ElixirLS](https://github.com/elixir-lsp/elixir-ls) installation and configuration (uses the Neovim built-in LSP client)
19-
- [credo-language-server](https://github.com/elixir-tools/credo-language-server) integration.
2023
- `:Mix` command with autocomplete
2124
- [vim-projectionist](https://github.com/tpope/vim-projectionist) support
2225

@@ -36,6 +39,7 @@ Requires 0.8
3639
local elixirls = require("elixir.elixirls")
3740

3841
elixir.setup {
42+
nextls = {enable = true},
3943
credo = {},
4044
elixirls = {
4145
enable = true,
@@ -73,28 +77,42 @@ The minimal setup will configure both ElixirLS and credo-language-server.
7377
require("elixir").setup()
7478
```
7579

76-
ElixirLS and credo-language-server can be disabled by setting the `enable` flag in the respective options table.
80+
NextLS, ElixirLS, and credo-language-server can be enabled/disabled by setting the `enable` flag in the respective options table.
81+
82+
The defaults are shown below.
7783

7884
```lua
7985
require("elixir").setup({
80-
credo = {enable = false},
81-
elixirls = {enable = false},
86+
nextls = {enable = false},
87+
credo = {enable = true},
88+
elixirls = {enable = true},
8289
})
8390
```
8491

8592
## Advanced Setup
8693

8794
While the plugin works with a minimal setup, it is much more useful if you add some personal configuration.
8895

89-
Note: For ElixirLS, not specifying the `repo`, `branch`, or `tag` options will default to the latest release.
96+
> **Note**
97+
> For ElixirLS, not specifying the `repo`, `branch`, or `tag` options will default to the latest release.
9098
9199
```lua
92100
local elixir = require("elixir")
93101
local elixirls = require("elixir.elixirls")
94102

95103
elixir.setup {
104+
nextls = {
105+
enable = false, -- defaults to false
106+
port = 9000, -- connect via TCP with the given port. mutually exclusive with `cmd`. defaults to nil
107+
cmd = "path/to/next-ls", -- path to the executable. mutually exclusive with `port`
108+
version = "0.5.0", -- version of Next LS to install and use. defaults to the latest version
109+
on_attach = function(client, bufnr)
110+
-- custom keybinds
111+
end
112+
},
96113
credo = {
97-
port = 9000, -- connect via TCP with the given port. mutually exclusive with `cmd`
114+
enable = true, -- defaults to true
115+
port = 9000, -- connect via TCP with the given port. mutually exclusive with `cmd`. defaults to nil
98116
cmd = "path/to/credo-language-server", -- path to the executable. mutually exclusive with `port`
99117
version = "0.1.0-rc.3", -- version of credo-language-server to install and use. defaults to the latest release
100118
on_attach = function(client, bufnr)
@@ -129,11 +147,38 @@ elixir.setup {
129147

130148
# Features
131149

150+
## Next LS
151+
152+
> **Note**
153+
> Next LS is **disabled** by default. Once it reaches feature parity with ElixirLS, it will switch to enabled by default.
154+
155+
> **Note**
156+
> Next LS integration utilizes `Mix.install/2`, so you must be running Elixir >= 1.12
157+
158+
> **Note**
159+
> Next LS creates a `.elixir-tools` directory in your project root. You'll want to add that to your gitignore.
160+
161+
The language server for Elixir that just works. 😎
162+
163+
You can read more about it at https://www.elixir-tools.dev/next-ls.
164+
165+
## Credo Language Server
166+
167+
> **Note**
168+
> Credo Language Server integration utilizes `Mix.install/2`, so you must be running Elixir >= 1.12
169+
170+
> **Note**
171+
> Credo Language Server creates a `.elixir-tools` directory in your project root. You'll want to add that to your gitignore.
172+
173+
- Uses your project's Credo version.
174+
- Full project diagnostics
175+
- Code Actions
176+
132177
## ElixirLS
133178

134179
### Automatic Installation
135180

136-
When a compatible installation of ELixirLS is not found, you will be prompted to install it. The plugin will download the source code to the `.elixir_ls` directory and compile it using the Elixir and OTP versions used by your current project.
181+
When a compatible installation of ElixirLS is not found, you will be prompted to install it. The plugin will download the source code to the `.elixir_ls` directory and compile it using the Elixir and OTP versions used by your current project.
137182

138183
Caveat: This assumes you are developing your project locally (outside of something like Docker) and they will be available.
139184

@@ -184,14 +229,6 @@ require("elixir.elixirls").open_output_panel({ window = "vsplit" })
184229
require("elixir.elixirls").open_output_panel({ window = "float" })
185230
```
186231

187-
## credo-language-server
188-
189-
> Note: The credo-language-server integration utilizes `Mix.install/2`, so you must be running Elixir >= 1.12
190-
191-
- Uses your project's Credo version.
192-
- Full project diagnostics
193-
- Code Actions
194-
195232
## Mix
196233

197234
You can run any `mix` command in your project, complete with... autocomplete!

0 commit comments

Comments
 (0)