You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using inspect:inspect-module() the xml report scans a module's functions to see where the function is called by other functions. The generated report includes this information inside a <calls/> element. However, it doesn't do that for variables. At least I couldn't get it to do that using the existing documentation.
What did you expect
It would be very handy if the same behaviour applied to variables, which seems to have been the idea behind xqDocs originally, see here note the section: "Internal Functions that reference this Variable".
Describe how to reproduce or add a test
Save this MWE module in exist as mwe.xq:
xqueryversion"3.1";
(:~: This module is a minimal working example.:: @author duncdrum: @see https://github.com/eXist-db/exist/issues/1388:: @return test stuff:)modulenamespace mwe="http://mwe";
declarevariable $mwe:answer := 42;
(:~: dummy function calling variable: @param $num a number :)declarefunctionmwe:question ($num as xs:integer) as xs:string {
let $dt := $mwe:answer div42for $n in1to $dt
return"is it " || $n || "?"
};
(:~: dummy function calling other function: @param $in input processed by other function :)declarefunctionmwe:another-function ($in as xs:integer) as xs:integer {
for $n in1to $in
returnmwe:question($n)
};
(:~: generate documentation via inspect: @param $path to mwe :)declarefunctionmwe:doc($path as xs:string) asitem()* {
for $n in $path
returninspect:inspect-module(xs:anyURI($path))
};
The text was updated successfully, but these errors were encountered:
duncdrum
changed the title
[feature request] inspect:inspect-module should return calls for variables
[feature request] inspect:inspect-module should include calls to variables
Mar 31, 2017
What is the problem
When using
inspect:inspect-module()
the xml report scans a module's functions to see where the function is called by other functions. The generated report includes this information inside a<calls/>
element. However, it doesn't do that for variables. At least I couldn't get it to do that using the existing documentation.What did you expect
It would be very handy if the same behaviour applied to variables, which seems to have been the idea behind xqDocs originally, see here note the section: "Internal Functions that reference this Variable".
Describe how to reproduce or add a test
Save this MWE module in exist as
mwe.xq
:then call
mwe:doc("*PATH-TO-MWE.XQ*")
note the two lines from the result:
wouldn't it be more consistent and helpful to add:
Context information
Please always add the following information
The text was updated successfully, but these errors were encountered: