diff --git a/src/olympic/studio/modlib/include/studio/module.hpp b/src/olympic/studio/modlib/include/studio/module.hpp index 3844bdab..5d07f6fe 100644 --- a/src/olympic/studio/modlib/include/studio/module.hpp +++ b/src/olympic/studio/modlib/include/studio/module.hpp @@ -37,10 +37,28 @@ class Module { template [[nodiscard]] -studio::EditorMaker editorMaker(studio::StudioContext &ctx, ox::StringParam ext) noexcept { +EditorMaker editorMaker(StudioContext &ctx, ox::StringParam ext) noexcept { return { {std::move(ext)}, - [&ctx](ox::StringViewCR path) -> ox::Result { + [&ctx](ox::StringViewCR path) -> ox::Result { + return ox::makeCatch(ctx, path); + } + }; +} + +template +[[nodiscard]] +EditorMaker editorMaker(StudioContext &ctx, std::initializer_list exts) noexcept { + return { + [&exts] { + ox::Vector fileTypes; + fileTypes.reserve(exts.size()); + for (auto &s : exts) { + fileTypes.emplace_back(s); + } + return fileTypes; + }(), + [&ctx](ox::StringViewCR path) -> ox::Result { return ox::makeCatch(ctx, path); } };