-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Conversation
The irony is that ViewCommandHandlers.js is the exact file that got all of this work started in the first place :). Have you thought about creating a similar function for Extension developers? It turns out that the 'main' namespace I found came from an extension using mode.id for its client id. I don't know exactly what the format would be. Maybe a function in ExtensionUtils.js called getExtensionClientId() that takes an extension name and/or the extension creator's name and returns a suitable client id for extension preferences. |
Hehe. Well it was a problem of no merge conflicts, last minutes updates and close merge times. That is a nice idea. I would still add it to |
I'm seeing 1 other case outside the src folder in test/spec/SpecRunnerUtils.js. |
The module.id problem with extensions needs to be fixed because the RecentProjects extension is now broken. Instead of passing the module.id to getClientId(), what about passing the module object so getClientId() could detect extensions using module.uri and behave accordingly? If |
Done with initial review. |
|
|
Yes. I was thinking of checking against |
Perfect. Be sure not to use "default", "user", or "dev" in the generated id so an extension will use the same preferences if moved. |
I just made both changes. The client id looks great now for the RecentProjects and other extensions. I notice that there could be one problem, when a user extension folder has the same name as a default/dev extension. But this could be avoided having a notice for Extensions developers to use different names, or some sort of renaming in the new extension manager to avoid collisions. But this seems to be the best solution if an extension is moved from the default folder to the user folder. Travis failed, but I run the tests locally and the all pass. The problem seems to be that it doesn't identify |
This looks good. Just a few comments about code cleanup. Hopefully, the |
@redmunds Fixes done. Is still failing for the same reason. I think is just because Travis runs in the browser and doesn't have access the shell APIs. I was thinking that |
dirPath + "/extensions/default/", | ||
dirPath + "/extensions/dev/", | ||
ExtensionLoader.getUserExtensionPath() + "/" | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The paths Array gets built every time this function is called and it's the same every time. Create a function called something like getExtensionPaths() that builds and returns the array the first time it's called, and simply returns the array on all subsequent calls.
Nice idea, I added that function. I also change |
Everything looks good so far. One minor quirk is that the recent projects list is not getting populated. That does not seem critical, but maybe there's a problem lingering. The Travis problem is due to the fact that Travis can only run headless tests. The preference tests in master are headless, but new dependencies added to PreferenceManager.js require brackets.app APIs, so it needs to be fixed in this pull request. This can be fixed by mocking the brackets.app using something like jasmine spies, but we have not yet done any of that for Travis. If you want to take a look at that, then you'll need to install node and grunt as described here: https://github.com/adobe/brackets/wiki/Grunt-Setup Otherwise, you'll need to remove line 54 from brackets/src/Gruntfile.js that specifies to run PreferencesManager-test.js. |
|
I'll see if I can find a reproducible recipe. I think also disabling After re-enabling
@jasonsanjose Can you comment on item 4 in the latest reply from @TomMalbran ? |
Hey @TomMalbran. I want to help get this landed today so we can land #3097. Will you be online and possibly on IRC? |
For item 4, I think the jasmine grunt task leaves those folders behind when the test fails. |
@jasonsanjose Yes I can. I just Logged in there. And you are right, those files aren't created after the installation as I thought. So I could delete those files then. The |
Filed #3170. @TomMalbran will disable the tests for now until we can properly mock the required shell APIs. |
@redmunds @jasonsanjose Done! And it finally works :) |
Thanks @jasonsanjose and @TomMalbran . Merging. |
Preferences ID cleanups - Part II
I checked the code after #3018 and I noticed that
ViewCommandHandlers.js
wasn't using the latestgetClientId
function, probably because the latest changes on both where merged close in time, and thatUpdateNotification.js
was still using the old id.