Skip to content

Commit 0f69474

Browse files
committed
[feature] When we are calling a function directly from RESTXQ, set the function call location to the same as the function definition location
1 parent 004d5dc commit 0f69474

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

extensions/exquery/restxq/src/main/java/org/exist/extensions/exquery/restxq/impl/ResourceFunctionExecutorImpl.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,12 @@ public Sequence execute(final ResourceFunction resourceFunction, final Iterable<
153153
processMonitor.queryStarted(xqueryContext.getWatchDog());
154154

155155
//create a function call
156-
try (final FunctionReference fnRef = new FunctionReference(new FunctionCall(xqueryContext, fn))) {
156+
final FunctionCall fnCall = new FunctionCall(xqueryContext, fn);
157+
158+
// As we are calling the function directly from RESTXQ, set the function call location to the same as the function definition location
159+
fnCall.setLocation(fn.getLine(), fn.getColumn());
160+
161+
try (final FunctionReference fnRef = new FunctionReference(fnCall)) {
157162

158163
//convert the arguments
159164
final org.exist.xquery.value.Sequence[] fnArgs = convertToExistFunctionArguments(xqueryContext, fn, arguments);

0 commit comments

Comments
 (0)