Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript syntax highlighting breaks when using '<' in arrow functions over multiple lines #720

Closed
laeckerv opened this issue Feb 13, 2019 · 1 comment
Assignees

Comments

@laeckerv
Copy link

  • VSCode Version: 1.31.0 / Insiders 1.32
  • OS Version: MacOS Mojave 10.14.3
  • Does this issue occur when all extensions are disabled?: Yes

Initial bug found in

errro

This doesn't work:

  isDraggingUpFromCenter = (startPosition, data) =>
    startPosition < this.halfOfWindowHeight() &&
    startPosition > this.halfOfWindowHeight() - AREAFORLISTENERCENTER &&
    data.deltaY < TRIGGERINGDELTAY;

while this works fine:

  isDraggingUpFromCenter = (startPosition, data) => {
    return(
        startPosition < this.halfOfWindowHeight() &&
        startPosition > this.halfOfWindowHeight() - AREAFORLISTENERCENTER &&
        data.deltaY < TRIGGERINGDELTAY;
    )
  }

Simple standalone code to test with

const FOO = 0;
const FOOO = 0;

class Bar {
  myFunc1 = () =>
    1 < 2 &&
    2 > 1 &&
    FOO < FOOO;
  myFunc2 = () =>
    1 < 2 &&
    2 > 1 &&
    FOO < FOOO;
}

export default Bar

Rsults in
image

With this example (because i reduced the conditions) I also found out that when format it differently - it also works.

const FOO = 0;
const FOOO = 0;

class Bar {
  myFunc1 = () => 1 < 2 && 2 > 1 && FOO < FOOO;
  myFunc2 = () => 1 < 2 && 2 > 1 && FOO < FOOO;
}

export default Bar

Results in
image

@microsoft microsoft deleted a comment from vscodebot bot Feb 13, 2019
@mjbvz mjbvz transferred this issue from microsoft/vscode Feb 13, 2019
@mjbvz
Copy link
Contributor

mjbvz commented Feb 13, 2019

Looks like #718. I just pulled in the latest grammar form master to VS Code to test this but it still seems broken

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants