Closed rhdunn closed 8 years ago
Hey I must be doing something wrong as I cannot reproduce your issue... Please note that I've checked it on both XQuery Standard 3.0 and Marklogic 8 flavours. Please see screenshots attached. First one is when I started typing el in the place.
Second one is when I pressed ctrl-space in the place of cursor and started navigating the list.
Can you please add more details on when the issue happens and how it looks like?
This is what I am seeing:
In your Ctrl+Space screenshot, I am not seeing else
or every
in the list from my setup.
This is using the release version of the xquery plugin 3.0.0.
Can you please let me know of there's any exception notification related to this? Also can you please share your idea.log? It's in the Idea log directory (idea.log.path property in idea.properties).
The idea.log file does not have any exceptions relevant to this.
I have done some investigation into this issue...
In src/main/java/org/intellij/xquery/completion/keyword/KeywordCollector.java
:
suggestKeywordsBasedOnParserExpectedKeywords
is being called with getPrecedingText
containing:
declare function foo($foo) {
if (empty($foo)) then
()
[EOS]
where [EOS]
is used to preserve whitespace in the last line.
convertItem
method on the getCompletionStateForKeywords
handler is being called with the else
keyword as an IElementType
(so is correctly returning the else
string).completionStateInTemporaryFile.items
contains [document, ordered, unordered, declare, function, replace, processing-instruction, following-sibling, following, schema-element, switch, intersect, comment, preceding-sibling, castable, parent, except, preceding, ancestor, namespace, descendant-or-self, descendant, schema-attribute, validate, instance, typeswitch, attribute, document-node, rename, ancestor-or-self, namespace-node, element]
.Looking at https://android.googlesource.com/platform/tools/idea/+/snapshot-master/platform/lang-impl/src/com/intellij/lang/parser/GeneratedParserUtilBase.java
, the function private static void addCompletionVariant(@NotNull PsiBuilder builder_, @NotNull CompletionState completionState, Object o)
method looks like the place where items are being added. I am not currently sure what is preventing that item from being added.
Hi
Can you please try on the latest code from trunk if the issue is getting resolved (else is always picked up)?
I assume it fixed the issue. If not, please re-open.
Given:
where
<caret>
is the current cursor position, typingel
does not resolveelse
as a possible keyword in the autocomplete box.NOTE: The input:
on its own does pick up
else
as a possible keyword in autocomplete.