Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Problem with Project.getAllFiles #7073

Closed
fdecampredon opened this issue Mar 4, 2014 · 5 comments
Closed

Problem with Project.getAllFiles #7073

fdecampredon opened this issue Mar 4, 2014 · 5 comments
Assignees

Comments

@fdecampredon
Copy link

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
@sprintr
Copy link
Contributor

sprintr commented Mar 4, 2014

Have you tried this way

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

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

@fdecampredon
Copy link
Author

The getAllFiles() is already called from an appReady callback

@peterflynn
Copy link
Member

@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?

@peterflynn peterflynn self-assigned this Mar 4, 2014
@fdecampredon
Copy link
Author

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

_getAllFilesCache().done(function (result) {

@njx
Copy link
Contributor

njx commented Mar 12, 2014

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants