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

Generic angle brackets have the wrong scope in situations like "variable = (A<B>) value" #132

Open
sadikovi opened this issue Feb 20, 2018 · 0 comments
Labels

Comments

@sadikovi
Copy link
Contributor

Description

This is an issue reported as part of #127.

Tested on the latest master branch 7a42895.
Code to reproduce:

class A {
  void func() {
    B<C> value = null;
    value = (B<C>) obj;
  }
}

The angle brackets on the line value = (B<C>) obj have the wrong scope keyword.operator.comparison.java, but should be punctuation.bracket.angle.java.

Screenshot (click on the image for higher resolution):

screenshot from 2018-02-21 09-50-28

Steps to Reproduce

  1. Open Atom new tab
  2. Select Java language
  3. Paste the code sample above
  4. Inspect angle brackets DOM elements in DevTools console

Expected behavior: [What you expect to happen]
Angle brackets in the code snippet above are scoped as punctuation.bracket.angle.java

Actual behavior: [What actually happens]
Angle brackets in the example above are scoped as keyword.operator.comparison.java.

Reproduces how often: [What percentage of the time does it reproduce?]
Reproducible 100% - looks like a bug I might have introduced when fixing generics highlighting related to comparison operators.

Versions

Tested on both OS X and Ubuntu.
Atom 1.23.3+.
language-java is the latest master.

Additional Information

This was reported originally in #127. For more information, please see that issue.

@sadikovi sadikovi changed the title Generic angle brackets have the wrong scope in situations like variable = (A<B>) value. Generic angle brackets have the wrong scope in situations like "variable = (A<B>) value" Feb 20, 2018
@winstliu winstliu added the bug label Mar 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants