stevedlawrence commented on code in PR #1097:
URL: https://github.com/apache/daffodil/pull/1097#discussion_r1367049322


##########
daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/SchemaSet.scala:
##########
@@ -571,9 +571,10 @@ final class SchemaSet private (
     Seq(encDFV, boDFV, binDFV, outDFV)
   }
 
-  lazy val allDefinedVariables = schemas.flatMap {
-    _.defineVariables
-  }
+  lazy val allDefinedVariables = schemas
+    .flatMap(_.defineVariables)
+    .union(predefinedVars)

Review Comment:
   Yeah, nothing used `allDefinedVariables`, and I figured it made sense to 
start using it, and I think it's more useful it if includes the predefined vars.
   
   The only use case I can think of for `allExternalVariables` is if something 
like a VS Code extension wants to know which variables could be set externally. 
I don't think there's any other way to easily get that information now. I 
thought we had something like that in the `VariableMap` class but we only have 
functions get all `QName`s, or get a single `VariableRuntimeData` given a 
`QName`. But those functions could be combined like this:
   
   ```scala
   val externalQNames = vmap.qnames.filter { qn => 
vmap.getVariableRuntimeData(qn).get.external }
   ```
   
   It's not super efficient, but performance should be fine enough for an IDE. 



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