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.

[Java] Multi-line method declaration does not get properly recognized #186

Open

Description

@alexr00

From @stanleynguyen on November 14, 2018 15:4

Take note of the highlighting of public void:

Expected:
capture1

Actual:
capture

Copied from original issue: microsoft/vscode#63137

Activity

  1. alexr00 commented on Jan 8, 2019

    @alexr00
    Author

    From @h-c-h on November 28, 2018 19:27

    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

  2. changed the title [-][Java] Syntax highlighting not working on multi-line method declaration[/-] [+][Java] Multi-line method declaration does not get properly recognized[/+] on Jan 8, 2019
  3. alexr00 commented on Jan 8, 2019

    @alexr00
    Author

    image
    image

  4. felixhao28 commented on Jan 8, 2019

    @felixhao28

    I think this is due to limitation of the Regex engine oniguruma, which does not work across lines.

  5. sadikovi commented on Jan 8, 2019

    @sadikovi
    Contributor

    Yes, you are right. But this could be worked around by changing the code for the scope - I will have a look.

  6. JoeyRxy commented on Aug 31, 2019

    @JoeyRxy

    so anyone know how to fix it?

  7. Eskibear commented on May 13, 2020

    @Eskibear
    Contributor

    Any updates? BTW hightlighting for multi-line class declaration is also broken:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions