javascript.tmbundle
javascript.tmbundle copied to clipboard
`static` keyword shown as invalid
Code that I'm using (from Stimulus homepage)
// hello_controller.js
import { Controller } from "stimulus"
export default class extends Controller {
static targets = [ "name", "output" ]
greet() {
this.outputTarget.textContent =
`Hello, ${this.nameTarget.value}!`
}
}
output

The same thing is happening with the private keyword.
I fixed this for me by going to the bundle editor Bundles>Javascript>Language Grammars>Javascript And add static to the matches next to 'keyword.control.js';
The same thing is happening with the
privatekeyword.
There is no private keyword in JavaScript (it uses hashnames, like this.#attribute and #method(){}), so that is rendering correctly. The static keyword does need adding though (see @leenapps' answer).
