Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLOSED] Problem with Project.getAllFiles #6403

Open
core-ai-bot opened this issue Aug 30, 2021 · 5 comments
Open

[CLOSED] Problem with Project.getAllFiles #6403

core-ai-bot opened this issue Aug 30, 2021 · 5 comments

Comments

@core-ai-bot
Copy link
Member

Issue by fdecampredon
Tuesday Mar 04, 2014 at 11:11 GMT
Originally opened as adobe/brackets#7073


When I try to use project.getAllFiles on a "big project" (typescript compiler) the promise returned by getAllFiles() never resolve. I use this the #6530 PR code .
I was able to debug a bit and ends up with this error:

TypeError: Cannot read property 'length' of undefined
    at Object.o.Callbacks.k.add [as done] (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:26811)
    at Object.getAllFiles (file:///Applications/Brackets.app/Contents/dev/src/project/ProjectManager.js:1950:29)
    at FileSystem.init (file:///Users/kapit/Library/Application%20Support/Brackets/extensions/user/brackets-typescript/built/main.js:71507:29)
    at new FileSystem (file:///Users/kapit/Library/Application%20Support/Brackets/extensions/user/brackets-typescript/built/main.js:71420:14)
    at initServices (file:///Users/kapit/Library/Application%20Support/Brackets/extensions/user/brackets-typescript/built/main.js:71669:18)
    at init (file:///Users/kapit/Library/Application%20Support/Brackets/extensions/user/brackets-typescript/built/main.js:71651:5)
    at file:///Users/kapit/Library/Application%20Support/Brackets/extensions/user/brackets-typescript/main.js:22:21
    at _callHandler (file:///Applications/Brackets.app/Contents/dev/src/utils/AppInit.js:59:13)
    at Object._dispatchReady (file:///Applications/Brackets.app/Contents/dev/src/utils/AppInit.js:74:13)
    at Object.<anonymous> (file:///Applications/Brackets.app/Contents/dev/src/brackets.js:239:33)
    at o.Callbacks.j (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:26676)
    at Object.o.Callbacks.k.add [as done] (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:26985)
    at Object.o.extend.Deferred.d.always (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:27861)
    at file:///Applications/Brackets.app/Contents/dev/src/brackets.js:237:30
    at o.Callbacks.j (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:26676)
    at Object.o.Callbacks.k.fireWith [as resolveWith] (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:27489)
    at o.extend.Deferred.o.each.e.(anonymous function) (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:28469)
    at file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:28045
    at o.Callbacks.j (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:26676)
    at Object.o.Callbacks.k.fireWith [as resolveWith] (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:27489)
    at o.extend.Deferred.o.each.e.(anonymous function) (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:28469)
    at file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:28045
    at o.Callbacks.j (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:26676)
    at Object.o.Callbacks.k.add [as done] (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:26985)
    at Array.<anonymous> (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:28022)
    at Function.o.extend.each (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:2877)
    at Object.<anonymous> (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:27963)
    at Function.o.extend.Deferred (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:28549)
    at Object.o.extend.Deferred.d.then (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:27940)
    at Object.<anonymous> (file:///Applications/Brackets.app/Contents/dev/src/project/ProjectManager.js:1104:59)
    at o.Callbacks.j (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:26676)
    at Object.o.Callbacks.k.fireWith [as resolveWith] (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:27489)
    at Object.o.extend.Deferred.o.each.e.(anonymous function) (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:28469)
    at Object.<anonymous> (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:28045)
    at o.Callbacks.j (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:26676)
    at Object.o.Callbacks.k.fireWith [as resolveWith] (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:27489)
    at Object.o.extend.Deferred.o.each.e.(anonymous function) [as resolve] (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:28469)
    at _reopenNodes (file:///Applications/Brackets.app/Contents/dev/src/project/ProjectManager.js:455:28)
    at Object.<anonymous> (file:///Applications/Brackets.app/Contents/dev/src/project/ProjectManager.js:481:17)
    at o.Callbacks.j (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:26676)
    at Object.o.Callbacks.k.fireWith [as resolveWith] (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:27489)
    at Object.o.extend.Deferred.o.each.e.(anonymous function) [as resolve] (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:28469)
    at Object.<anonymous> (file:///Applications/Brackets.app/Contents/dev/src/utils/Async.js:118:44)
    at o.Callbacks.j (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:26676)
    at Object.o.Callbacks.k.fireWith [as resolveWith] (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:27489)
    at Object.o.extend.Deferred.o.each.e.(anonymous function) [as resolve] (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:28469)
    at file:///Applications/Brackets.app/Contents/dev/src/project/ProjectManager.js:475:32
    at Object.$.jstree.plugin._fn.open_node (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jstree_pre1.0_fix_1/jquery.jstree.js:653:30)
    at Object.$.jstree.plugin.$.each.$.jstree._fn.(anonymous function) [as open_node] (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jstree_pre1.0_fix_1/jquery.jstree.js:234:19)
    at Object.<anonymous> (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jstree_pre1.0_fix_1/jquery.jstree.js:640:42)
    at Object.<anonymous> (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jstree_pre1.0_fix_1/jquery.jstree.js:1648:165)
    at Object.<anonymous> (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jstree_pre1.0_fix_1/jquery.jstree.js:1704:29)
    at o.extend.proxy.o.isFunction.f (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:3712)
    at processEntries (file:///Applications/Brackets.app/Contents/dev/src/project/ProjectManager.js:811:13)
    at file:///Applications/Brackets.app/Contents/dev/src/project/ProjectManager.js:860:17
    at _applyAllCallbacks (file:///Applications/Brackets.app/Contents/dev/src/filesystem/Directory.js:111:26)
    at Directory.<anonymous> (file:///Applications/Brackets.app/Contents/dev/src/filesystem/Directory.js:204:13)
    at file:///Applications/Brackets.app/Contents/dev/src/filesystem/impls/appshell/AppshellFileSystem.js:280:25
    at file:///Applications/Brackets.app/Contents/dev/src/filesystem/impls/appshell/AppshellFileSystem.js:220:17
@core-ai-bot
Copy link
Member Author

Comment by sprintr
Tuesday Mar 04, 2014 at 12:51 GMT


Have you tried this way

var AppInit = brackets.getModule('utils/AppInit'),
        ProjectManager = brackets.getModule('project/ProjectManager');

        AppInit.appReady(function() {
            console.log(ProjectManager.getAllFiles());
        });

@core-ai-bot
Copy link
Member Author

Comment by fdecampredon
Tuesday Mar 04, 2014 at 12:57 GMT


The getAllFiles() is already called from an appReady callback

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Tuesday Mar 04, 2014 at 18:33 GMT


@fdecampredon What is on ProjectManager line 1950 in your copy of the codebase? That doesn't line up with anything either in Sprint 36 or in master. Do you have any local changes to the Brackets source?

@core-ai-bot
Copy link
Member Author

Comment by fdecampredon
Wednesday Mar 05, 2014 at 07:58 GMT


Like I said I use busykai PR, in this version I have the line :

_getAllFilesCache().done(function (result) {

@core-ai-bot
Copy link
Member Author

Comment by njx
Wednesday Mar 12, 2014 at 18:27 GMT


Hi@fdecampredon - thanks for working on an extension! For issues like this that are only reproducible on an in-progress pull request, we usually just bring them up in that pull request (unless it's for a large long-running feature) instead of tracking it in the issue tracker. It looks like you've already commented on #6530, so please work with@busykai there to resolve the issue. If the issue still persists after #6530 lands, please reopen this issue here. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant