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

bugfix: Always check if a Scala file is an actual file #4997

Merged
merged 1 commit into from Feb 20, 2023

Conversation

tgodzik
Copy link
Contributor

@tgodzik tgodzik commented Feb 20, 2023

Fixes #4989

@kpodsiad
Copy link
Member

kpodsiad commented Feb 20, 2023

I'm certain that I saw this kind of fix recently. Is is another place?

Copy link
Member

@ckipp01 ckipp01 left a comment

Choose a reason for hiding this comment

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

Looks simple enough. Do you think we should add a test for this though in MetalsTestEnrichments? However it might be way more involved to actually just test this. So if it's overkill, then just ignore this and LGTM

Copy link
Member

@dos65 dos65 left a comment

Choose a reason for hiding this comment

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

👍

case Language.SCALA | Language.JAVA =>
!Files.exists(path.toNIO) ||
Files.isRegularFile(path.toNIO)
case Language.SCALA | Language.JAVA => isFile
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm certain that I saw this kind of fix recently. Is is another place?

The fix was here and I didn't notice we had a single isScala and isJava also

@tgodzik
Copy link
Contributor Author

tgodzik commented Feb 20, 2023

Looks simple enough. Do you think we should add a test for this though in MetalsTestEnrichments? However it might be way more involved to actually just test this. So if it's overkill, then just ignore this and LGTM

it's a rare scenario, so I am content just leaving it without tests for now

@tgodzik tgodzik merged commit 0deb60b into scalameta:main Feb 20, 2023
@tgodzik tgodzik deleted the fix-scala-detection branch February 20, 2023 14:52
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.

java.nio.file.NoSuchFileException during sources indexing
4 participants