-
Notifications
You must be signed in to change notification settings - Fork 54
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
[Completion] Fix AutoCompleteList in Constructor #52
Conversation
HTML data-* attributes in htmltools no longer automatically converts to JSON from list and attribute key is converted to lower cases. This commit changes the attribute name to lower case and perform explicit JSON conversion. Fixes trestletech#48
Thanks @saurfang! I will review and merge tomorrow. Any chance you could add one (or more) simple tests to help safeguard against similar changes (e.g., in htmltools or even jsonlite) in the future? |
Probably will be good to add some tests with shinytest. I might have some time to work on it over the weekend. Feel free to merge this first to unblock if you wish. |
That sounds great @saurfang! I have been trying out this feature (very nice!) and I have a few questions:
|
@saurfang Here is an example of (2) in my previous comment. For (1) it seems it should be possible to ignore "local" suggestions in Ace (see link below) but I wasn't clear on the implementation in R / Shiny. Any ideas?
|
@vnijs I think both are good improvements. Coincidentally I happened to be working on an SQL editor as an RStudio add-in / Shiny App and the autocompletion in shinyAce needs to be a lot more configurable. For your (1), it thinks it makes the most sense to turn off local completer completely, so you can implement separate completer from R side by parsing YAML file to extract keys. |
Did you post something about the SQL editor already? I seem to recall seeing something about it but didn't see it on your GitHub page. Sounds really interesting! Parsing the yaml with R is easy enough and passing it to the completer works fine as well. Is it already possible to turn off the local completer with the currently available code or would it require additional JS? |
That thing was still very much a work in progress so I made it to private for the time being. I just put out a PR to unblock you but it might need a bit more work to be releasable quality. |
oh and re: (2), this is where we can potentially merge instead of replace https://github.com/trestletech/shinyAce/blob/master/inst/www/shinyAce.js#L137 do you have a clever function interface in mind? We can add one more argument to the function or maybe create a new function that handles static completion configuration only. I feel |
oops. that particular one should be fixed now. |
The example seems to work now! |
HTML data-* attributes in htmltools no longer automatically converts to JSON from list and attribute key is converted to lower cases. This commit changes the attribute name to lower case and perform explicit JSON conversion. The example has also been fixed for the error that anonymous function needs wrapping braces.
Fixes #48