Giter Site home page Giter Site logo

False Positive - "bs" isn't a valid Stimulus controller. Did you mean "maps"?Stimulus LSP(stimulus.controller.invalid) about stimulus-lsp HOT 6 OPEN

marcoroth avatar marcoroth commented on May 30, 2024
False Positive - "bs" isn't a valid Stimulus controller. Did you mean "maps"?Stimulus LSP(stimulus.controller.invalid)

from stimulus-lsp.

Comments (6)

marcoroth avatar marcoroth commented on May 30, 2024 1

Thanks for reporting this one, @fig!

I'm not quite sure how and if we can solve this. But I'm wondering if we could have an option to maintain an "ignorelist" of identifiers for which Stimulus LSP shouldn't report warnings.

from stimulus-lsp.

fig avatar fig commented on May 30, 2024

@marcoroth , I'm afraid I don't have a clue either. 🤷
I'm not very familiar with the internals of the JavaScript LSP space. Would it be possible to scan the internals to register "foreign" JS modules (or whatever they're called). An "ignorelist" sounds like a bit of a shotgun approach, to me.

Now I'm wondering, how does Stimulus deal with naming collisions with third party libraries?

from stimulus-lsp.

fig avatar fig commented on May 30, 2024

Ah, wait! Stimulus requires a data-controller to be declared in a parent element. Maybe this is the seam we are looking for? Stimulus-LSP should check parent nodes. Maybe it already does? Mind you, if we disregard targets outwith a related controller, that kind of negates the purpose of detecting unregistered Targets?
This is not shotgun surgery, It's a circular firing squad!

from stimulus-lsp.

marcoroth avatar marcoroth commented on May 30, 2024

Looking for the data-controller attribute would only work if the controller is within the same file.

This might be given for most cases, but there's also the use-case where you have the controller elements in different views/partials/components.

from stimulus-lsp.

Gert-JanPeeters avatar Gert-JanPeeters commented on May 30, 2024

Instead of a standard "ignorelist", maybe we can provide the LSP an "ignorelist" on initialization?

This has the benefit that we leave the choice of what to ignore to the client and it also sets up further customization in the future. It does require some more setup...

https://microsoft.github.io/language-server-protocol/specifications/specification-3-14/#workspace_configuration
https://microsoft.github.io/language-server-protocol/specifications/specification-3-14/#workspace_didChangeConfiguration

from stimulus-lsp.

christopher-b avatar christopher-b commented on May 30, 2024

Did anyone work out a workaround for this? Thanks!

from stimulus-lsp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.