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

Assist to add #[cfg(test)] to mod definition #18769

Closed
sbdchd opened this issue Dec 27, 2024 · 1 comment
Closed

Assist to add #[cfg(test)] to mod definition #18769

sbdchd opened this issue Dec 27, 2024 · 1 comment
Labels
C-feature Category: feature request

Comments

@sbdchd
Copy link

sbdchd commented Dec 27, 2024

My current workflow for adding a new test module is:

  1. navigate to lib.rs
  2. add mod foo_test; near the top
    mod foo_test;
  3. add #[cfg(test)] above it
    #[cfg(test)]
    mod foo_test;

I think an assist option to add the #[cfg(test)] would be nice -- is it too specific?

@sbdchd sbdchd added the C-feature Category: feature request label Dec 27, 2024
@Veykril
Copy link
Member

Veykril commented Dec 27, 2024

We have a completion snippet for this tmod (and then an assist that allows you to move an inline module mod foo {} into a mod foo; + create the corresponding file). An assist for this here sounds too niche/specific to me

@Veykril Veykril closed this as completed Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: feature request
Projects
None yet
Development

No branches or pull requests

2 participants