Preference Enum Not Resolved

I’ve seen other reports of issues with resolvers in Nova 9, and I’m wondering if there’s also an issue with enum preferences using a “resolve” command.

I registered a command, and verified it is registered by invoking it with nova.commands.invoke() within exports.activate(). The initial (test) command looks like this:

nova.commands.register("my-extension.sourceCommand", (_workspace) => {
  console.log("command triggered");
  return [
    [null, "Skip"],
    ["one", "Option 1"],
    ["two", "Option 2"],
  ];
});

I used the command for an enum preference like so:

"config": [
  {
    "key": "my-account.my-extension.source",
    "title": "Source",
    "type": "enum",
    "resolve": "my-extension.sourceCommand"
  }
]

The command is never called, and in Preferences, the enum only shows “None”, even after repeated clicks of the refresh button. Is this a bug, or did I miss some necessary configuration?

I’ve only ever got resolvers to work in the workspace config, not in the extension config, even with an extension that is supposed to always load.

Thanks for letting me know! That’s a bummer, as the idea I’m chasing down only makes sense as a global configuration.

A command (button) preference also appears to hang when clicked. I’m getting the sense we don’t get to do anything dynamic with global extension preferences…

I’m getting the sense we don’t get to do anything dynamic with global extension preferences…

This is true. However, it should be disallowing these types in the global preferences. I’ll make a note to fix this soon.

This is because, for global preferences, there is no extension runtime—runtimes are only in the scope of a project window (which may not be open). We’ve considered starting a “fake” runtime in the scope of this in the past, but have never built that out. For the time being, enum resolution and command types in the global extension preferences are not supported.

1 Like