grass icon indicating copy to clipboard operation
grass copied to clipboard

Any plan to add load_paths support when import path with `css`, `scss`, `sass` file extensions

Open lonelyhentxi opened this issue 1 year ago • 1 comments

I really like your grass project, I have previously used this library for some of my command line tools that deal with scss, with good results. In my recent project, I have some dependent code that uses @import "theme.scss" or @import "theme" to import scss files under load_paths.

However, when I try to use grass, I find that the former always fails to import.

I browsed through the source code and found that find_import function handles paths with scss, sass, css file extensions differently than paths without extensions, and that the former one does not attempt to use load_paths in the current version and has been marked as a TODO.

https://github.com/connorskees/grass/blob/f7f620e44d8655aac3514677f2d2dc6974f9d918/crates/compiler/src/evaluate/visitor.rs#L836C35-L836C35

// todo: consider load paths

Are there any plans to add this feature in the near future?

lonelyhentxi avatar Nov 23 '23 15:11 lonelyhentxi

Ah, thank you for mentioning that todo. I'm surprised it's still around. I am currently interviewing and travelling, but I will have time to take a look at this in mid December. It should be fairly straightforward, but there are probably a few interesting test cases to write.

connorskees avatar Nov 24 '23 09:11 connorskees