From 5dce6916e348b971a0b06f60515e46f913926c7d Mon Sep 17 00:00:00 2001 From: Liam Dyer Date: Fri, 27 Dec 2024 10:49:24 -0500 Subject: [PATCH] docs: update documentation for completion.menu.draw.treesitter Closes #786 --- docs/configuration/completion.md | 8 ++++++++ docs/configuration/reference.md | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/configuration/completion.md b/docs/configuration/completion.md index 020aea63..f2010bac 100644 --- a/docs/configuration/completion.md +++ b/docs/configuration/completion.md @@ -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 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. diff --git a/docs/configuration/reference.md b/docs/configuration/reference.md index 0a0eb151..bf7d10b8 100644 --- a/docs/configuration/reference.md +++ b/docs/configuration/reference.md @@ -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 } },