Skip to content
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

Consider adopting a new CSS syntax highlighting grammar #169873

Closed
BenjaminAster opened this issue Dec 22, 2022 · 13 comments
Closed

Consider adopting a new CSS syntax highlighting grammar #169873

BenjaminAster opened this issue Dec 22, 2022 · 13 comments
Assignees
Labels
feature-request Request for new features or functionality grammar Syntax highlighting grammar

Comments

@BenjaminAster
Copy link

BenjaminAster commented Dec 22, 2022

When authoring multiline CSS strings, e.g.

.foo::after {
	content: "Hello \
world!";
}

VSCode's syntax highlighter messes up pretty badly. Here is a real-world example of using a multiline CSS string in a data URL to create a mask for random noise:
image
Notice how all code after the multiline string is highlighted in yellow.

This issue has already been reported multiple times (#125739, #134642, #146146, #147712, #159730), but all of them have been closed as a duplicate of atom/language-css#181, which through the sunset of Atom has now been closed and archived, too. Creating multiline strings makes things a lot more readable when creating inline SVGs for background images and masks, and currently they are practically unusable in VSCode. I would be greatful if you could prioritize this, especially since I do not believe it to be a very difficult bug to fix.

Tested in VSCode version 1.74.2 (stable) and 1.75.0-insider (pre-release).

@BenjaminAster BenjaminAster changed the title CSS multiline strings don't work, _revisited_ CSS multiline strings don't work, revisited Dec 22, 2022
@aeschli aeschli assigned alexr00 and unassigned aeschli Dec 23, 2022
@alexr00 alexr00 changed the title CSS multiline strings don't work, revisited Consider adopting a new CSS syntax highlighting grammar Dec 23, 2022
@alexr00
Copy link
Member

alexr00 commented Dec 23, 2022

Since the upstream repo has been archived I've repurposed this issue into adopting a new CSS grammar.

@alexr00
Copy link
Member

alexr00 commented Jan 11, 2023

For folks who are interested in contributing to the CSS grammar: we have adopted new grammars for other languages in the past. The usual formula for adoption is:

  • Someone makes an extension that provides a new, better grammar
  • That extension is on the marketplace for a while and get some use from real users
  • The owner of that extension shows that they will keep improving the grammar during that time
  • Someone lets me know about or I go find the new grammar and pull it into VS Code early in one of our development cycles (shortly after release).
  • We watch for major issues in VS Code insiders for a month
  • New grammar is shipped with VS Code.

@romainmenke
Copy link

romainmenke commented Jan 11, 2023

@alexr00 I am unsure why I would go through the trouble of making an entirely new grammar for CSS, struggle to gain adoption just to have VSCode swoop in when it reaches critical mass?

Why can't we do this effort in collaboration within VSCode from the start?
I am happy to contribute in a technical capacity but I have zero interest in doing all the other critical parts to make a 3rd party extension successful.


Also important to note that this is a self inflicted issue.
Both VSCode and Atom ultimately have the same parent org.

Forking the Atom css language to the microsoft organization on GitHub seems like the least effort and lowest risk way forward.

@alexr00
Copy link
Member

alexr00 commented Jan 11, 2023

Once something is maintained by the VS Code team then we have to keep maintaining it. At this time we don't have a developer dedicated to maintaining a CSS grammar, which is why we rely on the community.

@romainmenke
Copy link

then we have to keep maintaining it.

which is why we rely on the community

But in practice this will most likely be a single individual right?
And that single individual would also have to keep maintaining it, but with fewer resources.
How do we make sure that this is sustainable and that it is a good long term solution?

It is also just an impossibly small group of people who fit these characteristics :

  • has the required knowledge about CSS
  • has the required knowledge about grammars for VS Code
  • has spare capacity for yet another project

Are there volunteers in the VS Code team to help out on a 3rd party package with aspects that do not require in depth knowledge about CSS?

  • triaging issues
  • writing tests
  • reviewing code changes
  • ...

@argyleink
Copy link

I figured y'all would take the atom grammars as they are, adopting / forking them, and then y'all become the new canonical reference we submit grammar updates to. That's why I made a couple PRs to here, seems the easiest route is y'all to pick up the reigns where they got dropped?

I'm with Romain here, waiting for some new community driven one is too much work on that maintainer. There's a perfectly good foundation ready to not be an upstream anymore.

@alexr00
Copy link
Member

alexr00 commented Jan 12, 2023

  • has the required knowledge about CSS
  • has the required knowledge about grammars for VS Code
  • has spare capacity for yet another project
    ...
  • triaging issues
  • writing tests
  • reviewing code changes

With the exception of writing tests (as we do have some basic grammar tests to keep our grammar integration healthy) these needs are all same reasons that the VS Code team doesn't want to own the grammars. We know maintaining a grammar can be a lot of work and we greatly appreciated all the work that folks do on the OSS projects we depend on for our grammars. https://github.com/jeff-hykin/better-cpp-syntax, https://github.com/fadeevab/make.tmbundle, https://github.com/microsoft/TypeScript-TmLanguage, and https://github.com/jeff-hykin/better-shell-syntax to name just a few.

@alexr00
Copy link
Member

alexr00 commented Jan 13, 2023

We tentatively created a new repo for the old atom grammar where we plan to take fixes: https://github.com/microsoft/vscode-css

We're still working out what taking fixes will look like, so any PRs made against that repo may take a while to receive attention.

@romainmenke
Copy link

Thank you so much @alexr00 for considering a different way forward 🎉

@argyleink
Copy link

should i move my PRs (#170782, #170781) to that repo now? or wait a bit?
thanks for considering alternative routes for this ❤️

@alexr00
Copy link
Member

alexr00 commented Jan 17, 2023

@argyleink I would suggest you wait a bit. We don't currently know how we're going to take fixes since we don't have anyone who can review the changes at the moment.

@alexr00
Copy link
Member

alexr00 commented Apr 24, 2023

@argyleink I think we'll soon start merging PRs in https://github.com/microsoft/vscode-css. If you move your PRs there then I will make sure they get reviewed. Thank you for your patience!

@alexr00
Copy link
Member

alexr00 commented Dec 13, 2023

Closing as we have moved the grammar to https://github.com/microsoft/vscode-css

@alexr00 alexr00 modified the milestones: Backlog, December / January 2024 Dec 13, 2023
@alexr00 alexr00 closed this as completed Dec 13, 2023
@alexr00 alexr00 removed this from the December / January 2024 milestone Jan 22, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jan 27, 2024
@aiday-mar aiday-mar added this to the December / January 2024 milestone Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality grammar Syntax highlighting grammar
Projects
None yet
Development

No branches or pull requests

6 participants