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

VS Code: Controller suggestion appears three times #355

Open
asilano opened this issue Jul 25, 2024 · 1 comment
Open

VS Code: Controller suggestion appears three times #355

asilano opened this issue Jul 25, 2024 · 1 comment

Comments

@asilano
Copy link

asilano commented Jul 25, 2024

In a brand new Rails app with a single controller defined as so:

application.js

import "@hotwired/turbo-rails"
import "controllers"

controllers/application.js

import { Application } from "@hotwired/stimulus"

const application = Application.start()

// Configure Stimulus development experience
application.debug = false
window.Stimulus   = application

export { application }

controllers/books_controller.js

import { Controller } from "@hotwired/stimulus"

// Connects to data-controller="books"
export default class extends Controller {
  connect() {
  }

  favourite() {

  }
}

controllers/index.js

// Import and register all your controllers from the importmap under controllers/*

import { application } from "./application"

import BooksController from "./books_controller"
application.register("books", BooksController)

the suggested controllers when completing a data-controller="" attribute are books, repeated three times:
image

Update: It appears that the list of Registered Controllers in the Explorer panel also, after some time, updates to showing 3 Registered Controllers, when there's only 1 in the app.

@MatheusRich
Copy link

Possibly related to #275

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

2 participants