Skip to content

Commit f3d1822

Browse files
committed
Added an option to open a folder in VSCode
1 parent 4d3a657 commit f3d1822

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Sources/Overload/OvEditor/src/OvEditor/Panels/AssetBrowser.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,18 @@ class FolderContextualMenu : public BrowserItemContextualMenu
186186
OvTools::Utils::SystemCalls::ShowInExplorer(filePath);
187187
};
188188

189+
auto& openFolderInVsCode = CreateWidget<OvUI::Widgets::Menu::MenuItem>("Open In Visual Studio Code");
190+
openFolderInVsCode.ClickedEvent += [this]
191+
{
192+
const auto command = std::format("code \"{}\"", filePath);
193+
const auto result = std::system(command.c_str());
194+
195+
if (result != 0)
196+
{
197+
OVLOG_ERROR("Failed to open Visual Studio Code with error code: " + std::to_string(result));
198+
}
199+
};
200+
189201
if (!m_protected)
190202
{
191203
auto& importAssetHere = CreateWidget<OvUI::Widgets::Menu::MenuItem>("Import Here...");

0 commit comments

Comments
 (0)