Skip to content

Commit

Permalink
docs(wiki): setup instruction for lsp
Browse files Browse the repository at this point in the history
  • Loading branch information
saecki committed Jan 15, 2024
1 parent e46ef1e commit 73e1fb3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docgen/templates/documentation.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Documentation for `crates.nvim` `<VERSION>`

# Features
- Complete crate versions and features
- In-process language server
- Completion sources for:
- [nvim-cmp](https://github.com/hrsh7th/nvim-cmp)
- [coq.nvim](https://github.com/ms-jpq/coq_nvim)
Expand All @@ -27,6 +28,24 @@ Documentation for `crates.nvim` `<VERSION>`
- Indicate if a dependency is optional

# Setup

## lsp
Enable the in-process language server in the setup and select whether to enable
code actions and auto completion.
```lua
require("crates").setup {
...
lsp = {
enabled = true,
on_attach = function(client, bufnr)
-- the same on_attach function as for your other lsp's
end,
actions = true,
completion = true,
},
}
```

## Auto completion
### [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) source

Expand Down
19 changes: 19 additions & 0 deletions docgen/wiki/Unstable-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Documentation for `crates.nvim` `unstable`

# Features
- Complete crate versions and features
- In-process language server
- Completion sources for:
- [nvim-cmp](https://github.com/hrsh7th/nvim-cmp)
- [coq.nvim](https://github.com/ms-jpq/coq_nvim)
Expand All @@ -27,6 +28,24 @@ Documentation for `crates.nvim` `unstable`
- Indicate if a dependency is optional

# Setup

## lsp
Enable the in-process language server in the setup and select whether to enable
code actions and auto completion.
```lua
require("crates").setup {
...
lsp = {
enabled = true,
on_attach = function(client, bufnr)
-- the same on_attach function as for your other lsp's
end,
actions = true,
completion = true,
},
}
```

## Auto completion
### [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) source

Expand Down

0 comments on commit 73e1fb3

Please sign in to comment.