SublimeText / Sass

Sass and SCSS syntax for Sublime Text
https://packagecontrol.io/packages/Sass
MIT License
50 stars 8 forks source link

Support new module system keywords #61

Closed willrowe closed 4 years ago

willrowe commented 4 years ago

Support for the new keywords like @use and @forward introduced along with the new module system would be great.

braver commented 4 years ago

Thanks for the heads up!

dvlden commented 4 years ago

Hello, any progress on this?

braver commented 4 years ago

I must say I have not looked into it yet.

dvlden commented 4 years ago

How many coffees would be needed to get this done? (and what is the price of the coffee in your area)

braver commented 4 years ago

LOL. I haven’t gone out for coffee in ages thanks to 🦠. I tend to use beans from a local roaster, they charge about €7 a bag (1/4 kilo). So a couple of cents per cup 😄

What I really need is some days off so I can get around to some chores that are piling up. This thing here probably is quite easy so I bet this or next week depending on the weather.

dvlden commented 4 years ago

Ah, right... I see. Appears that your "fund" is a PayPal Pool, which I have no clues about, but it's not available in Serbia. Is there a link where I can throw some cash directly to your PayPal, just so that you don't forget about this little issue...

Waiting for your reply.

braver commented 4 years ago

I think maybe you can use this link to make a payment, but it probably requires a PayPal account: https://www.paypal.me/koenlageveen

Beyond that is too much trouble probably. I appreciate the gesture and will definitely get around to this very soon.

dvlden commented 4 years ago

Thanks for the link. Just sent some money to support this feature development. I badly need it, as the current syntax highlighting is not good at all.

Highly appreciate your work!

Screenshot 2020-07-13 at 18 51 58 Screenshot 2020-07-13 at 18 51 52
braver commented 4 years ago

Ok, so I made a start. I need to run through the syntax specs for more details and maybe polish up some scope names, but it should already be better. If you want you can already try the laster master of this package, I'd love to get some feedback as I've yet to switch my projects over to the module system (I want to badly though! it looks really useful).

dvlden commented 4 years ago

@braver Why did you send me $2? 🤔 I just tried and it appears to be working only for @use, including @use '...' with ().

Providing some screenshots as samples, it doesn't work in most cases.

Screenshot 2020-07-14 at 14 03 28 Screenshot 2020-07-14 at 14 00 43
braver commented 4 years ago

Why did you send me $2?

I don't believe I did. I did notice PayPal held back some for service costs or something, maybe they refunded you something?

Thanks a lot for those test cases, that clears up some of the questions I had. I'll go through the docs some more and iron out those kinks.

braver commented 4 years ago

Alright, pushed some tweaks, try that on for a size!

dvlden commented 4 years ago

Ah, my bad. It was $2 donation from someone, I thought I saw your name. Wow, it appears that everything is working great right now.

I'll try to get some more examples and make it fail somewhere. Thanks a lot for working on this!

braver commented 4 years ago

Yeah, I expect it to be pretty solid already. None of the existing tests fail and I think I covered all the cases I could find the documentation. If you find anything, let me know. For now, I'll consider this solved and will close this issue and build a release.

Thanks for the help!

willrowe commented 4 years ago

Looks good to me, seems to be handling some pretty complex files perfectly. I will submit an issue if I find any bugs after working with it for a bit.

Thank you so much for the updates @braver!

braver commented 4 years ago

@dvlden @willrowe maybe you guys know this from practice: is it possible to combine as with with()?

dvlden commented 4 years ago

@braver nice find... I've been debugging a lot and couldn't find any issues, but this seems to be one. Yeh, it is allowed to do this.

This will not work in Sass Lang, as it is invalid syntax/order.

@use 'differs' with (
  $color: #32d,
) as dfr;

This is the correct order, but syntax highlighting is not working properly.

@use 'differs' as dfr with (
  $color: #32d,
);
Screenshot 2020-07-15 at 16 37 04
willrowe commented 4 years ago

I found the same thing, the as must be before the with.

braver commented 4 years ago

Thanks guys, 2.4.1 out now

dvlden commented 4 years ago

@braver Oops, seems that this now breaks things, instead. I removed the master directory and installed it via package control. Looks like @use '' as xx with (); doesn't end where supposed.

This is what it turns into, everything white, below this syntax. Screenshot 2020-07-15 at 17 07 36

EDIT 1: If I inline it as @use 'differs' as dfr with ($color: #32d); it fixes syntax highlighting below, but still the with is not a different color. Shouldn't it be the same as without as/with?

braver commented 4 years ago

It can take over an hour for package control to pick up the latest release. So probably you were switched back to before this fix. I'd suggest sticking to master for today.

dvlden commented 4 years ago

Yup seems to be the case. Switched back to your master branch. Thanks again for those improvements!