-
Notifications
You must be signed in to change notification settings - Fork 463
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
[FR] Expose ParserState
of currently invoked function
#1037
Comments
Technically this translates to beeing able to access the |
ParserState
of currently invoked function
Related: #1227 |
ParserState
of currently invoked functionParserState
of currently invoked function [$100]
This is pretty much possible now, beside fetching line and column numbers! |
We have no plans to further this until we reach Sass compatibility it 3.4. This increases the maintenance surface area and our hands are full atm. |
Some ground work was already done and included in libsass, but not that we could yet craft a good and future proof API (we need to further refactor how we internally account for these states). |
Could it potentially be easier to simply have @warn and @debug handled by Libsass itself, rather than rely on the custom function approach? 99% of people are just going to write functions that log the message, line number and file of these warnings, right? Since there's no real customization to be done, what benefit is there in relying on the custom function approach? Does it maybe just make more sense to have Libsass log the output like it does for any other error? Sent from my iPhone
|
Both warn and debug already take the same path as other custom functions. So no, it would rather be more difficult to handle warn etc. different that other custom functions. Quoting from corresponding node-sass issue: sass/node-sass#895 (comment) The easiest way I currently see is to add a new "import" stub ast node to the ast tree, so we can re-create the actual import stack in the eval phase where custom functions are actually executed. Once that is done, it should be straight forward to implement the rest. Biggest part here is probably to design a forward compatible and future proof C-API. |
This was implemented with #2251 |
@mgreter, this is a huge feature and we can do much on consumer side IMO. Kudus! 🏆 🎉 For node-sass, it would require a non-CAPI implementation via V8/nan wrappers, for which I can spare sometime if no one else is taking it. :) For libsass-net, I will try to take inference with perl-libsass implementation as we did for all the other features in FFI way. @chriseppstein, @darrenkopp, is it a valid option if we have a dontnet bring-up under Sass organization account? If so, on which repo we can further this discussion? This will give the project some boost and comparatively fast updates. Out of interest, I am willing to contribute to keep all projects under organization in sync, with all these kind of awesome auxiliary features Marcel has implementing 😎 |
@am11 fine with me. |
@darrenkopp please join us in Slack https://libsass-slack.herokuapp.com/ |
ParserState
of currently invoked function [$100]ParserState
of currently invoked function [$100 awarded]
ParserState
of currently invoked function [$100 awarded]ParserState
of currently invoked function
As per the discussion that transpired at: sass/node-sass#646 (comment)
As an implementer I want to propagate the contextual information, in particular, the file path, line and column numbers to the end-user so that they know from where the function was called.
The text was updated successfully, but these errors were encountered: