This function dynamically evaluate R for syntax errors using the
parse
function.
aceAnnotate(inputId, session = shiny::getDefaultReactiveDomain())
The id of the input object
The session
object passed to function given to
shinyServer
An observer reference class object that is responsible for offering
code annotations. See observeEvent
for more details.
You can use suspend
or destroy
to pause to stop dynamic code
completion.
The observer reference object will send a custom shiny message using
session$sendCustomMessage
to the annotations endpoint containing
a json list of annotation metadata objects. The json list should have
a structure akin to:
[
{
row: <int: row of annotation reference>,
col: <int: column of annotation reference>,
type: <str: "error", "alert" or "flash">,
html: <str: html of annotation hover div, used by default over text>,
text: <num: text of annotation hover div>,
}
]
You can implement your own code completer by observing modification events to
input$<editorId>_shinyAce_annotationTrigger
where <editorId> is the
aceEditor
id. This input is only used for triggering completion and
will contain a random number. However, you can access
session$input[[inputId]]
to get the input text for parsing.