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

Mark test source files with a green color #10808

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Kobzol
Copy link
Member

@Kobzol Kobzol commented Aug 15, 2023

This PR improves how the plugin marks test source files:

  • The first commit marks files under the tests and benches directories as test files, which means that they will be correctly filtered as tests e.g. in Find in Files -> Scope -> Project Test Files.
  • The second commit marks test files with a green color in the Project view (the file list on the left) and also in Find in Usages etc. lists.

test

TODO/questions:

  • Should we make the color configurable/let users disable the coloring?
  • The getTestSourceFolders approach seems that it could be slow, should I cache it or something?
  • This still doesn't mark usages of tests in Find in XXX that are located in Rust files that are not under tests (like #[cfg(test)] mod tests { ... }. Sadly, the platform only passes the file to the extension point, not the actual Usage instance, so we can't easily find if a specific usage if a test usage. I think that we might be able to solve this by creating some synthetic file for test usages? But it sounds like a horrible hack.

Related issue: #4436

changelog: Mark test source files with a green color in project view and various file lists (like Find in Path).

@Kobzol Kobzol requested a review from vlad20012 August 15, 2023 16:46
@Kobzol
Copy link
Member Author

Kobzol commented Aug 15, 2023

CC @Uriopass, who expressed interest in this feature.

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.

None yet

1 participant