Open travs opened 7 years ago
@travs (My knowledge on Atom plugin dev is 0 but) Shouldn't Atom be providing a way to run your plugin in a separate thread? I'm saying this because I think something like that should be possible because not every plugin is suitable for the main thread (use case- some plugin could simply be doing background clean-ups, so it need not be on main thread at all).
On the other hand, I did realise that we'd eventually have to work with parsing asynchronously, but I haven't even started planning that yet so it might take some time (~2 months).
@duaraghav8
Shouldn't Atom be providing a way to run your plugin in a separate thread?
This is certainly a possible solution to my package's problem. I will try to run solium.lint()
in a child process and see what happens.
I haven't even started planning that yet so it might take some time (~2 months)
No problem at all. Once you get it laid out tag me in the issue(s) and I can have a look to see if I can contribute :)
I'm finding that parsing large solidity files (500+ lines) takes a few seconds, which is fine in and of itself. The problem is that it seems to be a blocking function, which is a little bit of a dealbreaker for the solium linter I have written for Atom, since it blocks the UI and makes the editor pane unusable for a few seconds.
I ran a profile, and it looks like the blocking is coming from within the
parse
function insolparse
here. It might specifically be thepeg.js
calls that are blocking, since it looks like that library might not support async, so I'm not sure if simply making thesolparse
parse
function async would fix it.I attached the profile file for the atom linter package, which you can open in chrome I believe.
solium-linter.zip