This PR modifies html.vim so that it can be extended by all the other html templating languages by using generic regex for tag matching/attribute matching. Also support for htmx and alpine.js is added to html.vim and svelte.vim is modified to use the extended html.vim.
FYI: I used opencode to program this patch and am fully aware of the code being commited.
https://github.com/vim/vim/pull/21326
(14 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Sorry, I had the impression the svelte syntax file, having been merged, was probably considered resolved.
Yes, as @chrisbra says this is the wrong approach. Matching the shape of an HTML syntax file isn't nearly as useful as matching the specifics and changing tthirty year old behaviour will annoy lots of users.
I'm aware html.vim is at least a little out of date. I took it over a couple of years ago because it was abandoned and haven't done much with it yet as it rarely attracts any bug reports. Squeaky wheels and all that...
I haven't looked at the details of this PR but in principle we shouldn't be adding anything to this file besides generic capabilities that make extension easier. Template syntax files should include the html syntax and extend it.
Perhaps it would be better to provide the simplest example of a file that doesn't work with a description of the desired result.
I also noticed that the recently merged svelte additions to the JavaScript syntax file also take the wrong approach. That file, ideally, shouldn't need to know anything about svelte.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
I also noticed that the recently merged svelte additions to the JavaScript syntax file also take the wrong approach. That file, ideally, shouldn't need to know anything about svelte.
The svelte.js/ts files are standard js/ts files but with special functions for runes which start with $ symbol. So, I believe that is the right place for them to go. The other way would be to create new filetype for specifically svelte.js/ts and add this one condition while extending js/ts files which basically will be the only content in those newly created filetypes.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()