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

[Scala] "with" keywords highlighted as out of place when comment between them and extends #3778

Open
fhunstock-semron opened this issue May 26, 2023 · 1 comment · May be fixed by #3779
Open
Labels
C: Syntax T: bug A bug in an existing language feature

Comments

@fhunstock-semron
Copy link

fhunstock-semron commented May 26, 2023

What happened?

Given the following scala code,
this will highlight the with keywords as out of place:

class c()
    extends a()
    // some comment
    with foo with bar {

    }

while the following works fine:

class c()
    extends a()
    with foo with bar {

    }

Tested on build 4143 on the stable channel

@fhunstock-semron fhunstock-semron changed the title [Scala] Comment [Scala] "with" keywords highlighted as out of place when comment between them and extends May 26, 2023
@djspiewak
Copy link
Contributor

This may not actually be solvable.

The problem here is inferring when the class definition ends in general (especially when you don't have an open curly brace) is based on a complex series of rules, most notably including a double newline. This is the same set of rules that applies to other type definitions. The issue in your example is there is a double newline, it's just hidden by the comment. Scala reasonably considers the comment line to be "not blank", but it's harder for Sublime to make the same judgement.

I would definitely like to fix this, but I'm somewhat skeptical that it's in the cards.

@deathaxe deathaxe added T: bug A bug in an existing language feature C: Syntax labels May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Syntax T: bug A bug in an existing language feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants