From 3f1af46fcbd766e556ff5b2a2c10389e94b43300 Mon Sep 17 00:00:00 2001 From: Joe Date: Sun, 1 Mar 2026 14:26:29 -0600 Subject: [PATCH] Refactor variable names in App module for clarity and update .gitignore for Atlas artifacts - Renamed variables in the `App` module to improve code readability, changing `mcpPatchTree` to `_mcpPatchTree` and `cachedServerInfo` to `_cachedServerInfo`. - Updated the `.gitignore` file to ignore all Atlas log/build artifacts by changing the entry to `**/.atlas/`, ensuring a cleaner repository. --- .gitignore | 4 ++-- plugin/src/App/init.lua | 15 ++++++--------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 719d02b9..a4f648c7 100644 --- a/.gitignore +++ b/.gitignore @@ -30,5 +30,5 @@ # Environment secrets .env -# Atlas log directory -/.atlas/ +# Atlas log/build artifacts +**/.atlas/ diff --git a/plugin/src/App/init.lua b/plugin/src/App/init.lua index e5bef9e5..8aed56e7 100644 --- a/plugin/src/App/init.lua +++ b/plugin/src/App/init.lua @@ -1190,7 +1190,7 @@ function App:startMcpSync(requestId, mode, overrides) twoWaySync = false, }) - local mcpPatchTree = nil + local _mcpPatchTree = nil local mcpSyncResolved = false local function resolveOnce(result) @@ -1208,15 +1208,12 @@ function App:startMcpSync(requestId, mode, overrides) }) end) - local cachedServerInfo = nil + local _cachedServerInfo = nil serveSession:setConfirmCallback(function(instanceMap, patch, serverInfo) - cachedServerInfo = serverInfo + _cachedServerInfo = serverInfo - local retainedFromIds = {} - for id, inst in instanceMap.fromIds do - retainedFromIds[id] = inst - end + local retainedFromIds = table.clone(instanceMap.fromIds) self._lastMcpFromIds = retainedFromIds PatchSet.removeDataModelName(patch, instanceMap) @@ -1232,7 +1229,7 @@ function App:startMcpSync(requestId, mode, overrides) local gitMetadata = serverInfo.gitMetadata local patchTree = PatchTree.build(patch, instanceMap, { "Property", "Current", "Incoming" }, gitMetadata) - mcpPatchTree = patchTree + _mcpPatchTree = patchTree -- Apply overrides: look up each override by id in the tree, verify, set selection local overrideSelections = {} @@ -1468,7 +1465,7 @@ local SCRIPT_CLASS_SET = { ModuleScript = true, } -function App:_buildMcpChangeList(patchTree, patch, instanceMap, selections, includeAll) +function App:_buildMcpChangeList(patchTree, patch, _instanceMap, selections, includeAll) local changes = {} local patchUpdatedLookup = nil