Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was 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

Description

@sadikovi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions