-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat: implement configuration to change sub command for test, bench and doctest #21308
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: implement configuration to change sub command for test, bench and doctest #21308
Conversation
dc2bb03 to
97e140f
Compare
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.
LGTM, minus one thing: we generally have X_overrideCommand called for completely overriding the command, and be Option<Vec<String>>, while "X_command": "foo" is a single String and is being integrated in the existing place (cargo foo --args). You can have both are either, but please don't confuse them.
|
Oh should this be then |
|
As I said, we generally have two configs, one |
|
I'm really sorry, I’m having some difficulty understanding what you mean. |
|
Yes. |
|
Oh I see. Thanks. Then I'll make the change for override command to be command and include an arguments config like so: So for example to use nextest those two will be {
"rust-analyzer.runnables.test.command": "nextest",
"rust-analyzer.runnables.test.args": ["run"]
}Similar for bench and doctest as well. |
|
I've pushed the changes as separate commit, so that if this change is fine I'll squash them into one before merging (if that's fine). P.S: I'm sorry for earlier. I had some difficultly understanding what you changed were asked of me. |
ChayimFriedman2
left a comment
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.
That's not what I suggested. I suggested a pair of fields for each configuration, X_command and X_overrideCommand. No X_args. If this setup does not work for doctests, we cam not provide X_command for it.
|
Ah I see. Ok, then I'll remove doctests and include only bench and test. |
10ef612 to
3790288
Compare
ChayimFriedman2
left a comment
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.
That's still not how we handle those settings.
overrideCommand should not be passed as arguments; if overrideCommand is set, it fully determines the command to run. That's why it's called "override".
Also, you forgot the doctests overrideCommand.
3790288 to
03135d8
Compare
So the
It's fine if I just |
True.
You can still use
Yes, I think. |
|
I'm fine with changing it s it follows as our existing guidelines of configurations. But I feel like it's kinda doesn't work correctly for multiple crate projects like ours, since r-a then won't add the args like Also the executable args remains as is for the EDIT: |
|
Hmm, we can have placeholders that are substituted for the package name, e.g. |
|
Hmm, Okay. This will complicate it quite a bit, I'll go back a step and come up with better solution of how to use config instead of the plain stuff I do now. |
03135d8 to
aab4071
Compare
ChayimFriedman2
left a comment
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.
Just two things, then LGTM.
ChayimFriedman2
left a comment
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!
fixes #21137