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
RStudio code mode for Ace #14356
Comments
@seanbirchall Thank you for bringing this up! @kevinushey Any thoughts? Pinging you because you understand this better than me. 🙂 |
Assuming I'm understanding your question, RStudio uses its own completion system independent of Ace, so you'd have to wire up your own completion solution using the existing Ace tools. (RStudio relies on a lot of the existing R session state for the completions it provides, so it needs more context than is just available in the Ace editor instance.) |
I would say I'm trying to understand what is covered in Ace? For instance the there's a custom R mode being defined which I included above, but also code for, r_highlight_rules, r_code_model, r_matching_brace_outdent which I think could all be useful to me. Right now I'm using an R package called shinyAce for code completions in my Ace Editor. I would like to try and pull all of this back into JavaScript and incorporate some of the great formatting and completion logic from RStudio. I'm aware that there is probably a lot more happening behind the scenes like capturing packages, functions, and everything else going on in the R Environment. Which currently isn't an issue for me as shinyAce actually already takes care of all that. The formatting and what is probably r_code_model is all off in my current implementation as well as some edge cases like r_matching_brace_outdent. With shinyAce I can define a custom mode that is packaged with Ace or create my own. So I'm trying to create my own that makes my IDE app feel more like RStudio. It might be easier to just try writing out some code in it here to see what I mean. Would me creating a custom mode using some of the RStudio code above make the code writing experience better (by better I mean more like RStudio)? Here's some shinyAce code worth looking at if you're trying to understand what I mean by using shinyAce/R for my current code completions. I could also implement some of this there, but I already notice that the code completions in R are slower than RStudio/JS. |
Any idea how / if it'd be possible to create a custom code mode for Ace called rstudio? Opened this with Ace too ajaxorg/ace#5493.
It looks like I could probably just start from here and pull in all the other necessary requirements. The code here looks very similar to how standard boilerplate code modes for Ace looks so maybe this won't be too hard.
RStudio isn't spinning up some web server or service worker that I'm not aware of in the background for completions, linting... etc with Ace right? So I could probably do something like below and get RStudio like code completions in the browser, so long as I get everything together and working? If so then I imagine I can just compile all this to a single code mode file.
The text was updated successfully, but these errors were encountered: