Github user tzolov commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/181#issuecomment-129046754
  
    @Leemoonsoo thanks for reviewing this. Not seeing the completions for the 
current Spark completion implementation was expected (due to 
[ZEPPELIN-204](https://issues.apache.org/jira/browse/ZEPPELIN-204) ). My 
solution though was far too restrictive because it use to exclude the default 
ACE completers leaving in only the Interpreter completers. Although this seemed 
to work for my PSQL and OQL completers (not committed yet) it was affecting all 
other interpreters that have not implemented completers. 
    So i added few improvements that hopefully solve the problem with less 
drawbacks. Here are the additions: 
    
    1. I've (re)included the default ACE completers: `keyWordCompleter`, 
`snippetCompleter`, `textCompleter`. But i've inserted them after the 
interpreter completer. That means that the interpreter completions (if 
provided) will be shown before the Keyword and Local completions (note that the 
snippet completion is disabled).
    2. The main issue of showing Spark completion results in the SQL paragraphs 
was due to the incorrectly set paragraph Mode. The old paragraph.controller.js 
implementation use to set the mode one - during paragraph's initialization and 
never changed it. Even if the interpreter marker was changed from %spark to 
%sql the mode would remain Spark and the completion will show the Spark 
keywords. Furthermore the insertion of new paragraph is initialized with the 
default (spark) mode and the only way to update it is to update the page (F5). 
    To resolve this i've factored out the mode setting functionality into a 
separate function: `setParagraphMode`. Now this function is called in two 
places. Once during the initialization (as it use to be) but now it is called 
also on (Ctrl+.) attempt.  In this way the editor mode will be corrected before 
the completion request. The correct mode will be set and in turn the correct 
completer will be called. 
    3. I've fixed a nasty CSS bug in ACE that was hiding the selected item in 
the completion popup menu.  
    
    Above improvements are committed and waiting to be reviewed :)
    
     


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to