Suggestion: Require Separate Workspace for Testing Extension

When developing an extension, Nova lets you test the extension in the same project in which you edit it, and this is problematic:

Nova will reload your extension whenever you save a file, regardless of whether it is relevant to the extension. Naturally, you might create a test file to test your extension in the same project. Now let’s say you want to test an IssueAssistant that triggers on onSave, or really anything that gets triggered by saving a file. You edit your test file, save it and expect your code to run, but instead Nova unloads and then reloads your extension, which will reset your extension’s data, abort any Process you started, and so on. You will get no diagnostic information whatsoever of this happening. Not even the extension’s deactivate function is called.

I wasted hours on figuring this out. And it seems I am not the only one: This thread is very likely to have the same root cause.

I think it would be a good thing for Nova to require a separate workspace to test an extension, so that no-one else runs into this trap.

1 Like

Depending on the purpose of your extension, configuring an activation condition could prevent it from running in your extension workspace. This setting would also benefit your target users by not unnecessarily using resources on their machines if your extension isn’t needed.

Otherwise, a feature discussed in this topic sounds like it could resolve the issue you’re experiencing. The idea is that you’d be able to toggle whether file changes cause the extension to reload. I’m a fan of this approach myself. :wink:

What I am suggesting is to make it impossible to have this problem, by requiring a different workspace for testing the extension.

What you are suggesting are workarounds the extension author needs to know about to apply them, meaning that someone not aware of this will still run into the trap.

I am not requesting this for myself since I have adopted the separate workspace into my workflow and therefore will never have this problem again; this is purely a suggestion to make it easier for newcomers.