Skip to content
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

Dedupe completion options for commands #3601

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SamBoyd
Copy link

@SamBoyd SamBoyd commented Mar 22, 2025

Changes

This PR improves the command completion functionality by filtering out options that have already been mentioned in the current command.

For example, when using the /add command with multiple files, once a file has been typed, it won't be suggested again in the same command. This makes the completion suggestions more relevant and reduces clutter.

Another example might be when you're adding a module and its test module. After you've added the first file, you then have to figure out which is the module/test file again to prevent adding the same file twice. If the file name is quite large, it can be quite difficult to distinguish between the module and the test file.

It's not a large thing but happens often enough for it to be inconvenient.

Testing

Added a test case that verifies this behavior works correctly when completing file names in commands like /add file1.txt f where file2.txt should be suggested but not file1.txt again.

Prevents suggesting files that are already mentioned in the current command, which improves the user experience since a user wouldn't add/drop the same file twice from the context.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant