-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow providers customize documentation rendering (#650)
* style: fix typos * feat: allow providers customize documentation rendering Issue ===== The default way of rendering documentation using markdown and treesitter works great for most cases, but some providers may want to customize the rendering of the documentation. However, some providers may want to customize the rendering in order to add additional information or custom highlighting. Solution ======== Add a new field `render_documentation_fn` to the `CompletionItem` type. Providers can set this to a function that will be called when the documentation is about to be rendered. They can then choose to do custom rendering or fallback to the default rendering. Use cases: - when a treesitter parser is not available for code examples, providers can display colored text using Neovim's regex based syntax highlighting - can add additional highlighting to the documentation - avoid showing extra empty lines caused by markdown fenced code blocks * feat: use `item.documentation.render`, allow overriding default rendering --------- Co-authored-by: Liam Dyer <[email protected]>
- Loading branch information
1 parent
96e279a
commit bc94c75
Showing
5 changed files
with
61 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters