Skip to content

Commit

Permalink
fix: return value in Roblox platform notification handler (#910)
Browse files Browse the repository at this point in the history
* fix: return value in Roblox platform notification handler

* fix: allow multiple workspaces to handle notifications
  • Loading branch information
lopi-py authored Feb 1, 2025
1 parent e6c6413 commit 50e305b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/LanguageServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,15 @@ void LanguageServer::onNotification(const std::string& method, std::optional<jso
}
else
{
bool handled = false;
for (auto& workspace : workspaceFolders)
{
if (workspace->platform && workspace->platform->handleNotification(method, params))
return;
handled = true;
}

client->sendLogMessage(lsp::MessageType::Warning, "unknown notification method: " + method);
if (!handled)
client->sendLogMessage(lsp::MessageType::Warning, "unknown notification method: " + method);
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/platform/roblox/RobloxStudioPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ bool RobloxPlatform::handleNotification(const std::string& method, std::optional
if (method == "$/plugin/full")
{
onStudioPluginFullChange(JSON_REQUIRED_PARAMS(params, "$/plugin/full"));
return true;
}
else if (method == "$/plugin/clear")
{
onStudioPluginClear();
return true;
}

return false;
Expand Down

0 comments on commit 50e305b

Please sign in to comment.