Conversation
|
Thank you for your contribution! It’s quite nice :) Something I’m concerned about is whether adding logic for checking HTML, Vue or whatever framework will have an impact on the performance. The reason being that these checks will run every time there’s hover. And this happens a lot. I wonder if there’s a way to measure the impact? Will try to investigate and share what I’ve found. |
|
@dzhavat , any chance of adding this as an experimental feature? Something like a 'toggle' warning for the possible drawback. |
|
@dougwl Adding this feature behind a toggle sounds like a good idea, though I haven't yet looked at how to do it. There's another way to try it too. VS Code extensions can be installed from a |
Potentially closes #3 .
I'm not completely certain
templateLanguagesshould be where it is right now, but if you want it somewhere else I can move it easily.I'm using a regex that only matches the code encased in the
<style>tags. This takes into account various Vue-esque attributes likelangand such (You can test it here), thenTextDocument.positionAtto determine which lines the start and end indexes of the match are located on, and from there I simply check if the line you're hovering is between the start and the end of the<style>tag, and if it is, the usual initial value code is ran.I've only tested this briefly and on Vue files (I don't know Svelte), so I hope that it works in all scenarios. :)