$ show xzbdmw/colorful-menu.nvim
colorful-menu.nvim is a Neovim plugin that enhances completion menus by providing Tree-sitter based syntax highlighting for completion items. It reconstructs context-aware code snippets from LSP completion data (e.g., turning a variable completion into 'var name Type') and applies semantic highlighting. The plugin integrates with nvim-cmp, blink.cmp, and Neovim's native LSP completion through well-defined entry points. Its architecture separates concerns: utility functions handle Tree-sitter parsing and text manipulation, language-specific modules implement reconstruction logic for various LSPs (gopls, rust-analyzer, etc.), and the core module coordinates these components. The plugin demonstrates strong text processing capabilities, particularly in its highlight range adjustment and truncation logic that preserves semantic highlighting during text modifications.
The LLM identified 1 files worth highlighting for reuse:
The utils module provides the core Tree-sitter highlighting and text manipulation engine. It includes functions for computing syntax highlights over strings, adjusting highlight ranges during text modifications (insertions, truncations), and applying post-processing like ellipsis insertion while preserving semantic highlighting. The module features a query cache for performance and handles complex edge cases like nested brackets and multiline text. This component is largely self-contained (depending only on Neovim's API and minor config/kind mappings) and demonstrates non-obvious skill in maintaining highlight integrity during text transformationsβa common challenge in syntax-aware text editors.