marcoroth / stimulus-lsp

Intelligent Stimulus tooling for Visual Studio Code, Neovim, and more!
https://hotwire.io/ecosystem/tooling/stimulus-lsp
MIT License
243 stars 13 forks source link

VS Code: Controller suggestion appears three times #355

Open asilano opened 4 months ago

asilano commented 4 months ago

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 commented 2 months ago

Possibly related to #275