P5.js web editor doesn't like private fields

The example code at Private fields works as expected but the editor complains visually upon encountering a # symbol… the rest of the line is highlighted in red.

Is there a directive I could insert to prevent the lint functionality from visually complaining? Or is this a limitation of the current editor implementation?

Thanks!

Fabio

Hi @fabiopettinati ,

Maybe you can check here and/or raise an issue…
p5.js-web-editor/issues

Cheers
— mnse

Hi @fabiopettinati,

Looking at the p5-web-editor code, I found that they use CodeMirror which is a code editor written in JavaScript.

For the private fields, looks like the issue has already been solved in 2020 on their GitHub repository:

The thing is that p5-web-editor uses codemirror ^5.62.0 which may not be up to date with the latest package.

As @mnse said, you can open an issue on the p5 editor repository. :wink:

2 Likes

Thanks to @mnse and @josephh for replying. I’ve opened an issue in the editor repository.

Syntax highlighting still not working for private fields (supported in ES2022)#2031

1 Like