Comments (6)
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.
@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.
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.
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.
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.
Did anyone work out a workaround for this? Thanks!
from stimulus-lsp.
Related Issues (20)
- Find References: list where a specific Stimulus target is used
- Goto Definition: clicking on a data target attribute should goto to the controller where it's defined
- Code Action: Register unregistered Stimulus controller
- Tree View: Show unregistered controllers HOT 1
- Tree View Item Code Action: Register unregistered Stimulus controller HOT 1
- Code Lens/Inlay Hints?: Annotate controller with targets/values/classes/actions the controller inherits from parent
- Add `stimulus` as a `contributes.languages` in VS Code client
- Installation process HOT 4
- Diagnostic: Add warning if a controller is never referenced in the HTML
- Twig support
- Blade support
- Missing Actions for Inherited/Extended Controllers HOT 3
- Diagnostic: Put controller actions in specific order
- Diagnostic: Calling `application.register` with a non-controller should warn you
- CodeLens: CodeLens is wrong when file defines more than one controller
- Code Action: Register controller after executing `stimulus.controller.create`
- Code Action: Refactor shorthand-value definition to explicit version HOT 1
- Code Action: Change Value Definition Type to known type
- Code Action: Change deprecated Stimulus imports
- LSP VS Code and Laravel HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stimulus-lsp.