<commit_before>local coreGui = game:GetService("CoreGui")

local PLUGIN_NAME = "Studio Bridge"
local INTERFACE = script.Parent.StudioBridgeUI

--[[ When using Auto Sync, this determines how often (in seconds) we sync with
  the server.

  All plugins share a limit of 500 HTTP requests per minute, so we need to set
  this fairly conservatively. We don't want to perform too many requests and
  stall out other plugins. ]]
local REFRESH_RATE = 60/40 -- 40 requests per minute. 1.5 requests a second.

local importing = require(script.Parent.Importing)
local protectedImport = importing.protectedImport

--------------------------------------------------------------------------------
-- Plugin Setup
--------------------------------------------------------------------------------

-- Suppresses the "unknown global" warnings.
local plugin = plugin
local toolbar = plugin:CreateToolbar(PLUGIN_NAME)

--------------------------------------------------------------------------------
-- User Interface
--------------------------------------------------------------------------------

local function hideUIComponents()
  for _, frame in ipairs(INTERFACE:GetChildren()) do
    frame.Visible = false
  end
end

local function setupUI()
  hideUIComponents()

  INTERFACE.Parent = coreGui
end

setupUI()

--------------------------------------------------------------------------------
-- Button Setup
--------------------------------------------------------------------------------

local function createSyncButton()
  local tooltip = "Establishes a connection to the server and starts syncing "..
    "changes made on the filesystem."
  local icon = "rbxassetid://628461615"

  return toolbar:CreateButton("Sync", tooltip, icon)
end

local function setupSyncButton()
  local button = createSyncButton()

  --[[ We have to keep this outside of the Click event, otherwise we won't be
    able to debounce it and the user can run multiple auto sync loops. ]]
  local syncing = false

  local function runImportLoop()
    while syncing do
      local success = protectedImport()

      if not success then
        break
      end

      wait(REFRESH_RATE)
    end
  end

  local function autoImport()
    if not syncing then
      syncing = true
      runImportLoop()

      -- This gets run after the above function breaks out of its loop.
      print("[StudioBridge] Auto syncing stopped")
    end
  end

  button.Click:connect(function()
    if not syncing then
      print("[StudioBridge] Started auto syncing file changes. Click "..
        "\"Sync\" again to stop")
      autoImport(sycning, plugin)
    else
      syncing = false
    end
  end)
end

local function createInfoButton()
  local tooltip = ("Displays information on how to use %s."):format(PLUGIN_NAME)
  local icon = "rbxassetid://628461727"

  return toolbar:CreateButton("Help", tooltip, icon)
end<commit_msg>Remove unused arguments<commit_after>local coreGui = game:GetService("CoreGui")

local PLUGIN_NAME = "Studio Bridge"
local INTERFACE = script.Parent.StudioBridgeUI

--[[ When using Auto Sync, this determines how often (in seconds) we sync with
  the server.

  All plugins share a limit of 500 HTTP requests per minute, so we need to set
  this fairly conservatively. We don't want to perform too many requests and
  stall out other plugins. ]]
local REFRESH_RATE = 60/40 -- 40 requests per minute. 1.5 requests a second.

local importing = require(script.Parent.Importing)
local protectedImport = importing.protectedImport

--------------------------------------------------------------------------------
-- Plugin Setup
--------------------------------------------------------------------------------

-- Suppresses the "unknown global" warnings.
local plugin = plugin
local toolbar = plugin:CreateToolbar(PLUGIN_NAME)

--------------------------------------------------------------------------------
-- User Interface
--------------------------------------------------------------------------------

local function hideUIComponents()
  for _, frame in ipairs(INTERFACE:GetChildren()) do
    frame.Visible = false
  end
end

local function setupUI()
  hideUIComponents()

  INTERFACE.Parent = coreGui
end

setupUI()

--------------------------------------------------------------------------------
-- Button Setup
--------------------------------------------------------------------------------

local function createSyncButton()
  local tooltip = "Establishes a connection to the server and starts syncing "..
    "changes made on the filesystem."
  local icon = "rbxassetid://628461615"

  return toolbar:CreateButton("Sync", tooltip, icon)
end

local function setupSyncButton()
  local button = createSyncButton()

  --[[ We have to keep this outside of the Click event, otherwise we won't be
    able to debounce it and the user can run multiple auto sync loops. ]]
  local syncing = false

  local function runImportLoop()
    while syncing do
      local success = protectedImport()

      if not success then
        break
      end

      wait(REFRESH_RATE)
    end
  end

  local function autoImport()
    if not syncing then
      syncing = true
      runImportLoop()

      -- This gets run after the above function breaks out of its loop.
      print("[StudioBridge] Auto syncing stopped")
    end
  end

  button.Click:connect(function()
    if not syncing then
      print("[StudioBridge] Started auto syncing file changes. Click "..
        "\"Sync\" again to stop")
      autoImport()
    else
      syncing = false
    end
  end)
end

local function createInfoButton()
  local tooltip = ("Displays information on how to use %s."):format(PLUGIN_NAME)
  local icon = "rbxassetid://628461727"

  return toolbar:CreateButton("Help", tooltip, icon)
end
{'fraction_non_alphanumeric': 0.2320027889140666, 'fraction_numerical': 0.010109813491371798, 'mean_word_length': 1.8099902056807051, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5878315', 'n_tokens_mistral': 1447, 'n_tokens_neox': 1352, 'n_words': 528}