-
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
[WIP] Improves source map generating (map more tokens) #603
Conversation
Brilliant! 👍 Is this addressing #324? |
12e143e
to
7c682a8
Compare
It does not directly adress that issue, but I already changed/fixed some bits there: |
I will test it once this is merged. Is this ready? |
This is actually far from ready ;) I'm currently in the process to get an overall view of the big picture. There are a lot of nitty gritty details, that have to be considered! Once I get this done, I hopefully can decide on a clean design to have this correctly implemented! The ETA for this WIP is "some day in the future" ;) I mainly did this PR to make my current work transparent to others. |
Bundle of thanks @mgreter. This work is priceless! 👍 Let me know, if you need my help.. (-8 |
I think we need to add some way to make this a collaborating effort ultimately, since it is basically impossible for me to test all variations myself. It boils down to have something like the sass-spec test suite, but for source mappings. It also is more complex than one might think in the first place. The first findings that I'm pretty sure needs to be adressed, is which informations are stored for Unfortunately this already gets very verbose in term of code lines added. So I probably have to add some more middleware to get rid of this (which is what I meant by "getting a view of the big picture"). I will try to keep https://github.com/sass/libsass/wiki/Source-Map-Internals updated with my latest findings, but I probably won't have much time to work on this the next weeks! |
Used to generate mapping for source maps. Conflicts: .travis.yml Makefile Makefile.am ast.hpp eval.cpp extend.cpp parser.cpp script/cibuild script/install-compiler
Currently used to identify who rendered a mapping. Conflicts: .travis.yml ast.hpp
Conflicts: parser.cpp
Conflicts: ast.hpp parser.cpp
``` foo($bar...); ``` Will flag `$bar` as a variable arg when in fact it may be a keyword arg. We can only be sure once `$bar` has been evaluated. If `$bar` is evaluated to a map then it's a keyword argument and the Argument object needs to be updated accordingly. Conflicts: eval.cpp
3096d50
to
af98e89
Compare
I'm making some progress here. Had to add some status information to AST_Nodes just for debugging (can probably be removed once I figured out how exactly I want to add the mappings). Currently I'm figuring out how libsass generates it's output to get an idea how I could appropriately implement it cleanly. For this I'm using a perl module I had laying around to read the source-map json and generate some debug information. This is what it currently produces: SCSS Input
CSS Input
Source Map Debug
There are still a lot of issues, but IMO it's already a start. Thought I'd share that here :) |
Super fabulous IMO! 👍 Thanks for sharing! :) |
78b925b
to
941ddd6
Compare
941ddd6
to
3666134
Compare
LOL that is funny. 😄 I guess two-tab indentation is a convention in libsass project. |
soft tabbbbbssssss On Tue, Nov 4, 2014 at 5:45 PM, Adeel Mujahid notifications@github.com
|
@mgreter this library has an EditorConfig file https://github.com/sass/libsass/blob/master/.editorconfig |
@mgreter, would this be merged before libsass vNext is out? |
No, sorry, I really don't think so. This needs a lot more work! |
I have a second WIP branch which tackles this problems from another side. That Branch already seems to produce better results than the current implementation, but it needs a lot more re-factoring and better testing (which I have started with the help of |
Closing in favor of #792! |
This PR adds more mappings to the source map.
It seems reasonable to map all kind of tokens back to the original source!
Will create more sophisticated unit tests for
perl-libsass
(usingOCBNET::SourceMap
).Already started to document my findings about source map internals in a wiki page