Convert abbreviated or full snippet name of snippet type into a full name of snippet type.

match_snippet_type(type = get_default_snippet_types(), several.ok = FALSE)

Arguments

type

(character) A character vector of snippet types. Currently allowed values are "r", "markdown", "c_cpp", "css", "html", "java", "javascript", "python", "sql", "stan", "tex". May be unambiguously truncated. Defaults to "r".

several.ok

(logical) Specify if type should be allowed to have more than one element. Defaults to FALSE. See also base::match.arg()

Value

(sting) Correct snippet type in lower case. By default returns "r".

Examples

# Defaults to "r":
match_snippet_type()
#> [1] "r"

match_snippet_type("r")
#> [1] "r"

match_snippet_type("m")
#> [1] "markdown"