Skip to content

Commit

Permalink
Update Neovim documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvmanila committed Feb 13, 2024
1 parent 4afe879 commit cae3a08
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,38 @@ LSP for certain capabilities, like `textDocument/hover`:

```lua
local on_attach = function(client, bufnr)
-- Disable hover in favor of Pyright
client.server_capabilities.hoverProvider = false
if client.name == 'ruff_lsp' then
-- Disable hover in favor of Pyright
client.server_capabilities.hoverProvider = false
end
end

require('lspconfig').ruff_lsp.setup {
on_attach = on_attach,
}
```

And, if you'd like to use Ruff exclusively for linting, formatting, and organizing imports, you can
disable those capabilities in Pyright:

```lua
require('lspconfig').pyright.setup {
on_attach = on_attach,
settings = {
pyright = {
-- Using Ruff's import organizer
disableOrganizeImports = true,
},
python = {
analysis = {
-- Ignore all files for analysis to exclusively use Ruff for linting
ignore = { '*' },
},
},
},
}
```

Ruff also integrates with [`coc.nvim`](https://github.com/neoclide/coc.nvim/wiki/Language-servers#using-ruff-lsp):

```json
Expand Down

0 comments on commit cae3a08

Please sign in to comment.