You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2022/03/10 15:11:16 UTC
[GitHub] [daffodil-vscode] mbeckerle commented on a change in pull request #87: Always use the current schema location for the breakpoint.
mbeckerle commented on a change in pull request #87:
URL: https://github.com/apache/daffodil-vscode/pull/87#discussion_r823823941
##########
File path: server/core/src/main/scala/org.apache.daffodil.debugger.dap/Parse.scala
##########
@@ -328,15 +328,14 @@ object Parse {
/** Translate parse events to updated Daffodil state. */
def fromParse(
- schemaPath: Path,
frameIds: Next[DAPodil.Frame.Id],
variableRefs: Next[DAPodil.VariablesReference]
): Stream[IO, Parse.Event] => Stream[IO, DAPodil.Data] =
events =>
events.evalScan(DAPodil.Data.empty) {
case (_, Parse.Event.Init(_)) => IO.pure(DAPodil.Data.empty)
case (prev, startElement: Parse.Event.StartElement) =>
- createFrame(schemaPath, startElement, frameIds, variableRefs).map(prev.push)
+ createFrame(startElement, frameIds, variableRefs).map(prev.push)
Review comment:
I see where the schemaPath was wrong and startElement is better, but is there no logic needed to insure the endElement event hasn't already popped the stack?
##########
File path: server/core/src/main/scala/org.apache.daffodil.debugger.dap/Parse.scala
##########
@@ -364,7 +362,12 @@ object Parse {
startElement.name.map(_.value).getOrElse("???"),
/* If sourceReference > 0 the contents of the source must be retrieved through
* the SourceRequest (even if a path is specified). */
- new Types.Source(schemaPath.toString, 0),
+ Try(Paths.get(URI.create(startElement.schemaLocation.uriString)).toString())
+ .fold(
+ _ =>
+ new Types.Source(startElement.schemaLocation.uriString, null, 0), // there is no valid path if the location is a schema contained in a jar file; see #76.
Review comment:
line too long.
--
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: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org