mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 18:58:26 +00:00
Update Neovim setup docs (#18108)
## Summary
Nvim 0.11+ uses the builtin `vim.lsp.enable` and `vim.lsp.config` to
enable and configure LSP clients. This adds the new non legacy way of
configuring Nvim with `nvim-lspconfig` according to the upstream
documentation.
Update documentation for Nvim LSP configuration according to
`nvim-lspconfig` and Nvim 0.11+
## Test Plan
Tested locally on macOS with Nvim 0.11.1 and `nvim-lspconfig`
master/[ac1dfbe](ac1dfbe3b6
).
This commit is contained in:
parent
6800a9f6f3
commit
33e14c5963
1 changed files with 25 additions and 9 deletions
|
@ -36,15 +36,31 @@ Ruff Language Server in Neovim. To set it up, install
|
|||
[configuration](https://github.com/neovim/nvim-lspconfig#configuration) documentation, and add the
|
||||
following to your `init.lua`:
|
||||
|
||||
```lua
|
||||
require('lspconfig').ruff.setup({
|
||||
init_options = {
|
||||
settings = {
|
||||
-- Ruff language server settings go here
|
||||
}
|
||||
}
|
||||
})
|
||||
```
|
||||
=== "Neovim 0.10 (with [`nvim-lspconfig`](https://github.com/neovim/nvim-lspconfig))"
|
||||
|
||||
```lua
|
||||
require('lspconfig').ruff.setup({
|
||||
init_options = {
|
||||
settings = {
|
||||
-- Ruff language server settings go here
|
||||
}
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
=== "Neovim 0.11+ (with [`vim.lsp.config`](https://neovim.io/doc/user/lsp.html#vim.lsp.config()))"
|
||||
|
||||
```lua
|
||||
vim.lsp.config('ruff', {
|
||||
init_options = {
|
||||
settings = {
|
||||
-- Ruff language server settings go here
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
vim.lsp.enable('ruff')
|
||||
```
|
||||
|
||||
!!! note
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue