-
-
Notifications
You must be signed in to change notification settings - Fork 31
feat: dynamic filterpicker for outline.nvim #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
First draft of dynamic filterselection for outline-sidebar using telescope
…menu UX - Added `picker` option to config for selecting filterpicker backend (`default` or `telescope`) - Implemented generic pickermodules: `default` (using `vim.ui.select`) and `telescope` - Refactored sidebar filtermenu to use configurable pickerbackend, with fallback to default if unavailable - Enhanced filtermenu display: prepend checkmark to enabled kinds, sort enabled kinds above disabled, and keep "all"/"none" at the top - Updated README with new `filter_menu` keybind, picker config, and improved filter menu documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds dynamic filter selection functionality to outline.nvim, allowing users to interactively toggle which symbol kinds are displayed in the outline sidebar. The implementation provides a picker interface with two backend options: a dependency-free default picker using vim.ui.select, and an optional Telescope integration for enhanced UI.
Key changes:
- Interactive filter menu accessible via configurable keybind (default: 'f')
- Modular picker architecture supporting multiple backends (default/telescope)
- Visual checkmarks in picker to indicate enabled symbol kinds
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lua/outline/sidebar.lua | Adds _pick_filter() method for filter selection, tracks current buffer in self.curbuf, registers new filter_menu keymap action |
| lua/outline/pickers/default.lua | Implements picker using vim.ui.select (no external dependencies) |
| lua/outline/pickers/telescope.lua | Implements picker using Telescope for enhanced UI experience |
| lua/outline/config.lua | Adds picker configuration option (default: 'default') and filter_menu keymap default |
| doc/outline.txt | Documents the new filter menu feature, keymap, and picker configuration |
| README.md | Updates README with filter menu documentation and usage examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lua/outline/sidebar.lua
Outdated
| kinds[kind] = false | ||
| end | ||
| else | ||
| -- Toggle singlechoice-Keys |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The comment "Toggle singlechoice-Keys" is unclear. Consider changing to "Toggle individual symbol kind" for clarity.
| -- Toggle singlechoice-Keys | |
| -- Toggle individual symbol kind |
lua/outline/sidebar.lua
Outdated
| end, | ||
| } | ||
| self:_update_lines(true) |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The _update_lines call executes immediately, but picker.pick_item is asynchronous. The outline will be refreshed before the user makes a selection, so the filter changes won't be visible. Move this call inside the on_select callback (after line 979) to refresh the outline after the filter is actually updated.
| end, | |
| } | |
| self:_update_lines(true) | |
| self:_update_lines(true) | |
| end, | |
| } |
lua/outline/sidebar.lua
Outdated
|
|
||
| local newbuf = self:refresh_setup() | ||
|
|
||
| self.curbuf = curbuf |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The self.curbuf field is redundant since self.code.buf already tracks the current buffer. Consider using self.code.buf directly in line 931 instead of introducing a new field. If you choose to keep self.curbuf, it should be documented in the outline.Sidebar class definition (around line 19-30) and initialized in Sidebar:new() and Sidebar:reset_state().
| self.curbuf = curbuf |
…uffer for filetypedetection
Hi! First off, I just want to say I really love this plugin - it's made navigating codebases in Neovim so much more enjoyable. Thank you for all your work!
Motivation
I often want to see different symboltypes depending on context (sometimes just classes and functions, other times variables etc). Dynamic filtering in the outline sidebar makes this much easier.
What This Adds
defaultusesvim.ui.select(no real extra-dependencies), ortelescope).Screenshots
Defaultpicker with dressing.nvim setup for ui-select:
Telescope-picker:
In Action
I'd love to hear your thoughts and feedback. If you think this could fit with the plugin’s direction, I'm happy to make any changes or help further!
Thanks again!