-
Notifications
You must be signed in to change notification settings - Fork 16
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 support for nested CSS #9
Comments
This feature is impossible to add safely without a working test suite for this package. |
Hi, My extension Better Less has full syntax highlighting support for nested selectors, and also works with plain CSS. Would it be possible to adapt the work I've done there for this extension? @romainmenke if could you point me to any similar packages that have a qualifying working test suite that I could use as a guide for implementing it here, I'd be happy to help out. |
Hi @radium-v, For test discussions I opened this issue : #8 At this point it is not the work itself that is the issue, but rather knowing that is correct and doesn't introduce regressions in existing features. So having another extensions that we could adapt bits from does help at some level but it doesn't unblock this work. |
I saw the issues holding back adding CSS Nesting in VSCode so I created the CSS Nesting Syntax Highlighting extension which can be used until it's natively available. We can merge the extension code into vscode-css after testing. I also added syntax highlighting for GitHub Repo When I have more time, I'll run the tests mentioned in #8 and submit PRs if the maintainers like added grammar. |
with container queries and nesting now in all browsers - is it possible to get some urgency on implementing this? CSS highlighting is kind of broken in VS code right now |
Maybe interesting to make this a community funded effort? I (and maybe others?) could do this work but it is too large to do in my free time in between 9 to 5, doing dishes, ... Having funding would allow me to work on this on the job. Having good native editor support for CSS is really important for the web, all frontend developers and also has tremendous value for Microsoft as a selling point for VSCode. I could setup a sponsoring goal on the CSSTools org to gather funds if people are interested in this? |
I'm currently working on a variant extension called Better CSS, but it's in very early stages (so far at-rules are the only things implemented). |
@radium-v It would be nice to see something like this integrated into VSCode itself. Ideally users shouldn't need to install an extra extension to be able to write more modern standard CSS :) Is this something you think that could be back ported into this package? |
#8 and #23 would go a very long way towards accelerating development here. I've looked at side-porting to get features in here but this grammar file is written in CSON which makes it difficult to contribute. This is why I'm rewriting it as a standalone extension in my personal time. (For what it's worth, vscode's built-in Less syntax highlighting is now using Better Less, and nested declarations were one of the main reasons why I wrote Better Less in the first place.) |
I submitted a PR that should close this issue (#30). I currently have limited time, so if anyone else wants to test the updated |
Thank you for this effort @jacobcassidy 🎉
As I've already mentioned here, there currently isn't any test suite for this repo. Mutating this repo without first investing in a test suite seems like a bad idea imho. Fixing tests first and then making changes seems like a more sustainable path forwards.
@radium-v If you can use any help with this? |
@romainmenke Agreed, a test suite would be ideal moving forward. |
@romainmenke @jacobcassidy Yes adding tests is ideal, however leaving this in its current broken state seems unreasonable. |
@romainmenke Do you have an example of another grammar that has a test suite? How big of a task is it? Really want this highlighting to be in VS Code |
@wesbos |
Microsoft devs provided some info here: #8 (comment) This is a large task, will take dozens of hours. If there is funding for such an effort then this would be just work 😛 |
Okay so if I understand properly, what needs to happen:
Then running the colorizer tests generates a result snapshot thats available here: https://github.com/microsoft/vscode/blob/main/extensions/vscode-colorize-tests/test/colorize-results/test_css.json The test only checks that things haven't changed. so theoretically we should just be able to add the new code, run the test, and show that only the new grammars have changed / been added? |
Unsure. My focus has been on these tests: https://github.com/microsoft/vscode-css/blob/main/spec/css-spec.coffee I don't know if those colorizer tests have sufficient coverage. |
I think the idea with the colorizer tests is that it ensures nothing changes from what it's at right now - so I'd say thats probably good enough if that is what they have been using so far? |
I don't think those are anywhere close to full coverage :/ Obviously missing aspects are:
This is clearly something a lot of people want to see resolved. I really want to avoid causing regressions for the vast majority of CSS authors who don't even use nesting today. Fixing the tests is doable, adding support for nesting is also doable. Is there anyone willing to volunteer time fixing the tests? |
Given that no one seems interested in doing the work, I've taken time off to get this unblocked. I've spend about 4 hours on this so far, which corresponds to roughly €400 in lost wages. |
@romainmenke I found your GitHub sponsors page and chipped in $200 USD. I encourage other folks to do the same. https://github.com/sponsors/romainmenke Thanks for contributing to this! 💙 |
Thank you so much @claviska for giving back 🙇 |
Awesome thank you @romainmenke - Syntax just sponsored $400 towards your work. Will see if I can bug some other people/projects as well! |
@romainmenke Donated $500 from Tailwind CSS too, thanks for all your work! |
Thank you @wesbos and @adamwathan for those extremely generous contributions! |
At this time nested CSS is not support because at rule and selector patterns aren't included in rules.
The text was updated successfully, but these errors were encountered: