-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Add UL4 syntax highlighting #8837
Conversation
doerwalter
commented
Oct 19, 2023
- I'm the package's author and/or maintainer.
- I have have read [the docs][1].
- I have tagged a release with a [semver][2] version number.
- My package repo has a description and a README describing what it's for and how to use it.
- My package doesn't add context menu entries. *
- My package doesn't add key bindings. **
- Any commands are available via the command palette.
- Preferences and keybindings (if any) are listed in the menu and the command palette, and open in split view.
- If my package is a syntax it doesn't also add a color scheme. ***
- If my package is a syntax it is named after the language it supports (without suffixes like "syntax" or "highlighting").
- I use [.gitattributes][3] to exclude files from the package: images, test files, sublime-project/workspace.
@deathaxe could you maybe have a look at this? You have more experience with extending syntaxes for things like template languages. @doerwalter takes a different approach than Liquid or Twig. I'm not sure of the benefits or downsides of either approach. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automated testing result: WARNING
Repo link: UL4
Results help
Packages added:
- UL4
Processing package "UL4"
- WARNING: '.sublime-syntax' support has been added in build 3092 and there is no '.tmLanguage' fallback file
- File: JavaScript-UL4.sublime-syntax
- WARNING: '.sublime-syntax' support has been added in build 3092 and there is no '.tmLanguage' fallback file
- File: UL4.sublime-syntax
- WARNING: '.sublime-syntax' support has been added in build 3092 and there is no '.tmLanguage' fallback file
- File: CSS-UL4.sublime-syntax
- WARNING: '.sublime-syntax' support has been added in build 3092 and there is no '.tmLanguage' fallback file
- File: HTML-UL4.sublime-syntax
- WARNING: '.sublime-syntax' support has been added in build 3092 and there is no '.tmLanguage' fallback file
- File: XML-UL4.sublime-syntax
- WARNING: The package does not contain a top-level LICENSE file. A license helps users to contribute to the package.
@doerwalter you can ignore those reports from the bot. A fallback for < 3092 is not required. A license is highly recommended however, MIT is a nice and simple one for no-strings-attached open source work. |
OK, I've created a new version 1.0.2 that includes a What do I have to do to get my package rechecked? |
Creating templating syntaxes via It would also be the only valid implementation in case the syntax really targets ST3. sublime-syntax So either remove The approach taken for Liquid, PHP, ... to Remark: I'd prefer file names to follow common naming scheme of extended syntaxes ( |
I've implemented the embedded version of UL4 with the method that https://www.sublimetext.com/docs/syntax.html#including-other-files seems to suggest for templating languages with the Jinja example. I'm not 100% sure, what I've now renamed the syntax definitions for the embedded grammars like this:
but I haven't created a new version yet. |
Yeah, the docs still target ST3, mainly with that regard. It's not wrong. It is just known to have some probably unwanted side effects in certain edge cases. Syntax files specify The tag is ignored by ST3, but I wouldn't start mixing things up to avoid confusion. Hence the suggestion to either remove it or restrict installation to ST4 via To be very perfect add |
OK, I can include the |
Require SublimeText version 4107 Co-authored-by: deathaxe <deathaxe82@googlemail.com>
OK, I've committed your suggestion. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automated testing result: SUCCESS
Repo link: UL4
Packages added:
- UL4
Processing package "UL4"
- All checks passed
Thanks guys. Learn something new every day! :) |
The latest version of Sublime Text (Build 4189) has started to complain about the embedded UL4 syntaxes like this:
I guess I have to change the way the embedding is implemented. https://www.sublimetext.com/docs/syntax.html#including-other-files still seems to suggest that using Where can I find documentation about the correct way? Do I have to dig through the PHP syntax to find out how it's done? |
see: sublimehq/sublime_text#6555 (comment) Examples to start with are packages like Jinja2, Liquid, Svelte, Vue. Basically extend each involved syntax and add custom UL4 rules via Then extend HTML to replace Js/Css inclusions with your customized ones. That's mostly just copy past boilerplate code. Additionally add your custom syntax to HTML as you did for the other syntaxes before. This looks a bit more complicated and verbose due to needed boilerplate code, but gives way more fine gained control about how and where custom syntax is to be added. |