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

ecma scm doesn't map private properties to highlight scopes #11443

Closed
2 tasks
mesmere opened this issue Aug 7, 2024 · 4 comments
Closed
2 tasks

ecma scm doesn't map private properties to highlight scopes #11443

mesmere opened this issue Aug 7, 2024 · 4 comments
Labels
C-bug Category: This is a bug

Comments

@mesmere
Copy link

mesmere commented Aug 7, 2024

Summary

The official JavaScript tree-sitter highlights private properties in ES6 classes as:

Scopes
Private fields: ... field_definition, private_property_identifier
Private methods: ... method_definition, private_property_identifier

However, in Helix these aren't syntax highlighted and :tree-sitter-highlight-name reveals that they get no highlight scope at all.

  • Private fields should get the variable.other.member highlight (like public fields do).
  • Private methods should get the function highlight (like public methods do).

Reproduction Steps

Code:

class MyClass {
  field;
  method() {
    return;
  }

  #privateField;
  #privateMethod() {
    return;
  }
}

Screenshot:

swappy-20240807_135830

Helix log

No response

Platform

arch

Terminal Emulator

foot 1.17.2

Installation Method

manjaro pacman repo

Helix Version

helix 24.3

@mesmere mesmere added the C-bug Category: This is a bug label Aug 7, 2024
@mesmere
Copy link
Author

mesmere commented Aug 7, 2024

It looks like someone else took a crack at this already with #10554 but something's clearly broken.

@David-Else
Copy link
Contributor

David-Else commented Aug 8, 2024

Private fields should get the variable.other.member highlight (like public fields do).
Private methods should get the function highlight (like public methods do).

image
image

This seems to already be the case, at least in helix 24.7 (cfe80acb). I am using the dark_plus theme.

Please update your Helix.

@the-mikedavis
Copy link
Member

Yeah #10554 fixed this but you're on 24.03. If you update to 24.07 you should see that highlighting

@mesmere
Copy link
Author

mesmere commented Aug 12, 2024

Oh, I'm sorry. I feel silly :X

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

3 participants