diff --git a/src/platform/settings/settingStore.ts b/src/platform/settings/settingStore.ts index 5a1573efb..6629455f2 100644 --- a/src/platform/settings/settingStore.ts +++ b/src/platform/settings/settingStore.ts @@ -8,6 +8,8 @@ import type { Settings } from '@/schemas/apiSchema' import { api } from '@/scripts/api' import { app } from '@/scripts/app' import type { TreeNode } from '@/types/treeExplorerTypes' +import { processExtensionSettings } from '@/extensions/dispatch' +import { useErrorHandling } from '@/composables/useErrorHandling' export const getSettingInfo = (setting: SettingParams) => { const parts = setting.category || setting.id.split('.') @@ -46,6 +48,14 @@ export const useSettingStore = defineStore('setting', () => { const settingValues = ref>({}) const settingsById = ref>({}) + const { wrapWithErrorHandling } = useErrorHandling() + processExtensionSettings((settings) => { + const _addSetting = wrapWithErrorHandling(addSetting) + for (const setting of settings) { + _addSetting(setting) + } + }) + /** * Check if a setting's value exists, i.e. if the user has set it manually. * @param key - The key of the setting to check. diff --git a/src/stores/keybindingStore.ts b/src/stores/keybindingStore.ts index 76a21120c..5973d471b 100644 --- a/src/stores/keybindingStore.ts +++ b/src/stores/keybindingStore.ts @@ -5,6 +5,8 @@ import { computed, ref, toRaw } from 'vue' import { RESERVED_BY_TEXT_INPUT } from '@/constants/reservedKeyCombos' import type { KeyCombo, Keybinding } from '@/schemas/keyBindingSchema' +import { processExtensionKeybindings } from '@/extensions/dispatch' +import { useErrorHandling } from '@/composables/useErrorHandling' export class KeybindingImpl implements Keybinding { commandId: string @@ -171,6 +173,14 @@ export const useKeybindingStore = defineStore('keybinding', () => { } ) + const { wrapWithErrorHandling } = useErrorHandling() + processExtensionKeybindings((keybindings) => { + const addKeybinding = wrapWithErrorHandling(addDefaultKeybinding) + for (const keybinding of keybindings) { + addKeybinding(new KeybindingImpl(keybinding)) + } + }) + function getKeybindingsByCommandId(commandId: string) { return keybindingsByCommandId.value[commandId] ?? [] }