Skip to content

Fix arrow function parens arguments#375

Closed
dodev wants to merge 1 commit into
pangloss:developfrom
dodev:develop
Closed

Fix arrow function parens arguments#375
dodev wants to merge 1 commit into
pangloss:developfrom
dodev:develop

Conversation

@dodev

@dodev dodev commented Apr 14, 2016

Copy link
Copy Markdown

The syntax highlighter showed error when arrow functions had parentheses surrounding their arugemnts:

...
  .then((result) => {
      send(result);
  })
--^ // The last parenthesis of `then` method call was considered excess.

I fixed the regex for args in parenthesis and it seems it works. I'm using it right now.

As seen in #374 :)

@amadeus

amadeus commented Apr 14, 2016

Copy link
Copy Markdown
Collaborator

So, unfortunately, technically this doesn't work. It may appear to work based on your syntax highlighting, however it actually completely breaks the matching of jsArrowFuncArgs. In other words, it's the same as as just removing that entire match group completely.

I have been doing a lot of research into this, and it's actually a quite difficult problem to solve. On potential solution may be to remove the jsArrowFuncArgs highlight group completely until I can figure out a solution that works. I've tested a bunch of other JS syntax plugins, including even in other editors, and nobody can get it right for all scenarios, it's a real clusterfuck.

@dodev

dodev commented Apr 15, 2016

Copy link
Copy Markdown
Author

TBH, I don't understand the regex syntax in viml and I thought it was a typo, a missing closing bracket. I hope somebody finds a solution. Unfortunately, I don't have enough free time to look into this issue.

@dodev dodev closed this Apr 15, 2016
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

Successfully merging this pull request may close these issues.

2 participants