-
Notifications
You must be signed in to change notification settings - Fork 680
Adding mysql 5.7 and 8.0 keywords and functions for auto-completion #767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@laoshaw Thanks for this pull request! We really appreciate this. I'm going to leave a few comments on this for some things that might need updating. |
| 'USING', 'VALUES', 'VARCHAR', 'VIEW', 'WHEN', 'WHERE', 'WITH', | ||
| 'JSON', 'ISNULL', 'GREATEST', 'LEAST', 'BLOB', 'BIT', 'OPAQUE', | ||
| 'DATETIME', 'BOOLEAN', 'ARRAY', 'OBJECT', 'STRING', 'DOUBLE', 'NULL', | ||
| 'ENUM', 'TEXT'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move ISNULL, GREATEST, and LEAST down to the function list?
| 'JSON_MERGE_PATCH', 'JSON_MERGE_PRESERVE', 'JSON_OBJECT', 'JSON_PRETTY', | ||
| 'JSON_QUOTE', 'JSON_REMOVE', 'JSON_REPLACE', 'JSON_SEARCH', 'JSON_SET', | ||
| 'JSON_STORAGE_SIZE', 'JSON_TYPE', 'JSON_UNQUOTE', 'JSON_VALID', | ||
| 'JSON_ARRAYAVG', 'JSON_OBJECTAVG', 'JSON_OVERLAPS', 'JSON_SCHEMA_VALID', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean JSON_ARRAYAGG and JSON_OBJECTAGG?
| 'JSON_STORAGE_SIZE', 'JSON_TYPE', 'JSON_UNQUOTE', 'JSON_VALID', | ||
| 'JSON_ARRAYAVG', 'JSON_OBJECTAVG', 'JSON_OVERLAPS', 'JSON_SCHEMA_VALID', | ||
| 'JSON_SCHEMA_VALIDATION_REPORT', 'JSON_STORAGE_FREE', 'JSON_TABLE', | ||
| 'MEMBER_OF'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MEMBER_OF() looks like it should be two words (MEMBER OF()).
|
Also, do you think we could put the new suggestions in alphabetical order with the old ones? It definitely makes it easier for developers to find things in the list when we need to make changes, etc. |
|
yes I think the new one is better. |
I don't understand. Are you saying that you'll create a new PR or will you add more commits to this PR? |
Since the pygments library is already required, why not use its list of reserved words for completions? This fixes #767 and should keep us up-to-date. It's really great to have the JSON_* functions. Obsoletes #925. Compared to the previous code, this PR * removes LEN and TOP, which are not MySQL reserved words * preserves extra completion candidates containing space, such as "ORDER BY" Downsides and bugs: * pygments.lexers._mysql_builtins does contain a leading underscore, so we should be aware that the library reserves the right to break this usage. The library version has been more tightly defined to remediate issues here. * Similarly, certain tests might become more brittle with regard to library updates. * Certain reserved words are duplicated with special commands, so if the first word of a command-line is any of the following, duplicated completions will show, as both upper- and lower-case: exit, help, source, status, system, use. This is fixable, but should we prefer the upper- or lower-case flavor? * There are _many_ more completion candidates now, which may inspire us to do further work soon on prioritizing which completions are seen at the top.
Since the pygments library is already required, why not use its list of reserved words for completions? This fixes #767 and should keep us up-to-date. It's really great to have the JSON_* functions. Obsoletes #925. Compared to the previous code, this PR * removes LEN and TOP, which are not MySQL reserved words * preserves extra completion candidates containing space, such as "ORDER BY" Downsides and bugs: * pygments.lexers._mysql_builtins does contain a leading underscore, so we should be aware that the library reserves the right to break this usage. The library version has been more tightly defined to remediate issues here. * Similarly, certain tests might become more brittle with regard to library updates. * Certain reserved words are duplicated with special commands, so if the first word of a command-line is any of the following, duplicated completions will show, as both upper- and lower-case: exit, help, source, status, system, use. This is fixable, but should we prefer the upper- or lower-case flavor? * There are _many_ more completion candidates now, which may inspire us to do further work soon on prioritizing which completions are seen at the top.
Description
Added keywords and json functions from mysql 5.7 and 8.0 for auto-completion
Checklist
changelog.md. -- not seen this fileAUTHORSfile (or it's already there). -- change too small to be added