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

Fix highlighting for generics with dots in class name #133

Merged
merged 2 commits into from Mar 5, 2018

Conversation

Projects
None yet
2 participants
@sadikovi
Member

sadikovi commented Mar 5, 2018

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 issue when having code like Set<java.lang.String> var = ..., java.lang.String part was highlighted incorrectly.

Consider code below:

class A {
  Set<MapEntry<K, V>> var = null;
  Set<Map.Entry<K, V>> varA = null;
  Set<java.util.List<K>> varB = null;
}

Before the patch:

before

After the patch

after

Alternate Designs

None were considered. I just tried different combinations of patterns to see which one worked.

Benefits

Fixes the issue, without breaking existing tests.

Possible Drawbacks

This does not fix code like following, parts java.util.Set and java.lang.String are highlighted incorrectly:

class A {
  java.util.Set<java.util.List<K>> varA = null;
  java.lang.String varB = null;
}

But I think this is outside of the scope of this PR.

Applicable Issues

Fixes #131

@sadikovi

This comment has been minimized.

Member

sadikovi commented Mar 5, 2018

@50Wliu Could you please review this PR? Thanks!
Let me know what you think about Possible Drawbacks section. Should we fix it here or create a separate issue? Thanks.

@50Wliu

This comment has been minimized.

Member

50Wliu commented Mar 5, 2018

Separate issue is fine.

@50Wliu 50Wliu merged commit 9c2c2ec into atom:master Mar 5, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@sadikovi sadikovi deleted the sadikovi:generics-with-dots branch Mar 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment