marcoroth/stimulus-lsp

Diagnostic: Implement `stimulus.controller.class.missing` diagnostic

Opened this issue · 0 comments

Given this controller:

import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
  static classes = ["loaded"]
}

and this HTML, it should add the following diagnostic:

<form data-controller="search" data-search-loading-class="search--busy"></form>
<!--                                       ^^^^^^^
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ "loading" isn't a valid Stimulus CSS Class on the "search" controller. Did you mean "loaded"?  │
│ Stimulus LSP (stimulus.controller.class.missing)                                               │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│  View Problem (⌥F8)   Quick-Fix... (⌘.)                                                        │
└────────────────────────────────────────────────────────────────────────────────────────────────┘