stevedlawrence commented on code in PR #1452:
URL: https://github.com/apache/daffodil-vscode/pull/1452#discussion_r2416911015


##########
debugger/src/main/scala-3/org.apache.daffodil.debugger.dap/DAP.scala:
##########
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.daffodil.debugger
+
+/** The dap package object allows other files inside of the package to be able 
to use specific classes and types without
+  * directly importing them. This help us with the different versions of 
Daffodil where the classes have the same name
+  * but have moved to different import paths.
+  */
+
+package object dap {
+  type Debugger = org.apache.daffodil.api.debugger.Debugger
+  type Diagnostic = org.apache.daffodil.api.Diagnostic
+  type SDiagnostic = org.apache.daffodil.api.Diagnostic
+  type JsonInfosetOutputter = 
org.apache.daffodil.runtime1.infoset.JsonInfosetOutputter
+  type XMLTextInfosetOutputter = 
org.apache.daffodil.runtime1.infoset.XMLTextInfosetOutputter

Review Comment:
   These probably want to change. Daffodil 4.0.0 has different ways of creating 
infoset outputters. This way still technically works, but it's not part of the 
public API and could change in the future.
   
   Probably the right thing is to just make it so the dap object only defines 
the InfosetOutputter type, e.g.
   ```scala
   // scala-2
   type InfosetOutputter = org.apache.daffodil.sapi.infoset.InfosetOutputter
   
   // scala-3
   type InfosetOutputter = org.apache.daffodil.api.InfosetOutputter
   ```
   
   Then your Support object wants to have a new function to create 
InfosetOutputters, e.g.
   
    ```scala
   // scala-2
   def getInfosetOutputter(infosetFormat: String, stream: OutputStream): 
InfosetOutputter =  {
      infosetFormat match {
        case "xml"  => new XMLTextInfosetOutputter(os, true)
        case "json" => new JsonInfosetOutputter(os, true)
     }
   }
   
   // scala-3
   def getInfosetOutputter(infosetFormat: String, stream: OutputStream): 
InfosetOutputter =  {
      infosetFormat match {
        case "xml"  => Daffodil.newXMLTextInfosetOutputter(os, true)
        case "json" => Daffodil.newJsonInfosetOutputter(os, true)
     }
   }
   ```
   
   And then you can use Support.getInfosetOutputter(...) similar to how you use 
Support.getInputSourceDataINputStream



##########
src/launchWizard/script.js:
##########
@@ -72,6 +72,12 @@ function getConfigValues() {
   )
   const dataEditorLogFile = document.getElementById('dataEditorLogFile').value
   const dataEditorLogLevel = 
document.getElementById('dataEditorLogLevel').value
+  const dfdlDebuggerVersion = document.getElementById(
+    'dfdlDebuggerVersion'

Review Comment:
   Should this be renamed dfdlDaffodilVersion, since this is the version of 
Daffodil (e.g. "4.0.0") and not the version of the debugger?



-- 
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]

Reply via email to