ligasgr / intellij-xquery

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

Surrounding error markers are not resolved once fixing the underlying error #142

Closed rhdunn closed 8 years ago

rhdunn commented 8 years ago

Using IntelliJ 15.0.1 and intellij-xquery a5350b8b02d9c054e4c4eb5a9013652f5c408a8f (latest master as of 17/11/2015), given:

declare function createMessage($message, $value) {
    if ($message) then
        <message value="{$value}">{$message}</message>
    else
        <message test="foo">Test</message>
};

Changing the if to:

    return if ($message) then

Causes two errors to be generated:

  1. An error after the { of the function declaration -- <expr single> expected, got 'return'.
  2. An error on the return statement -- ';', <expr single>, declare or '}' expected, got 'return'.

Deleting the return keyword removes error 2, but error 1 persists (even when closing and re-opening the file).

I have also seen this when copying an existing function in the file and renaming the copy.

NOTE: I don't see this behaviour with IntelliJ 14.1.5 and intellij-xquery 2.2.1.

ligasgr commented 8 years ago

I'm not able to reproduce the issue on the same commit and version 143.747.6 (the issue being that both errors are not removed). Can you please let me know the exact version number you are using?

rhdunn commented 8 years ago

This is with build IC-143.382 built on November 10, 2015 (15.0.1).

ligasgr commented 8 years ago

Thanks for checking that. I was able to reproduce the issue after installing plugin from a zip distribution instead of running it in development mode from IDEA. Issue was not really version related. And there was another thing that didn't work (XQuery Settings form in Settings -> Other settings). The page would never show it's contents.