fix(r): resolve highlight regressions

This commit is contained in:
Riley Bruins 2024-06-28 21:52:23 -07:00 committed by Christian Clason
parent fa19150d00
commit f0e3b5c5fe
2 changed files with 15 additions and 9 deletions

View file

@ -51,6 +51,7 @@
"$" "$"
"@" "@"
":" ":"
"!"
"special" "special"
] @operator ] @operator
@ -86,6 +87,12 @@
(call (call
function: (identifier) @function.call) function: (identifier) @function.call)
(extract_operator
rhs: (identifier) @variable.member)
function: (extract_operator
rhs: (identifier) @function.method.call)
; Parameters ; Parameters
(parameters (parameters
(parameter (parameter
@ -110,12 +117,7 @@
(function_definition (function_definition
name: "\\" @operator) name: "\\" @operator)
[ (return) @keyword.return
"in"
(return)
(next)
(break)
] @keyword
[ [
"if" "if"
@ -126,6 +128,9 @@
"while" "while"
"repeat" "repeat"
"for" "for"
"in"
(break)
(next)
] @keyword.repeat ] @keyword.repeat
[ [

View file

@ -23,14 +23,14 @@ b <- list(name = "r", version = R.version$major)
# ^ @variable.parameter # ^ @variable.parameter
# ^ @string # ^ @string
# ^ @operator # ^ @operator
# ^ @variable # ^ @variable.member
Lang$new(name = "r")$print() Lang$new(name = "r")$print()
# ^ @variable # ^ @function.method.call
for(i in 1:10) { for(i in 1:10) {
# <- @keyword.repeat # <- @keyword.repeat
# ^ @keyword # ^ @keyword.repeat
} }
add <- function(a, b = 1, ...) { add <- function(a, b = 1, ...) {
@ -39,6 +39,7 @@ add <- function(a, b = 1, ...) {
# ^ @variable.parameter # ^ @variable.parameter
# ^ @constant.builtin # ^ @constant.builtin
return(a + b) return(a + b)
# ^ @keyword.return
} }
base::letters base::letters