Skip to content

Incorrect javascript syntax highlighting for destructored function parameters in arrow functions #540

@mjbvz

Description

@mjbvz

From @tomsiwik on November 8, 2017 15:48

  • VSCode Version: 1.17.2
  • OS Version: Ubuntu 14.04 x64

Steps to Reproduce:

  1. Change color-scheme to monokai (best to showcase as default scheme doesn't highlight this part)
  2. Compare syntax-highlighting for the following methods:
// 1. Correct highlighting
doSomething = (param, { a = "default" } = {}) => {
    //noop
}

// 2. Incorrect highlighting
doSomething = (param, { 
    a = "default" 
} = {}) => {
    //noop
}

// 3. Correct highlighting
doSomething(param, {
    a = "default"
} = {}) {
    //noop
}

// 4. Correct highlighting
doSomething(param, { a = "default" } = {}) {
    //noop
}

// 5. Correct highlighting (notice config module)
doSomething(param, {
    a = config.get("a") 
} = {}) {
    //noop
}

// 6. Correct highlighting (notice config module)
doSomething(param, { a = config.get("a") } = {}) {
    //noop
}

// 7. Incorrect highlighting (notice config module) while 1. does
doSomething = (param, { a = config.get("a")  } = {}) => {
    //noop
}

I'm surprised this even breaks github's code highlighting. Does this belong here what syntax highlighter does vscode and github use that behaves the same?

Reproduces without extensions: Yes

Copied from original issue: microsoft/vscode#37829

Metadata

Metadata

Assignees

No one assigned

    Labels

    limitationIssue is result of tmLanguage limitation where in the lookup does not go beyond current line

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions