Skip to content

fix: show run icons only for files in tests directory #395

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

Merged
merged 1 commit into from
Aug 30, 2022

Conversation

vol0n
Copy link
Member

@vol0n vol0n commented Aug 22, 2022

closes #394
To prevent run icons from showing in non-utbot-tests, add a condition to show them only in tests dir and in files which names contain word test.

@vol0n vol0n force-pushed the vol0n/fix_run_icons_location branch from 1a38ec1 to 01f44b4 Compare August 22, 2022 21:36
@@ -51,7 +55,13 @@ class UTBotTestRunLineMarkerProvider : LineMarkerProvider {
return UTBotRunWithCoverageLineMarkerInfo(element, message, getStatusIcon(element))
}

private fun getStatusIcon(element: PsiElement): Icon {
private fun isElementInTestFileGeneratedByUTBot(element: PsiElement) =
element.containingFile.virtualFile.localPath.let {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this the same way we check the 'test' status in VSCode plugin?

Copy link
Member Author

@vol0n vol0n Aug 26, 2022

Choose a reason for hiding this comment

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

// provide lenses only for test files

not exactly, in VSCode code lenses are placed in any file that are in tests directory. I think it is not quite good, because if you open any file in tests dir and type in 'TEST' then code lenses for running utbot tests will appear, that's why I added an extra condition

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not lenses but gutter to run a test.

@vol0n vol0n requested a review from alexey-utkin August 26, 2022 09:02
@vol0n vol0n merged commit 4cec911 into main Aug 30, 2022
@sava-cska sava-cska deleted the vol0n/fix_run_icons_location branch September 1, 2022 10:42
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.

[BUG] CLion plugin: run icons are placed for tests outside utbot tests directory
2 participants