arosien commented on code in PR #990:
URL: https://github.com/apache/daffodil-vscode/pull/990#discussion_r1521918248
##########
debugger/src/main/scala/org.apache.daffodil.debugger.dap/DAPodil.scala:
##########
@@ -748,11 +748,24 @@ object DAPodil extends IOApp {
copy(value = value + (uri.normalize -> lines))
def contains(location: Location): Boolean =
- value.exists {
- // format: off
- case (uri, lines) =>
- uri == location.uri && lines.exists(_ == location.line)
- // format: on
+ value.exists { case (uri, lines) =>
Review Comment:
Here is some extra context:
- Daffodil provides schema locations [as a `String` that is a
URL](https://github.com/apache/daffodil/blob/d5e084c34abbd337d0951a6d33460465e38692e8/daffodil-lib/src/main/scala/org/apache/daffodil/lib/exceptions/SchemaFileLocatable.scala#L131-L148),
although other code assumes this URL string is URL-encoded. It would be nice
if the field was actually an `URL`.
- Because Daffodil provides a URL-string, we convert the paths sent via DAP
to URIs, and normalize both DAP- and Daffodil-provided URIs. (We could instead
convert the Daffodil URL-string to a `Path` and not convert the DAP paths to
URIs, but that seemed more error prone, or at least less "universal". Except
URI normalization doesn't seem to cover Windows drive letters. But FYI `Path`
does handle this, or at least purports to via `getAbsolutePath`.)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]