This is an automated email from the ASF dual-hosted git repository. arosien pushed a commit to branch daffodil-vscode-tdml in repository https://gitbox.apache.org/repos/asf/daffodil-vscode.git
commit b4a33cb5dc601304721683cee4693d2612e3375b Author: Adam Rosien <[email protected]> AuthorDate: Tue Jul 26 11:05:43 2022 -0700 Lazily initialize data and schema paths together from TDMLConfig, if present. --- .../scala/org.apache.daffodil.debugger.dap/Parse.scala | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/server/core/src/main/scala/org.apache.daffodil.debugger.dap/Parse.scala b/server/core/src/main/scala/org.apache.daffodil.debugger.dap/Parse.scala index d1f8baf..0b60bca 100644 --- a/server/core/src/main/scala/org.apache.daffodil.debugger.dap/Parse.scala +++ b/server/core/src/main/scala/org.apache.daffodil.debugger.dap/Parse.scala @@ -163,23 +163,13 @@ object Parse { infosetOutput: LaunchArgs.InfosetOutput, tdmlConfig: Option[LaunchArgs.TDMLConfig] ) extends Arguments { - def dataPath: Path = + lazy val (schemaPath: Path, dataPath: Path) = tdmlConfig .map { case LaunchArgs.TDMLConfig(_, name, description, path) => - val (_, dataPath) = TDMLWrapper.execute(defaultSchemaPath, defaultDataPath, name, description, path) - dataPath + TDMLWrapper.execute(defaultSchemaPath, defaultDataPath, name, description, path) } - .getOrElse(defaultDataPath) - - def schemaPath: Path = - tdmlConfig - .map { - case LaunchArgs.TDMLConfig(_, name, description, path) => - val (schemaPath, _) = TDMLWrapper.execute(defaultSchemaPath, defaultDataPath, name, description, path) - schemaPath - } - .getOrElse(defaultSchemaPath) + .getOrElse(defaultSchemaPath -> defaultDataPath) def data: IO[InputStream] = IO.blocking(FileUtils.readFileToByteArray(dataPath.toFile))
