javascript.tmbundle icon indicating copy to clipboard operation
javascript.tmbundle copied to clipboard

`static` keyword shown as invalid

Open aaronmoodie opened this issue 6 years ago • 3 comments

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 image

The same thing is happening with the private keyword.

aaronmoodie avatar Sep 22 '19 09:09 aaronmoodie

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';

leenapps avatar Sep 06 '21 09:09 leenapps

The pull req from savetheclocktower/overhaul appears to fix this as well.

class internal static variable color

ogallagher avatar Apr 02 '22 13:04 ogallagher

The same thing is happening with the private keyword.

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).

7ombie avatar Feb 06 '23 20:02 7ombie