Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Conversation

@caleb531
Copy link
Contributor

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

A recent update to https://github.com/tree-sitter/tree-sitter-javascript restructured the way function declarations are constructed in the syntax tree. This change is not present in the latest stable Atom (v1.38.0 at the time of this writing), but is present when I forked language-javascript (v0.132.0 at the time of this writing).

In effect, when I cloned and linked language-javascript, the names for function declarations are no longer colorized.

Current:
1-before

This PR restores colorization for function declaration names, according to the new syntax tree structure.

After this PR is merged:
2-after

Syntax tree in Atom 1.38.0 (working):
3-tree-old-working

Syntax tree in language-javascript 0.132.0 (what breaks things):
4-tree-new-broken

Alternate Designs

A different selector could theoretically be used, but function_declaration > identifier seemed most appropriate and consistent with what was already present in the grammar.

Benefits

Colorization for function declaration names is restored to its former glory!

Possible Drawbacks

None that I can see, as the change is small and limited in scope, and per my screenshot above, function expressions are not negatively impacted by this change.

Applicable Issues

N/A

@rsese rsese added the triaged label Jul 18, 2019
@rsese
Copy link

rsese commented Jul 18, 2019

Failure looks unrelated, we restarted it but same error.

@jasonrudolph jasonrudolph merged commit d821224 into atom:master Sep 5, 2019
@jasonrudolph
Copy link
Contributor

Nice catch, @caleb531. Thanks for this fix! ⚡

@jasonrudolph jasonrudolph self-assigned this Sep 5, 2019
@caleb531 caleb531 deleted the fn-declaration-name branch September 5, 2019 16:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants