[ 
https://issues.apache.org/jira/browse/DRILL-6084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16647773#comment-16647773
 ] 

ASF GitHub Bot commented on DRILL-6084:
---------------------------------------

arina-ielchiieva commented on a change in pull request #1491: DRILL-6084: Show 
Drill functions in WebUI for autocomplete
URL: https://github.com/apache/drill/pull/1491#discussion_r224741116
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/WebServer.java
 ##########
 @@ -456,21 +471,20 @@ public void close() throws Exception {
     FileUtils.deleteDirectory(getTmpJavaScriptDir());
   }
 
-  private static final String FILE_CONTENT_FOOTER = "};";
-
   //Generate Options Description JavaScript
   private void generateOptionsDescriptionJSFile() throws IOException {
     //Obtain list of Options & their descriptions
     OptionManager optionManager = 
this.drillbit.getContext().getOptionManager();
     OptionList publicOptions = optionManager.getPublicOptionList();
-    List<OptionValue> options = Lists.newArrayList(publicOptions);
+    List<OptionValue> options = new ArrayList<>(publicOptions);
     Collections.sort(options);
     int numLeftToWrite = options.size();
 
     //Template source Javascript file
     InputStream optionsDescripTemplateStream = 
Resource.newClassPathResource(OPTIONS_DESCRIBE_TEMPLATE_JS).getInputStream();
     //Generated file
     File optionsDescriptionFile = new File(getTmpJavaScriptDir(), 
OPTIONS_DESCRIBE_JS);
+    final String FILE_CONTENT_FOOTER = "};";
 
 Review comment:
   If variable is in method, then it is not necessary to keep its name in the 
upper case.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Expose list of Drill functions for consumption by JavaScript libraries
> ----------------------------------------------------------------------
>
>                 Key: DRILL-6084
>                 URL: https://issues.apache.org/jira/browse/DRILL-6084
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Web Server
>            Reporter: Kunal Khatua
>            Assignee: Kunal Khatua
>            Priority: Minor
>              Labels: javascript
>             Fix For: 1.15.0
>
>
> DRILL-5868 introduces SQL highlighter and the auto-complete feature in the 
> web-UI's query editor.
> For the backend Javascript to highlight the keywords correctly as SQL 
> reserved words or functions, it needs a list of all the Drill functions to be 
> already defined in a source JavaScript ( {{../mode-sql.js}} ) .
> While this works well for standard Drill functions, it means that any new 
> function added to Drill needs to be explicitly hard-coded into the file, 
> rather than be programatically discovered and loaded for the library to 
> highlight.
> It would help if this can be done dynamically without contributors having to 
> explicitly alter the script file to add new function names.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to