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

Conversation

sadikovi
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

This pull request fixes issue with tokenising generics array. Example of code is below:

class A<T> {
  private B<T>[] arr;
}

The reason why it was broken is variable pattern that now considers either generic declaration or primitive array ([] to be precise). The solution is combining those pattern into a chain rather than OR.

Before this patch:
before

After:
after

Alternate Designs

Only one approach was considered - modifying variables pattern to handle such highlighting. Note that this is not very common in Java to use generics array like this, but is still worth fixing.

Benefits

Fixes broken highlight. Works with my generics patch and does not break tests in master + in that patch.

Possible Drawbacks

Might break other untested corner cases.

Applicable Issues

None

@sadikovi
Copy link
Contributor Author

@50Wliu please review. Let me know if this solution could potentially break other cases.

@sadikovi
Copy link
Contributor Author

sadikovi commented Oct 4, 2017

@50Wliu Could you have a look at this PR? Thanks!

@winstliu
Copy link
Contributor

winstliu commented Oct 4, 2017

Whoops, I didn't get a notification for this PR for some reason!

@winstliu winstliu merged commit 299c283 into atom:master Oct 4, 2017
@sadikovi sadikovi deleted the fix-generic-array branch October 4, 2017 22:16
@sadikovi
Copy link
Contributor Author

sadikovi commented Oct 4, 2017

@50Wliu Thanks for merging!

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

Successfully merging this pull request may close these issues.

2 participants