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

add doctest support #4320

Merged
merged 1 commit into from
May 5, 2020
Merged

add doctest support #4320

merged 1 commit into from
May 5, 2020

Conversation

bnjjj
Copy link
Contributor

@bnjjj bnjjj commented May 5, 2020

close #4317

preview:

Capture d’écran 2020-05-05 à 17 39 58

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
@@ -835,6 +835,7 @@ pub fn handle_code_lens(
for runnable in world.analysis().runnables(file_id)? {
let title = match &runnable.kind {
RunnableKind::Test { .. } | RunnableKind::TestMod { .. } => "▶️\u{fe0e}Run Test",
RunnableKind::DocTest { .. } => "▶️\u{fe0e}Run Doctest",
Copy link
Member

Choose a reason for hiding this comment

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

When a doc comment has multiple tests this should say Run doctests.

Copy link
Member

Choose a reason for hiding this comment

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

I think its fine :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you change your mind I already implemented the version with trailing s when multiple doc tests. Let me know if you're interested :)

@matklad
Copy link
Member

matklad commented May 5, 2020

bors r+

I think we should also handle doctests on things other than functions, but this is a good start!

@bors
Copy link
Contributor

bors bot commented May 5, 2020

@bors bors bot merged commit f0411ff into rust-lang:master May 5, 2020
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.

**Run** should run doctests
3 participants