atom / highlights

Syntax highlighter
https://atom.github.io/highlights
MIT License
530 stars 54 forks source link

adds support for async highlighting #25

Closed soldair closed 8 years ago

soldair commented 8 years ago

Adds the async complimentary methods to loading and highlighting.

Most importantly this stops the event loop lag from fs actions when using this module in a server environment. this allows you to instantiate new highlights objects after the server is started for the same reason. In marky-markdown i counted hundreds of ms to instantiate a new highlights which otherwise is not something that can be run after your server starts responding to requests.

im not a coffee script kinda person so please go easy on me as far as the projects coffeescript style. it passed linting =)

happy to update documentation as well after some review on this pr.

soldair commented 8 years ago

I'm integrating this into marky-markdown and giving it some extra testing today as im going to process every readme for every module on npm

soldair commented 8 years ago

a code review would be great. I'm using this branch in a fork in production on github.com/npm/newww. merge or feedback would be greatly appreciated. /cc @kevinsawicki @bcoe

soldair commented 8 years ago

ok rebased, lint fixes applied, and c renamed to "pendingAsyncCalls" for readabillity

soldair commented 8 years ago

this should be good to go. merge??

kevinsawicki commented 8 years ago

Thanks for this, apologies for the delay in merging

kevinsawicki commented 8 years ago

I just published this in 1.3.0 and invited you and @bcoe as collaborators here and npm owners for this library.

Just a heads up, I made a few other formatting tweaks in this commit for things the linter doesn't pick up but we usually standardize on CoffeeScript-wise.

Thanks again for this :+1:

soldair commented 8 years ago

thanks so much! ill note those other formatting standards for next time