Skip to content

Warnings when there are no shortcuts configured in Settings #84

@technicalpickles

Description

@technicalpickles

I've been working on some scripts, so I've been keeping an eye on the developer console. I've been noticing this output:

Inline Scripts Shortcut-file "settings" has no shortcuts. (Shortcut-files are sectioned with "__")

CleanShot 2023-11-25 at 12 11 28

I thought this might be related to my shortcut file, but clicking through the stack trace, I came to this line:

let defaultShortcuts: Array<any> = ShortcutLoader.parseShortcutFile(
"Settings", DEFAULT_SETTINGS.shortcuts, true, true).shortcuts;
// We don't want to duplicate shortcuts, and it's important to keep
// defaults in-order. Remove any shortcuts from the ui list that are part
// of the defaults before adding the defaults to the end of the ui list.
this.removeShortcutsFromUi(defaultShortcuts);
for (const defaultShortcut of defaultShortcuts)
{
this.addShortcutUi(app, defaultShortcut);
}

It turns out that this happens if I remove all the Shortcuts, ie:

CleanShot 2023-11-25 at 12 13 48

Adding the defaults back 'fixes' the warning. I'm not sure if there is a good way to skip over the shortcuts from the settings file if it's empty, but it would be nice to not have the extra noise while debugging.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions