-
Notifications
You must be signed in to change notification settings - Fork 464
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
sass_compiler_get_last_import() does not provide previous path #1035
Comments
The If I'm understanding you correctly, you are using the data compiler. When using the data compiler, the Here's code thats used with the file and data compiler, if that helps: https://github.com/wellington/wellington/blob/master/context/importer.go#L9 data compiler file compiler |
my importer function currently doesn't do more than log its input and return
The source I pass to the
The generated content is correct:
My importer looks as follows: struct Sass_Import** sass_importer_emscripten(const char* cur_path, Sass_Importer_Entry cb, struct Sass_Compiler* comp) {
struct Sass_Import* previous = sass_compiler_get_last_import(comp);
const char* prev_path = sass_import_get_path(previous);
const char* prev_base = sass_import_get_base(previous);
consoleLog(strdup("path"), strdup(cur_path));
consoleLog(strdup("prev.path"), strdup(prev_path ? prev_path : "-nullprt-"));
consoleLog(strdup("prev.base"), strdup(prev_base ? prev_base : "-nullprt-"));
return NULL;
} The expected log output:
The actual result:
|
for what its worth, I'm getting the same output when using |
Thanks for adding your input, that helps me figure out a lot! Which compiler are you using? I assume when you say you're switching Context objects, you're also using the appropriate compiler. I modified my importer to do the same prints as yours.
As you can see I never get empty strings or null pointers, always file path or stdin. Which commit hash of libsass are you on? I'm using d215db5 |
There is an issue with |
I checked with 3.2.0-beta.4 and fd7f20fa (most recent master at the time of writing).
I don't understand the question. Is there more than one? I'm using the C-API and after configuring the options I call The way I use libsass (without the modifications for the beta.4 importer) can be observed here. Should I be doing something different? |
OK, I can confirm that this is a bug if you use |
Ahh! This makes more sense now. |
Yay! for the issue being spotted! 😎 🎉 |
I'm trying to upgrade to
3.2.0-beta.4
following the notes in #1000.The old way:
The new way:
The problem here is that
prev_path
always is an empty string (andsass_import_get_base(previous)
is nullptr). I'm running a withSass_Data_Context
if that makes any difference. Having thesass_importer
returnNULL
will load the proper file. What am I missing?The text was updated successfully, but these errors were encountered: