zed icon indicating copy to clipboard operation
zed copied to clipboard

SCSS support

Open JosephTLyons opened this issue 3 years ago • 15 comments

JosephTLyons avatar Jun 20 '22 22:06 JosephTLyons

I'd love some scss syntax highlighting, I'm assuming that's what's meant by support but wanted to clarify incase that wasn't clear.

jamesdbruner avatar Jul 16 '22 16:07 jamesdbruner

We hope that CSS and SCSS will be supported.

Atelier-Mirai avatar Sep 27 '22 14:09 Atelier-Mirai

CSS support will land in Zed v0.59. I'm just going to change the title of this issue to focus on SCSS, so folks who are waiting on SCSS can continue to subscribe here.

maxbrunsfeld avatar Oct 07 '22 21:10 maxbrunsfeld

I am using 0.8.x v and css seems to be available on the level of treesitter not langserver what is sort of show stopper.

guttenbergovitz avatar Jun 11 '23 18:06 guttenbergovitz

I implemented most of this, but killed the PR since the tree-sitter grammar is filled with errors. Either we or someone else will need to work through updating the grammar before we can ship this.

https://github.com/serenadeai/tree-sitter-scss

I only got about 1/8th of the way through testing the examples in the SCSS docs before it was obvious upstream changes to the grammar will be needed.

If anyone wants to pick that up here were my notes so far.

Fix:
- The sibling selector `~` causes an ERROR
- Can't interpolate property names with `-`/`-#{$prefix}` (ERROR)
- Custom property names aren't marked with `function_name` or similar to allow correct styling.

Nice to have:
- support doc comments (///) (should be `doc_comment`

Otherwise I'll pick this back up after a few of the ones with accurate grammars are finished.

iamnbutler avatar Jul 13 '23 23:07 iamnbutler

Hi, i would like to as if the SCSS support was added, i am on version 0.120.6.

Orange4Broom avatar Feb 06 '24 01:02 Orange4Broom

Is there no way to use CSS language for .scss files?

I can't find how to do that on the config docs or Github search

  • https://zed.dev/docs/configuring-zed
  • https://github.com/search?q=repo%3Azed-industries%2Fzed+extension+overwrite&type=issues

gianpaj avatar Feb 15 '24 10:02 gianpaj

Throwing my voice here as well. I really want to switch to zed but this lack of scss syntax highlighting is stopping me. Almost all the projects I touch have it at work. Checking last years surveys it does appear to me the most popular preprocessor

https://2023.stateofcss.com/en-US/other-tools/#pre_post_processors

Might be worth making this a thing to grab folks like me as users. Granted, im sure there are lots of examples blocking people from trying zed out as a daily driver.

If I find time I will start attacking some issues. @iamnbutler Would you be willing to file github issues for what you found in your notes on the upstream with the specific examples you produced the errors with? Or even just a link to the docs.

WMcKibbin avatar Feb 26 '24 16:02 WMcKibbin

SCSS syntax highlighting is the last thing preventing me from switching to Zed too @WMcKibbin. I have put together the following PR to default SCSS to CSS whilst full support is pending, which is being reviewed by the Zed team.

https://github.com/zed-industries/zed/pull/7789

Hopefully, this or full support will be added soon 🙏

samlogan avatar Mar 02 '24 00:03 samlogan

I have a branch with SCSS support (https://github.com/xfer/zed/tree/feature/scss), but some code is based on nvim-treesitter and I'm not sure about licensing (nvim-treesiter is Apache 2 and Zed is triple licensed).

xfer avatar Mar 11 '24 12:03 xfer

this and the icons

scr2em avatar Mar 28 '24 09:03 scr2em

EDIT: there is a SCSS extension you can download now:

image

https://github.com/bajrangCoder/zed-scss


Thanks to this PR https://github.com/zed-industries/zed/pull/9290, you can add this to your settings.json file 🎉

"file_types": {
  "CSS": ["scss"]
}

From Zed version 0.128.3 https://zed.dev/releases/stable

At least we have a workaround until full SCSS support 🙂

gianpaj avatar Mar 29 '24 19:03 gianpaj

I don't know anything about tree sitter, but I did stumble across this, is it better than the other grammar? https://github.com/tree-sitter-grammars/tree-sitter-scss

bryanbuchanan avatar Apr 25 '24 20:04 bryanbuchanan

I don't know anything about tree sitter, but I did stumble across this, is it better than the other grammar? https://github.com/tree-sitter-grammars/tree-sitter-scss

This looks promising, but I wonder how stable/mature it is as a project given that the repo is only 3 weeks old and has just 3 commits.

ollietreend avatar Apr 26 '24 15:04 ollietreend

I don't know anything about tree sitter, but I did stumble across this, is it better than the other grammar? https://github.com/tree-sitter-grammars/tree-sitter-scss

This looks promising, but I wonder how stable/mature it is as a project given that the repo is only 3 weeks old and has just 3 commits.

The author's hobby seems to be contributing to tree sitter grammers, so I think that's pretty telling

abejfehr avatar Apr 27 '24 21:04 abejfehr

Since we now have the SCSS extension in our store, I think we can close this issue out.

SCR-20240501-oefp

JosephTLyons avatar May 01 '24 20:05 JosephTLyons

Since we now have the SCSS extension in our store, I think we can close this issue out.

Sadly though, auto complete / suggestions don't work with it.

marcolaux avatar May 12 '24 15:05 marcolaux

Since we now have the SCSS extension in our store, I think we can close this issue out.

Sadly though, auto complete / suggestions don't work with it.

@marcolaux FYI: This problem ist now fixed. The SCSS extension now provides an language server for completion and suggestions.

jk-propeller avatar May 23 '24 13:05 jk-propeller

Since we now have the SCSS extension in our store, I think we can close this issue out.

Sadly though, auto complete / suggestions don't work with it.

@marcolaux FYI: This problem ist now fixed. The SCSS extension now provides an language server for completion and suggestions.

It doesn't support things like @include or SASS / SCSS specific things it seems.

Also no suggestions from previously imported scss files.

marcolaux avatar May 24 '24 09:05 marcolaux