tejanium / vscode-stimulusjs

VS Code Stimulus JS Support
6 stars 4 forks source link

anchor tag target attributes are giving false 'Unknown stimulus controller' errors #186

Closed cvollmer closed 3 years ago

cvollmer commented 3 years ago

it is not data-target, just target: "_blank" in a link_to tag. Not sure how to get around that and it is adding noise.

forsbergplustwo commented 3 years ago

Great extension! Unfortunately seeing the same issue. I don't know enough about VS Code extensions, TypeScript or REGEX to be able to contribute a fix myself. However, it seems the following regex is the culprit:

https://github.com/tejanium/vscode-stimulusjs/blob/3ea42d61b4e0807a5ede898ea69d01484fe0402e/src/models/stimulus_syntax.ts#L1

If it could be updated to ignore where the value starts with an underscore (_blank, _parent, _self, _top), then this issue would be avoided.