Skip to content
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

[WIP][Completion] Configurable Completers #53

Merged
merged 2 commits into from
Apr 6, 2018

Conversation

saurfang
Copy link
Contributor

@saurfang saurfang commented Apr 5, 2018

Improve reconfigurability of completers:

  1. Completers can be selectively enabled and disabled. snippet and keywords completers source completions from Ace's language mode definition. text completer completes with local words.
  2. R language completer now receives full text in addition to the current line buffer due to full-text lags due to debouncing.
  3. R language completer now provides full completion object such that fields can be customized: name, value, description, and meta.

@vnijs This is based on my work in progress SQL editor. As far as I can tell, it works fine but I have not done extensive testing. Feel free to work off of this branch or even merge if you wish. I have left a few TODOs in the code for ideas.

For your case, I think you need

updateAceEditor("editor", autoCompleters = "rlang")

and with value <- session$input[[paste0("shinyAce_", inputId, "_hint")]] you can get full document with value$document to parse yaml with.

p.s. The js injection in aceEditor horrifies me a little and it's also unfortunate to have a duplicated logic in aceEditor and updateAceEditor.

Improve configurability of completers:

1. Completers can be selectively enabled and disabled. `snippet` and `keywords` completers source completions from Ace's language mode definition. `text` completer completes with local words.
1. R language completer now receives full text in addition to the current line buffer due to full text lags due to debouncing.
1. R language completer now provides full completion object such that fields can be customized: name, value, description and meta.
@vnijs
Copy link
Collaborator

vnijs commented Apr 6, 2018

For the yaml processing example I mentioned autoCompleters = "static" works perfectly. Really nice. I'll look at the others tomorrow.

@vnijs
Copy link
Collaborator

vnijs commented Apr 6, 2018

@saurfang and @GregorDeCillia: I ended up using paste0(inputId, "_shinyAce_hint").

@vnijs vnijs closed this Apr 6, 2018
@vnijs vnijs reopened this Apr 6, 2018
@vnijs vnijs merged commit 9f98aac into trestletech:master Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants