Skip to content

[2.x] fix: Filter out JAR paths in BSP diagnostics on Windows#8482

Merged
eed3si9n merged 2 commits intosbt:developfrom
MkDev11:fix/jar-path-windows-7665
Jan 11, 2026
Merged

[2.x] fix: Filter out JAR paths in BSP diagnostics on Windows#8482
eed3si9n merged 2 commits intosbt:developfrom
MkDev11:fix/jar-path-windows-7665

Conversation

@MkDev11
Copy link
Copy Markdown
Contributor

@MkDev11 MkDev11 commented Jan 11, 2026

When Java compiler generates warnings about missing annotations from JAR files, the path format is jar:file:///C:/... which causes InvalidPathException on Windows due to the : character.

The fix filters out jar: paths in toDocument(), similar to how fake positions like are already filtered out. This prevents the exception and allows compilation to continue.

Diagnostics for files inside JARs are not shown in the IDE, which is correct behavior since they cannot be edited.

Fixes #7665


Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=94194147

When Java compiler generates warnings about missing annotations from
JAR files, the path format is jar:file:///C:/... which causes
InvalidPathException on Windows due to the : character.

The fix filters out jar: paths in toDocument(), similar to how fake
positions like <macro> are already filtered out. This prevents the
exception and allows compilation to continue.

Diagnostics for files inside JARs are not shown in the IDE, which is
correct behavior since they cannot be edited.

Fixes sbt#7665

Generated-by: Cascade (AI pair programmer)
Copy link
Copy Markdown
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

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

Thanks!

@eed3si9n eed3si9n changed the title fix: Filter out JAR paths in BSP diagnostics on Windows [2.x] fix: Filter out JAR paths in BSP diagnostics on Windows Jan 11, 2026
@eed3si9n eed3si9n merged commit 4fba87a into sbt:develop Jan 11, 2026
14 checks passed
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 compiler missing annotation warnings halt compilation on windows

2 participants