ligasgr / intellij-xquery

Plugin to support XQuery in Intellij Idea
Apache License 2.0
35 stars 23 forks source link

Inspection to report module function declarations without specified namespace prefix. #148

Open rhdunn opened 9 years ago

rhdunn commented 9 years ago

Given:

xquery version "3.0";
module namespace foo="http://marklogic.com/ns/foo";
declare function g($item as item()) as item() { $item };
declare function f($g as function(item()) as item(), $item as item()) {
    g($item)
};
declare function bar() {
    foo:f(foo:g#1, ())
};

The foo:g#1 construct is flagged as the error "Cannot resolve function foo:g". If I replace this with g#1 I get the error "Cannot resolve function foo:f". Both of these constructs are valid according to MarkLogic.

ligasgr commented 9 years ago

If you change the version to "1.0-ml" or specify in settings that you are using "Marklogic 8" flavour it will no longer highlight those as unresolved. This type of syntax (not specifying namespaces on function declarations in modules is not valid in any other XQuery implementation). As part of this issue I'll add inspection that will highlight those as errors in all other flavours.