Skip to content
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

[Java] Syntax highlighting not working on multi-line method declaration #63137

Closed
stanleynguyen opened this issue Nov 14, 2018 · 3 comments
Closed
Assignees
Labels
grammar Syntax highlighting grammar

Comments

@stanleynguyen
Copy link

Syntax highlighting doesn't detect language component correctly if a method declaration spans over multiple lines. Here is an example (please only take note of the colors)

Expected:
capture1

Actual:
capture

  • VSCode Version: 1.29
  • OS Version: Both Windows 10 and MacOS Mojave

Steps to Reproduce:

  1. Declare a method with signature that's longer than line width limit
  2. Save and wait for the formatter to reformat it to multiple lines

Does this issue occur when all extensions are disabled?: Yes

@ghost
Copy link

ghost commented Nov 28, 2018

I can reproduce this error with the following code:

class C {
    public
    void foo() {}
}

screen shot 2018-11-28 at 20 26 16

void and foo are not highlighted. The TextMate scope for the declaration is

  • meta.class.body.java
  • meta.class.java
  • source.java

Everything is highlighted correctly when the access modifier public is removed. I think the bug is related to the member-variables pattern in the syntax definition (link) which is included in class-body.

The C# grammar handles this without problems:
screen shot 2018-11-28 at 20 26 06

@alexr00
Copy link
Member

alexr00 commented Jan 8, 2019

This issue was moved to atom/language-java#186

@alexr00 alexr00 closed this as completed Jan 8, 2019
@alexr00
Copy link
Member

alexr00 commented Jan 8, 2019

Moved to the owning repository since this is an issue with the text-mate grammar that we consume.

@alexr00 alexr00 added the grammar Syntax highlighting grammar label Jan 8, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
grammar Syntax highlighting grammar
Projects
None yet
Development

No branches or pull requests

3 participants