From 24e990f9964b9d21c5e4a51eac81a5850f3fae4b Mon Sep 17 00:00:00 2001 From: Skekdog <47750815+Skekdog@users.noreply.github.com> Date: Fri, 3 Jul 2026 14:06:37 +0100 Subject: [PATCH 1/4] autoconnect to local files via attribute --- plugin/src/App/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/src/App/init.lua b/plugin/src/App/init.lua index e6e4deee..0d7e1758 100644 --- a/plugin/src/App/init.lua +++ b/plugin/src/App/init.lua @@ -262,7 +262,7 @@ function App:getPriorSyncInfo(): { host: string?, port: string?, projectName: st end local id = tostring(game.PlaceId) - if ignorePlaceIds[id] then + if ignorePlaceIds[id] and not workspace:GetAttribute("__Rojo_ProjectName") then return {} end @@ -286,7 +286,7 @@ function App:setPriorSyncInfo(host: string, port: string, projectName: string) end local id = tostring(game.PlaceId) - if ignorePlaceIds[id] then + if ignorePlaceIds[id] and workspace:GetAttribute("__Rojo_ProjectName") ~= projectName then return end From 1d424ce39557ba4a95098430e1c0d1f4785aa287 Mon Sep 17 00:00:00 2001 From: Skekdog <47750815+Skekdog@users.noreply.github.com> Date: Sun, 5 Jul 2026 20:44:31 +0100 Subject: [PATCH 2/4] correctly save sync info by project name attribute --- plugin/src/App/init.lua | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/plugin/src/App/init.lua b/plugin/src/App/init.lua index 0d7e1758..1fac90fb 100644 --- a/plugin/src/App/init.lua +++ b/plugin/src/App/init.lua @@ -255,18 +255,29 @@ function App:checkForUpdates() end end +local function getActiveProjectIdentifier(): string + local placeId = tostring(game.PlaceId) + + local attributeProjectName = workspace:GetAttribute("__Rojo_ProjectName") + assert(typeof(attributeProjectName) == "string" or typeof(attributeProjectName) == "nil", `Expected Workspace attribute '__Rojo_ProjectName' to be a string or nil, got {typeof(attributeProjectName)}`) + + local identifier = attributeProjectName or placeId + + return identifier +end + function App:getPriorSyncInfo(): { host: string?, port: string?, projectName: string?, timestamp: number? } local priorSyncInfos = Settings:get("priorEndpoints") if not priorSyncInfos then return {} end - local id = tostring(game.PlaceId) - if ignorePlaceIds[id] and not workspace:GetAttribute("__Rojo_ProjectName") then + local identifier = getActiveProjectIdentifier() + if ignorePlaceIds[identifier] then return {} end - return priorSyncInfos[id] or {} + return priorSyncInfos[identifier] or {} end function App:setPriorSyncInfo(host: string, port: string, projectName: string) @@ -278,25 +289,25 @@ function App:setPriorSyncInfo(host: string, port: string, projectName: string) local now = os.time() -- Clear any stale saves to avoid disc bloat - for placeId, syncInfo in priorSyncInfos do + for identifier, syncInfo in priorSyncInfos do if now - (syncInfo.timestamp or now) > 12_960_000 then - priorSyncInfos[placeId] = nil - Log.trace("Cleared stale saved endpoint for {}", placeId) + priorSyncInfos[identifier] = nil + Log.trace("Cleared stale saved endpoint for {}", identifier) end end - local id = tostring(game.PlaceId) - if ignorePlaceIds[id] and workspace:GetAttribute("__Rojo_ProjectName") ~= projectName then + local identifier = getActiveProjectIdentifier() + if ignorePlaceIds[identifier] then return end - priorSyncInfos[id] = { + priorSyncInfos[identifier] = { host = if host ~= Config.defaultHost then host else nil, port = if port ~= Config.defaultPort then port else nil, projectName = projectName, timestamp = now, } - Log.trace("Saved last used endpoint for {}", game.PlaceId) + Log.trace("Saved last used endpoint for {}", identifier) Settings:set("priorEndpoints", priorSyncInfos) end @@ -307,9 +318,9 @@ function App:forgetPriorSyncInfo() priorSyncInfos = {} end - local id = tostring(game.PlaceId) - priorSyncInfos[id] = nil - Log.trace("Erased last used endpoint for {}", game.PlaceId) + local identifier = getActiveProjectIdentifier() + priorSyncInfos[identifier] = nil + Log.trace("Erased last used endpoint for {}", identifier) Settings:set("priorEndpoints", priorSyncInfos) end From 4451f591d0c346011aae649621447abe23826be9 Mon Sep 17 00:00:00 2001 From: Skekdog <47750815+Skekdog@users.noreply.github.com> Date: Sun, 5 Jul 2026 20:46:55 +0100 Subject: [PATCH 3/4] fix formatting --- plugin/src/App/init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugin/src/App/init.lua b/plugin/src/App/init.lua index 1fac90fb..7e3614b8 100644 --- a/plugin/src/App/init.lua +++ b/plugin/src/App/init.lua @@ -259,7 +259,10 @@ local function getActiveProjectIdentifier(): string local placeId = tostring(game.PlaceId) local attributeProjectName = workspace:GetAttribute("__Rojo_ProjectName") - assert(typeof(attributeProjectName) == "string" or typeof(attributeProjectName) == "nil", `Expected Workspace attribute '__Rojo_ProjectName' to be a string or nil, got {typeof(attributeProjectName)}`) + assert( + typeof(attributeProjectName) == "string" or typeof(attributeProjectName) == "nil", + `Expected Workspace attribute '__Rojo_ProjectName' to be a string or nil, got {typeof(attributeProjectName)}` + ) local identifier = attributeProjectName or placeId From 1b2c33228756767434b478c3d5f014e73b040c3d Mon Sep 17 00:00:00 2001 From: Skekdog <47750815+Skekdog@users.noreply.github.com> Date: Mon, 6 Jul 2026 13:59:20 +0100 Subject: [PATCH 4/4] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ac21a66..e81cf3d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,9 +34,11 @@ Making a new release? Simply add the new header with the version and date undern * Fixed `$path` values that point outside the project folder failing to match `syncRule`s on Windows, which broke `rojo sourcemap` with a "could not be turned into a Roblox Instance" error. ([#1290]) * Fixed `rojo serve` silently stopping syncing file changes on Windows when the served project path was a verbatim (`\\?\`) path, because tree paths and file-watcher event paths were canonicalized to different forms. ([#1290]) * Fixed `rojo sourcemap --absolute` emitting verbatim (`\\?\`) paths on Windows, which broke require types in luau-lsp. ([#1290]) +* Local place files can now be auto-connected via the `__Rojo_ProjectName` attribute on Workspace. ([#1296]) * The plugin now disables the `Check for Updates` setting if you block access to `api.github.com`. ([#1297]) [#1290]: https://github.com/rojo-rbx/rojo/pull/1290 +[#1296]: https://github.com/rojo-rbx/rojo/pull/1296 [#1297]: https://github.com/rojo-rbx/rojo/pull/1297 ## [7.7.0] (July 1st, 2026)