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

Fix whitespace issue in variable definition#197

Merged
sadikovi merged 1 commit intoatom:masterfrom
sadikovi:array-issue
Apr 13, 2019
Merged

Fix whitespace issue in variable definition#197
sadikovi merged 1 commit intoatom:masterfrom
sadikovi:array-issue

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 PR fixes an issue when inserting a whitespaces after storage type in variable definition would break highlighting.

For example,

class A {
  String [] var1;
  int [] var2;
  List <String> var3;
}

Variables var1, var2, and var3 would not be scoped properly. I patched variables scope by inserting \s* to handle whitespaces for generics and arrays.

Alternate Designs

Adding a whitespace inside the matching pattern, but it seemed a bit odd to have it, plus, there was already a precedent to use it outside of matching groups.

Benefits

Fixes the highlighting.

Possible Drawbacks

None.

Applicable Issues

#196

@sadikovi sadikovi merged commit 9fc8f69 into atom:master Apr 13, 2019
@sadikovi sadikovi deleted the array-issue branch April 13, 2019 14:23
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