-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Server-aware editing in VSCode and static app script generation (#139)
* Just send script and ast to client * Remove most R code due to simpler messages * Add static script generation to hosted version of editor
- Loading branch information
Showing
265 changed files
with
74,539 additions
and
18,823 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
export(launch_editor) | ||
export(parse_ui_fn) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#' Get the file type a shiny app directory | ||
#' | ||
#' @param app_loc Path to a shiny app | ||
#' @param error_on_missing Should the lack of | ||
#' app ui file trigger an error? If not returns a type of "missing" and no path | ||
#' | ||
#' @return either "SINGLE-FILE" (`app.R``), "MULTI-FILE" (`ui.R` and | ||
#' `server.R`), or "MISSING" (empty directory) | ||
#' | ||
#' @keywords internal | ||
#' | ||
get_app_file_type <- function(app_loc, error_on_missing = FALSE) { | ||
if ( | ||
fs::file_exists(fs::path(app_loc, "app.r")) || | ||
fs::file_exists(fs::path(app_loc, "app.R")) | ||
) { | ||
return("SINGLE-FILE") | ||
} | ||
|
||
if ( | ||
fs::file_exists(fs::path(app_loc, "ui.r")) || | ||
fs::file_exists(fs::path(app_loc, "ui.R")) | ||
) { | ||
return("MULTI-FILE") | ||
} | ||
|
||
if (error_on_missing) { | ||
stop( | ||
"Can't find an app.R or ui.R file in the provided app_loc. ", | ||
"Make sure your working directory is properly set" | ||
) | ||
} | ||
|
||
"MISSING" | ||
} | ||
|
||
app_type_to_files <- list( | ||
"SINGLE-FILE" = "app.R", | ||
"MULTI-FILE" = c("ui.R", "server.R") | ||
) |
Oops, something went wrong.