coreh-deprecated / nide

Beautiful IDE for Node.js
http://coreh.github.com/nide/
712 stars 111 forks source link

Fixed directory structure being sent before being fully built on opening a project #63

Open notatestuser opened 11 years ago

notatestuser commented 11 years ago

Kudos for the great work on this project, I'm really impressed. However, there was one little issue that cropped up after I decided to add another structural level to my project, which looked something like so:

./package.json ./responses/file1.json ./responses/file2.json

Simple! The issue was that upon loading the project (by running the 'nide' command in the root directory), the 'responses' directory had been showing as containing no files (i.e. empty). After a bit of debugging it seemed that adding some logging statements to the code responsible for injecting things into the listCache slowed the execution down enough that the files were visible more often than before when repeatedly starting the IDE. Therefore, and after some further investigation, I figured the object was being sent out too quickly -- before it had actually been constructed.

After this change we're now ensuring that the number of processed files equals the number of 'encountered' files before we proceed to dispatch the listCache off to the client. This is serving as an effective fix to the problem I've been able to replicate locally.