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

Add postcss support, and support vue & svelte <style lang="..."> injections, and highlight svelte block keywords #18052

Closed
wants to merge 8 commits into from

Conversation

AlbertMarashi
Copy link
Contributor

@AlbertMarashi AlbertMarashi commented Sep 19, 2024

Release Notes:

  • Added: treat postcss as a valid extension in the css language
  • Fixed: Svelte <style lang="postcss"> language support
  • Fixed: Svelte {#each ...} {#if ...} expression blocks keyword highlighting
  • Added: Vue SFC <style lang="..."> language injections are now supported

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Sep 19, 2024
@zed-industries-bot
Copy link

zed-industries-bot commented Sep 19, 2024

Messages
📖

This PR includes links to the following GitHub Issues: #18051, #10448, #18033
If this PR aims to close an issue, please include a Closes #ISSUE line at the top of the PR body.

Generated by 🚫 dangerJS against 5d0b503

@AlbertMarashi AlbertMarashi marked this pull request as ready for review September 19, 2024 04:30
@maxdeviant maxdeviant self-assigned this Sep 19, 2024
@@ -1,6 +1,6 @@
name = "CSS"
grammar = "css"
path_suffixes = ["css"]
path_suffixes = ["css", "postcss"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do people actually use .postcss as a file extension?

I've only ever seen it used with .css.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're just adding this to recognize <style lang="postcss"> I think that would be better handled in the injections query itself.

Copy link
Contributor Author

@AlbertMarashi AlbertMarashi Sep 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it is in various other plugins

https://marketplace.visualstudio.com/items?itemName=csstools.postcss

It might even be worth adding pcss but up to you.

My argument in favor is that whilst it is compatible with CSS, tonnes of tooling expects the existence of postcss files, or postcss as a preprocessor directive (which users must use in order to trigger the correct preprocessor in their tooling (ie, svelte, vue).

Therefore it is reasonable to add it as a path stuffix

@AlbertMarashi

This comment was marked as spam.

@AlbertMarashi
Copy link
Contributor Author

@maxdeviant sorry if that was spam, but I'm just trying to get this merged as there is still an outstanding issue that a user was having due to this - and I think the PR is ready to merge

@maxdeviant
Copy link
Member

Splitting this PR into more focused ones:

@maxdeviant maxdeviant closed this Oct 18, 2024
maxdeviant added a commit that referenced this pull request Oct 18, 2024
This PR adjusts the highlights for `{#each ...}` and `{#if ...}`
expression blocks to use keyword highlighting.

Extracted from #18052.

Release Notes:

- N/A

Co-authored-by: Albert Marashi <[email protected]>
maxdeviant added a commit that referenced this pull request Oct 18, 2024
This PR adds support for injecting languages into `<style>` tags using
`<style lang="...">` in Vue.

Extracted from #18052.

Release Notes:

- N/A

Co-authored-by: Albert Marashi <[email protected]>
maxdeviant added a commit to zed-extensions/svelte that referenced this pull request Oct 18, 2024
This PR adjusts the highlights for `{#each ...}` and `{#if ...}`
expression blocks to use keyword highlighting.

Extracted from zed-industries/zed#18052.

Release Notes:

- N/A

Co-authored-by: Albert Marashi <[email protected]>
maxdeviant added a commit to zed-extensions/vue that referenced this pull request Oct 18, 2024
…ed#19419)

This PR adds support for injecting languages into `<style>` tags using
`<style lang="...">` in Vue.

Extracted from zed-industries/zed#18052.

Release Notes:

- N/A

Co-authored-by: Albert Marashi <[email protected]>
mikayla-maki pushed a commit that referenced this pull request Oct 18, 2024
This PR adjusts the highlights for `{#each ...}` and `{#if ...}`
expression blocks to use keyword highlighting.

Extracted from #18052.

Release Notes:

- N/A

Co-authored-by: Albert Marashi <[email protected]>
mikayla-maki pushed a commit that referenced this pull request Oct 18, 2024
This PR adds support for injecting languages into `<style>` tags using
`<style lang="...">` in Vue.

Extracted from #18052.

Release Notes:

- N/A

Co-authored-by: Albert Marashi <[email protected]>
@AlbertMarashi
Copy link
Contributor Author

Thanks @maxdeviant

noaccOS pushed a commit to noaccOS/zed that referenced this pull request Oct 19, 2024
This PR adjusts the highlights for `{#each ...}` and `{#if ...}`
expression blocks to use keyword highlighting.

Extracted from zed-industries#18052.

Release Notes:

- N/A

Co-authored-by: Albert Marashi <[email protected]>
noaccOS pushed a commit to noaccOS/zed that referenced this pull request Oct 19, 2024
…ies#19419)

This PR adds support for injecting languages into `<style>` tags using
`<style lang="...">` in Vue.

Extracted from zed-industries#18052.

Release Notes:

- N/A

Co-authored-by: Albert Marashi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
3 participants