Skip to content

R colourising glitch with c() in function args #79559

@hongooi73

Description

@hongooi73
  • VSCode Version: 1.37.1 (system)
  • OS Version: Windows 10 Pro 1903

(Originally posted at MikhailArkhipov/vscode-r/#25 and textmate/r.tmbundle#13)

There seems to be a (rather specific) bug in how character vectors are coloured. When you have c("a", "b", ...) as a default function argument, the strings except for the first one are not treated as text:

image

It only appears to happen when the c function is used; you can see that list doesn't have this problem. Similarly, if you have a character vector anywhere other than as a default function arg, it's coloured correctly.

Steps to reproduce

  1. Type f <- function(a=c("a", "b", "c")) {} in an R editing window.
  2. Note the colour of the strings.

As far as I can tell, this bug has actually been around for a few versions of VSCode.

Does this issue occur when all extensions are disabled?: Yes

Metadata

Metadata

Assignees

Labels

grammarSyntax highlighting grammar

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions