Skip to content

do expression support #525

Closed
Closed
@TamsynUlthara

Description

@TamsynUlthara

do expressions aren't (quite) supported.

They sort-of work because of support for do/while loops, but the highlighting breaks down in certain cases.

In particular, they're highlighted incorrectly inside array and object literals.

Examples:

const obj = {
  bar: do { // "do" gets jsObjectValue
    if (baz) { // "if" gets jsObjectFuncName
      'hi'
    } else {
      'bye'
    }
  },
} // jsParensError

const arr = [
  do { // "do" gets jsBracket
    if (baz) { // "if" gets jsObjectFuncName
      'hi'
    } else {
      'bye'
    }
  }, // jsParensError
]

Granted, do expressions are at stage 0, but Babel does support them with an official plugin, and I've seen support added to vim-javascript for other early-stage syntax.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions