Skip to content

Commit

Permalink
docs: update documentation for completion.menu.draw.treesitter
Browse files Browse the repository at this point in the history
Closes #786
  • Loading branch information
Saghen committed Dec 27, 2024
1 parent 59d6b4f commit 5dce691
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions docs/configuration/completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ For a setup similar to nvim-cmp, use the following config:
completion.menu.draw.columns = { { "label", "label_description", gap = 1 }, { "kind_icon", "kind" } },
```

### Treesitter

You may use treesitter to highlight the label text for the given list of sources. This feature is experimental, contributions welcome!

```lua
completion.menu.draw.treesitter = { 'lsp' }
```

## Documentation <a href="./reference#completion-documentation"><Badge type="info" text="Go to default configuration" /></a>

By default, the documentation window will only show when triggered by the `show_documentation` keymap command. However, you may add the following configuration to show the documentation whenever an item is selected.
Expand Down
5 changes: 3 additions & 2 deletions docs/configuration/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@ completion.menu.draw = {
padding = 1,
-- Gap between columns
gap = 1,
-- Use treesitter to highlight the label text
treesitter = false,
-- Use treesitter to highlight the label text for the given list of sources
treesitter = {},
-- treesitter = { 'lsp' }

-- Components to render, grouped by column
columns = { { 'kind_icon' }, { 'label', 'label_description', gap = 1 } },
Expand Down

0 comments on commit 5dce691

Please sign in to comment.