Shinymod snippet incorrect? #8509
-
Hi all, just a silly little thing I noticed. The RStudio nameUI <- function(id) {
ns <- NS(id)
tagList(
)
}
nameServer <- function(id) {
moduleServer(
id,
function(input, output, session) {
}
)
} whereas Positron gives us name_UI <- function(id) {
ns <- NS(id)
tagList(
)
}
name <- function(input, output, session) {
} Is this correct? Do R-Shiny modules not require Also, how do I change the default snippets? I'd like to have my server functions also use the naming convention |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I believe this comes from the Shiny extension. I just tried locally and I get the same as your top example. nameUI <- function(id) {
ns <- NS(id)
tagList(
)
}
nameServer <- function(id) {
moduleServer(id, function(input, output, session) {
})
} What version of the Shiny Extension are you using? |
Beta Was this translation helpful? Give feedback.
-
@AlbertRapp You don't happen to have a very old version of Positron, do you? It looks like you might have the version of the shinymod snippet that we removed back in April: posit-dev/ark#780 @jonvanausdeln is correct that the only snippet I see in an up-to-date version of Positron is this one from the Shiny extension: https://github.com/posit-dev/shiny-vscode/blob/344cb8cb3044f765f374b06a50bdcbf252d082a4/snippets/shiny-r.json#L23 For some helpful on how to set up your own snippets, check out: https://positron.posit.co/r-snippets.html |
Beta Was this translation helpful? Give feedback.
@AlbertRapp You don't happen to have a very old version of Positron, do you? It looks like you might have the version of the shinymod snippet that we removed back in April: posit-dev/ark#780
@jonvanausdeln is correct that the only snippet I see in an up-to-date version of Positron is this one from the Shiny extension: https://github.com/posit-dev/shiny-vscode/blob/344cb8cb3044f765f374b06a50bdcbf252d082a4/snippets/shiny-r.json#L23
For some helpful on how to set up your own snippets, check out: https://positron.posit.co/r-snippets.html