-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support for svelte files #165
Comments
A bit more info would be useful – until now I wasn’t aware of Svelte… which is presumably what you are asking about? I find evanleck/vim-svelte and leafOfTree/vim-svelte-plugin for that – are you using one of those? If you have any sense of this, would you say they are both popular? Do people use something else? Oddly, the way those plugins are constructed and the way CSS Color is built, I think it should be getting loaded automagically already, in which case your issue would be a bug rather than a feature request. But this is preliminary only as I haven’t done any testing yet and may find I was misremembering or overlooking something once I do. |
apologies svelte files have html, javascript and css styling all together in one file. i am using the leafOfTree plugin. It sets the filetype to "svelte" and dynamically sets a subtype as the cursor moves through the file and fires an event there is a note in the plugin readme:
which is what the "kludge" fix in the OP does (it cloned the css settings to create new svelte settings) TBH i don't know enough about how this works and what other plugins (like linters?) are listening to that subtype event - it might be that vim-css-color doesn't need such precise tracking. I've been running with my "svelte.vim" setting hack which just treats a svelte file like a css file and the colors get interpreted just fine. There probably is an edge case where a javascript constant will look like a color and vim-css-color will argue with syntax highlighting but i haven't seen it yet. It's sort of working but doesn't seem like a clean, proper fix. there are some the tricky things happening in the /after/syntax/*.vim files. Like "runtime" for example. there seems to be a lot of functionality there for reusing code from other filetypes. i might be able to help with a PR if i understood how these files work. And maybe the "right" way to do this is to only operate on the stuff between <style> tags. (Currently i'm clueless how to do this though). |
please add support for
.svelte
filesi've kludged a fix in my copy of the plugin as suggested in issue 153
by copying the
after/syntax/css.vim
file toafter/syntax/svelte.vim
this basically works on css that appears between
<style></style>
tags but i am not confident to submit this as a PR because it seems there is a more thorough and correct way to do this. (Should i use "runtime" and refer to the existing .css file instead? What about typescript in svelte files? - should the svelte config reference the typescript configs some way?). I am clearly out of my depth.The text was updated successfully, but these errors were encountered: