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] Improved function parameter bindings (and tests). #1423

Merged

Conversation

Thom1729
Copy link
Collaborator

Adapted variable binding pattern logic from #1338 to handle function parameters, finishing #1102. Should now cover all corner cases. Added comprehensive tests.

Notes:

  • Commas in function parameter lists are scoped punctuation.separator.parameter rather than punctuation.separator.comma. I preserve the old behavior here. I'm not sure what the reason is for the distinction.
  • Function parameter initializers were formerly scoped meta.parameter.optional. This is not a standard scope, and I'm not sure what its purpose would be. (No other syntaxes appear to use this scope, excepting syntaxes derived directly from this one.) If we do want to differentiate parameters with initializers, I'm open to suggestions on how to do it.
  • Object destructuring patterns were formerly scoped meta.block. I have replaced that scope with meta.binding.destructuring.mapping.

@wbond wbond merged commit 95b1c8d into sublimehq:master Mar 14, 2018
@Thom1729 Thom1729 deleted the javascript-function-parameter-bindings branch March 14, 2018 20:08
deathaxe pushed a commit to deathaxe/sublime-packages that referenced this pull request Jun 9, 2019
…arameter-bindings

[JavaScript] Improved function parameter bindings (and tests).
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