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

static keyword shown as invalid #65

Open
aaronmoodie opened this issue Sep 22, 2019 · 3 comments
Open

static keyword shown as invalid #65

aaronmoodie opened this issue Sep 22, 2019 · 3 comments

Comments

@aaronmoodie
Copy link

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.

@leenapps
Copy link

leenapps commented Sep 6, 2021

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

@ogallagher
Copy link

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

class internal static variable color

@7ombie
Copy link

7ombie commented Feb 6, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants