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

Code Action: Change Value Definition Type to known type #213

Open
marcoroth opened this issue Mar 5, 2024 · 0 comments
Open

Code Action: Change Value Definition Type to known type #213

marcoroth opened this issue Mar 5, 2024 · 0 comments
Labels
code-action Feature that implements a `textDocument/codeAction` request. enhancement New feature or request feature Issue that implements a new feature.

Comments

@marcoroth
Copy link
Owner

marcoroth commented Mar 5, 2024

To resolve the stimulus.controller.value_definition.unknown_type diagnostic introduced in #212 we can offer 5 quick-fixes to change the value type to one of the known value types.

import { Controller } from "@hotwired/stimulus"

export default class extends Controller {  
  static values = {
    count: { 
      default: 12,
      type: "Number", /* ┌─────────────────────────────────────────────────────────────────────────────┐
            ^^^^^^^^     │ Unknown Value type. The "count" value is defined as type "[object Object]". │
    },                   │ Possible Values: `Array`, `String`, `Boolean`, `Number`, or `Object`        │
  }                      │ Stimulus LSP (stimulus.controller.value_definition.unknown_type)            │
}                        ├─────────────────────────────────────────────────────────────────────────────┤
                         │  View Problem (⌥F8)   Quick-Fix... (⌘.)                                     │
                         └─────────────────────────────────────────────────────────────────────────────┘
                             ┌─────────────────────────────────────────┐
                             │ Quick-Fix                               │
                             ├─────────────────────────────────────────┤
                             │ Change "count" value type to `Array`    │
                             │ Change "count" value type to `Boolean`  │
                             │ Change "count" value type to `Number`   │
                             │ Change "count" value type to `Object`   │
                             │ Change "count" value type to `String`   │
                             └─────────────────────────────────────────┘ */
@marcoroth marcoroth added enhancement New feature or request feature Issue that implements a new feature. code-action Feature that implements a `textDocument/codeAction` request. labels Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-action Feature that implements a `textDocument/codeAction` request. enhancement New feature or request feature Issue that implements a new feature.
Projects
None yet
Development

No branches or pull requests

1 participant