You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Need to call walker.start() for tree.walk() not documented except in example #1588
OS/version/architecture: gLinux 64-bit (Google-internal, like Debian Testing)
Applicable nodegit version: v0.23.0 built from source
https://www.nodegit.org/api/tree/ has an example of how to use tree.walk(), but it doesn't mention a critical detail, which is mentioned in an example:
It took me quite a while to work out what the problem was, looking at the EventEmitter documentation would not have helped. I'm not sure if subclassing from EventEmitter is a good idea, but having a TreeWalker class where the this is documented would have made it easier to discover.
I ran into this as well. I want to add a couple of specific points:
The doc comment claims that walk returns an EventEmitter but the returned object actually has an extra method (start) that EventEmitters don't have.
Similarly, the TypeScript type definition file indicates that walk returns an EventEmitter so you get a compiler error when attempting to call start.
Here are specific suggestions for improvement:
In the walk documentation, tell people to call start.
Create a new type called TreeWalkerEventEmitter which is just like EventEmitter but it has an additional start method. Include this type in the nodegit documentation and add this type to the TypeScript type definition file.
Activity
rigdern commentedon Dec 1, 2018
I ran into this as well. I want to add a couple of specific points:
walkreturns anEventEmitterbut the returned object actually has an extra method (start) thatEventEmittersdon't have.walkreturns anEventEmitterso you get a compiler error when attempting to callstart.Here are specific suggestions for improvement:
walkdocumentation, tell people to callstart.TreeWalkerEventEmitterwhich is just likeEventEmitterbut it has an additionalstartmethod. Include this type in the nodegit documentation and add this type to the TypeScript type definition file.billytrend commentedon May 23, 2019
I have attempted to address the issues in the referenced PRs. Please let me know if you have any further suggestions for the changes.
jawadshiekh commentedon Apr 12, 2023
I want to contribute on this, can you explain issue in more detail, I am freshy