You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updates the -Wconf:src filter to avoid using `java.nio.file.Path.toURI`
in order to fix Windows source path conversions.
`Path.toURI` prepends the current working directory to Windows-like
paths unconditionally, and converts backslashes in such paths to `%5C`
escape sequences This can cause `-Wconf:src` filters that work on
non-Windows platforms to fail on Windows.
For example, before this change, the `Path.toURI` conversion in the
`SourcePattern` case from `MessageFilter.matches()` produced:
```txt
original: Optional[C:\foo\bar\myfile.scala]
resolved: /Users/mbland/src/scala/scala3/C:%5Cfoo%5Cbar%5Cmyfile.scala
```
After this change, it produces the following, which still prepends the
current working directory, but properly converts path separators to `/`:
```txt
original: Optional[C:\foo\bar\myfile.scala]
resolved: /Users/mbland/src/scala/scala3/C:/foo/bar/myfile.scala
```
This change is based on scala/scala#11192, and also adapts some test
cases from that pull request to validate symlink and normalized path
handling. This change also extracts the `diagnosticWarning` helper
method to reduce duplication between new and existing test cases.
0 commit comments