Return dialog for exact todo query and preserve submenu for todo #791
Merged
multiplex55 merged 2 commits intomasterfrom Feb 2, 2026
Merged
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
todoquery show the primary dialog action instead of listing submenu commands when the user types exactlytodo(case-insensitive) with no trailing text.todo(with a trailing space) ortodo <command>.Description
TodoPlugin::search_internalto detect an exacttodomatch and return a singleActionwithaction == "todo:dialog"and label"todo: edit todos"when the suffix is exactly empty.todobranch when the suffix contains only whitespace sotodostill shows all subcommands.Plugin::searchto usetrim_start()so trailing spaces are preserved and the plugin can distinguish"todo"from"todo".search_todo_space_shows_submenuand simplifysearch_plain_todo_opens_dialogintests/todo_plugin.rsto assert exact behaviors for"todo"and"todo" respectively.Testing
tests/todo_plugin.rsverifying thatplugin.search("todo")returns exactly one result withaction == "todo:dialog"and thatplugin.search("todo ")exposes the submenu labels; the tests were added successfully.cargo test --test todo_plugin, but the build failed during dependency compilation due to a missing system library required byalsa-sys(error: missingalsa.pc/alsadevelopment package), so the test run could not complete in this environment.Codex Task