-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat: add completions for --manifest-path
#15225
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
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.
Thanks for the help!
Could you clarify what you want to complete for
--manifest-path
? From the current implementation and your recording, it seems to me that completion candidates are almost everything. That doesn't seem too helpful.I would suggest complete workspace members as the first step.
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.
Right now, we offer no completions.
This completes manifests and potential cargo scripts.
Not sure how "workspace members" would work here because we use this to determine the workspace and cargo scripts can't be workspace members.
I see we complete dot files; I wonder if we should exclude that from
is_embedded
.The only feedback I have is the third check is redundant
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.
Unsure if this is only your interpretation from code or you worked with them. I would like to see a clearer PR description for what this aims for, as the
--mainfest-path
completion hasn't yet been discussed in the original issue, and we don't have tests for shell completions.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.
How is completing cargo script via
is_embedded
helpful? It completes almost every file without a file extension.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.
If the goal is to complete cargo scripts, agree "workspace members don't work. Though I came from what candidates
--manifest-path
completion should get, and I must miss the discussion somewhere.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.
wanted to look for
*.rs
andCargo.toml
in the current_dir , though yu are right foris_embedded
function it check for dotfiles, so should i modify the is_embeded function or put a different check in the complete checkThere 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.
removed
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.
@weihanglo FYI I feel like I would have probably put just as much details in the PR description as this (less since I wouldn't have included a video). This does exactly what it says and I see little room to add to that: this completes every file that looks like a potential manifest path.
Our options
--manifest-path
(this PR): this may match files that don't have a manifest inside them, implicit or explicitCargo.toml
: Cargo script users will have to manually type in every of the pathimo completions should err on the side of being overly broad, rather than less, because otherwise users will have to manually type things out
This is still an improvement over the stable behavior because you don't have
foo/C[TAB]
, seeCargo.toml
andCargo.lock
foo/Ca[TAB]
, getfoo/Cargo.toml
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.
@epage's comment lists the current behavior and what've changed looks better. That is the discussion and information I was looking for. Thanks for summarizing it!!
Personally I am fine with any of these options. Just want to check this is well-discussed not something future us need to compile to figure out.
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.
I put my text in the PR description