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

fix(completion): handle -o {default,dirnames,plusdirs} #300

Merged
merged 1 commit into from
Dec 30, 2024

Conversation

reubeno
Copy link
Owner

@reubeno reubeno commented Dec 30, 2024

  • Fills out handling of default, dirnames, and plusdirs options for completion.
  • Adds a few basic compat tests for this logic.

Notably, this makes git diff -- <start_of_file_path> complete to something sensibly.

@reubeno reubeno requested a review from Copilot December 30, 2024 06:33

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

brush-core/src/completion.rs:152

  • The option 'dir_names' is inconsistently named compared to other options like 'bash_default' and 'default'. It should be renamed to 'dirnames' for consistency.
pub dir_names: bool,
@reubeno reubeno force-pushed the fallback-completion branch from bf098ea to 5812a47 Compare December 30, 2024 06:38
Copy link

github-actions bot commented Dec 30, 2024

Performance Benchmark Report

Benchmark name Baseline (μs) Test/PR (μs) Delta (μs) Delta %
expand_one_string 3.51 μs 3.51 μs 0.00 μs ⚪ Unchanged
for_loop 933336.71 μs 942287.18 μs 8950.47 μs 🟠 +0.96%
instantiate_shell 61.57 μs 62.04 μs 0.47 μs ⚪ Unchanged
instantiate_shell_with_init_scripts 28398.82 μs 27951.87 μs -446.96 μs ⚪ Unchanged
parse_bash_completion 2814.61 μs 2874.32 μs 59.71 μs 🟠 +2.12%
parse_sample_script 4.21 μs 4.38 μs 0.17 μs 🟠 +4.02%
run_echo_builtin_command 90.99 μs 91.80 μs 0.81 μs ⚪ Unchanged
run_one_builtin_command 111.62 μs 111.38 μs -0.24 μs ⚪ Unchanged
run_one_external_command 1751.25 μs 1719.36 μs -31.89 μs 🟢 -1.82%
run_one_external_command_directly 824.27 μs 824.08 μs -0.19 μs ⚪ Unchanged

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
brush-core/src/builtins/complete.rs 🟠 56.43% 🟠 60.71% 🟢 4.28%
brush-core/src/completion.rs 🔴 28.42% 🔴 29.67% 🟢 1.25%
brush-core/src/shell.rs 🟢 77.73% 🟢 77.86% 🟢 0.13%
Overall Coverage 🟢 74.81% 🟢 74.97% 🟢 0.16%

Minimum allowed coverage is 70%, this run produced 74.97%

Copy link

Test Results

    2 files      9 suites   1m 16s ⏱️
  569 tests   569 ✅ 0 💤 0 ❌
1 124 runs  1 124 ✅ 0 💤 0 ❌

Results for commit 5812a47.

@reubeno reubeno merged commit a4cbc31 into main Dec 30, 2024
17 checks passed
@reubeno reubeno deleted the fallback-completion branch December 30, 2024 07:35
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