jon-heard / obsidian-inline-scripts

Obsidian plugin: Type text shortcuts that expand into javascript generated text.
MIT License
129 stars 4 forks source link

Warnings when there are no shortcuts configured in Settings #84

Open technicalpickles opened 10 months ago

technicalpickles commented 10 months ago

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:

https://github.com/jon-heard/obsidian-inline-scripts/blob/acd25b6009232ac15f4df22582d127bf165e417b/src/ui_setting_shortcuts.ts#L49-L60

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.