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

Adding Run and Debug Selected Test Commands #15979

Closed
wants to merge 2 commits into from

Conversation

adstep
Copy link

@adstep adstep commented Nov 28, 2023

Adds two new commands for quickly executing a selected test in VSCode:

  • RunSelected
  • DebugSelected

Works by walking up the syntax tree, starting from the position of the user's cursor, looking for a function that has a 'test' attribute. To assist with this discovery process, I've added an LSP extension method 'rust-analyzer/selectedTest' which is used to find the test and then, if found, build a corresponding runnable to execute.

This attempts to address #14805.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 28, 2023
crates/ide/src/runnables.rs Outdated Show resolved Hide resolved
crates/ide/src/lib.rs Outdated Show resolved Hide resolved
@adstep adstep marked this pull request as ready for review November 28, 2023 01:24
@adstep
Copy link
Author

adstep commented Nov 28, 2023

I am blocked on CI failing. I don't understand what I need to 'adjust'. The PR makes modifications to both lsp/ext.rs and lsp-extensions.md.

lsp/ext.rs was changed without touching lsp-extensions.md.

Expected hash: d636c3500a6aab1c
Actual hash: 121482ee911854da

Please adjust docs/dev/lsp-extensions.md.

@Young-Flash
Copy link
Member

Young-Flash commented Nov 28, 2023

maybe this help
https://github.com/rust-lang/rust-analyzer/blob/2ee17bc5f256e379c4df954e984b9bd0d79f1cbd/docs/dev/lsp-extensions.md?plain=1#L1C4-L9

change the commit hash in docs/dev/lsp-extensions.md line 2 and report at #4604

@adstep
Copy link
Author

adstep commented Nov 28, 2023

maybe this help https://github.com/rust-lang/rust-analyzer/blob/2ee17bc5f256e379c4df954e984b9bd0d79f1cbd/docs/dev/lsp-extensions.md?plain=1#L1C4-L9

change the commit hash in docs/dev/lsp-extensions.md line 2 and report at #4604

Thanks!

crates/ide/src/runnables.rs Outdated Show resolved Hide resolved
crates/ide/src/runnables.rs Outdated Show resolved Hide resolved
crates/ide/src/runnables.rs Outdated Show resolved Hide resolved
@Young-Flash
Copy link
Member

r? @lnicola

@adstep
Copy link
Author

adstep commented Dec 2, 2023

Do I need to do anything now this is waiting on decision?

@bors
Copy link
Collaborator

bors commented Dec 5, 2023

☔ The latest upstream changes (presumably #16024) made this pull request unmergeable. Please resolve the merge conflicts.

@Veykril
Copy link
Member

Veykril commented Dec 5, 2023

No, this just needs time from a reviewer (as you can see there is a big backlog of PRs right now)

@rustbot rustbot added has-merge-commits S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 7, 2023
@rustbot
Copy link
Collaborator

rustbot commented Dec 7, 2023

There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

You can start a rebase with the following commands:

$ # rebase
$ git rebase -i master
$ # delete any merge commits in the editor that appears
$ git push --force-with-lease

The following commits are merge commits:

@adstep adstep closed this Dec 7, 2023
@adstep adstep deleted the run-selected branch December 7, 2023 18:20
@Young-Flash
Copy link
Member

I am sorry about this, may I ask why it closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has-merge-commits S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-decision S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants