Bogdan-Lyashenko / codecrumbs

Learn, design or document codebase by putting breadcrumbs in source code. Live updates, multi-language support and more.
https://codecrumbs.io
BSD 3-Clause "New" or "Revised" License
2.71k stars 101 forks source link

fix(#3): support consecutive codecrumbs #11

Closed andrewmherren closed 5 years ago

andrewmherren commented 5 years ago

@Bogdan-Lyashenko When I took a look, I saw there was a previous ToDo comment about AST containing a comment property. After investigating that it seems to handle the consecutive comment/crumb issue well.

As a result, I removed babelTraverse and instead applied the existing foreach to the ast.comments object.

Definitely open to suggestions and feedback you have. Thanks!

Bogdan-Lyashenko commented 5 years ago

@andrewmherren, ow yeah, that's good thinking! I needed to remove that traverse a long time ago :D Change looks OKeish, I maybe would replace .forEach with combining .filter and .map, since now it's doable, but it's not critical. My approach is 'make the code work -> make the code fast -> make the code nice', and thus I am on 'make it work' phase now - I will merge it :)