Skip to content
Merged
1 change: 1 addition & 0 deletions .github/workflows/dead-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ jobs:
--include-kept false
--format table
--fail-on high-confidence
--max-public-candidates 22
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,6 @@ public async Task<ExecutionResult> ExecuteCodeAsync(
};
}

public ExecutionStatistics GetStatistics()
{
return new ExecutionStatistics();
}

public void Dispose()
{
DisposeCallCount++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@ public Task<ExecutionResult> ExecuteCodeAsync(
});
}

public ExecutionStatistics GetStatistics()
{
return new ExecutionStatistics();
}

public void Dispose()
{
DisposeCallCount++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public void QueueOverlayClear_WithActiveOverlayState_ClearsState()
MouseAction.Click,
new Vector2(10f, 20f),
null,
"Target",
new Vector2(100f, 200f));
MouseUiMainThreadCleanupScheduler scheduler = new();
scheduler.CaptureMainThreadContext();
Expand Down
25 changes: 0 additions & 25 deletions Packages/src/Editor/Application/CliSetupApplicationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,6 @@ public Task<bool> IsCliVisibleFromShellAsync(RuntimePlatform platform, Cancellat
return _cliInstallationDetector.IsCliVisibleFromShellAsync(platform, ct);
}

public void InvalidateCliCache()
{
_cliInstallationDetector.InvalidateCache();
}

public string GetMinimumRequiredCliVersion()
{
// Why: v3 setup installs the global dispatcher and reads the minimum from the package pin JSON
Expand All @@ -179,26 +174,6 @@ public bool HasPackageOwnedCurrentUserInstall(RuntimePlatform platform)
return _nativeCliInstaller.HasPackageOwnedCurrentUserInstall(platform);
}

public bool IsCliVersionLessThan(string leftVersion, string rightVersion)
{
return CliVersionComparer.IsVersionLessThan(leftVersion, rightVersion);
}

public bool IsCliVersionGreaterThan(string leftVersion, string rightVersion)
{
return CliVersionComparer.IsVersionGreaterThan(leftVersion, rightVersion);
}

public bool IsCliVersionGreaterThanOrEqual(string leftVersion, string rightVersion)
{
return CliVersionComparer.IsVersionGreaterThanOrEqual(leftVersion, rightVersion);
}

public bool IsCliVersionEqual(string leftVersion, string rightVersion)
{
return CliVersionComparer.IsVersionEqual(leftVersion, rightVersion);
}

public async Task<CliInstallResult> InstallGlobalCliAsync(
RuntimePlatform platform,
IProgress<string> installProgress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ public interface IUnityCliLoopServerController
void AddServerStateChangedHandler(Action handler);

void RemoveServerStateChangedHandler(Action handler);

void AddServerStartedHandler(Action handler);

void RemoveServerStartedHandler(Action handler);
}

/// <summary>
Expand Down Expand Up @@ -235,15 +231,5 @@ public void RemoveServerStateChangedHandler(Action handler)
{
_controller.RemoveServerStateChangedHandler(handler);
}

public void AddServerStartedHandler(Action handler)
{
_controller.AddServerStartedHandler(handler);
}

public void RemoveServerStartedHandler(Action handler)
{
_controller.RemoveServerStartedHandler(handler);
}
}
}
25 changes: 0 additions & 25 deletions Packages/src/Editor/Application/UnityCliLoopToolRegistrar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,6 @@ internal static void RegisterService(UnityCliLoopToolRegistrarService service)
ServiceValue = service ?? throw new ArgumentNullException(nameof(service));
}

internal static void AddToolsChangedHandler(Action handler)
{
Service.OnToolsChanged += handler;
}

internal static void RemoveToolsChangedHandler(Action handler)
{
Service.OnToolsChanged -= handler;
}

public static UnityCliLoopToolRegistrarService Service
{
get
Expand Down Expand Up @@ -184,20 +174,5 @@ public static bool IsCustomToolRegistered(string toolName)
{
return Service.IsCustomToolRegistered(toolName);
}

public static UnityCliLoopToolRegistry TryGetRegistry()
{
return Service.TryGetRegistry();
}

public static string GetDebugInfo()
{
return Service.GetDebugInfo();
}

public static void NotifyToolChanges()
{
Service.NotifyToolChanges();
}
}
}
1 change: 0 additions & 1 deletion Packages/src/Editor/Application/UnityCliLoopUIConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ public static class UnityCliLoopUIConstants
{
// Tool Settings
public const string TOOL_SETTINGS_MENU_PATH = "Window > Unity CLI Loop > Settings";
public const string CLI_COMMAND_REFERENCE_URL = "https://github.com/hatayama/unity-cli-loop#direct-cli-usage-advanced";
public const string PROJECT_REPOSITORY_URL = "https://github.com/hatayama/unity-cli-loop";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ public ThirdPartyToolMigrationUseCase(IThirdPartyToolMigrationPort migrationPort
_migrationPort = migrationPort ?? throw new ArgumentNullException(nameof(migrationPort));
}

public ThirdPartyToolMigrationPreview PreviewMigration(string projectRoot)
{
Debug.Assert(!string.IsNullOrEmpty(projectRoot), "projectRoot must not be null or empty");

return _migrationPort.PreviewMigration(projectRoot);
}

public Task<ThirdPartyToolMigrationPreview> PreviewMigrationAsync(
string projectRoot,
IProgress<ThirdPartyToolMigrationProgress> progress,
Expand All @@ -55,13 +48,6 @@ public Task<bool> HasMigrationTargetsAsync(string projectRoot, CancellationToken
return _migrationPort.HasMigrationTargetsAsync(projectRoot, ct);
}

public ThirdPartyToolMigrationResult ApplyMigration(string projectRoot)
{
Debug.Assert(!string.IsNullOrEmpty(projectRoot), "projectRoot must not be null or empty");

return _migrationPort.ApplyMigration(projectRoot);
}

public Task<ThirdPartyToolMigrationResult> ApplyMigrationAsync(
string projectRoot,
IProgress<ThirdPartyToolMigrationProgress> progress,
Expand Down
3 changes: 0 additions & 3 deletions Packages/src/Editor/Domain/CliConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,11 @@ public static class CliConstants
public const string POSIX_PATH_SEPARATOR = ":";
public const string WINDOWS_PATH_SEPARATOR = ";";
public const string DISPATCHER_RELEASE_TAG_PREFIX = "dispatcher-v";
public const string BETA_VERSION_MARKER = "-beta.";
public const string SKILL_DIR_PREFIX = "uloop-";
public const string TEMPORARY_SKILLS_DIR_NAME = "TemporarySkills~";
public const string V3_CLI_INVOCATION_MIGRATION_SKILL_NAME = "v3-cli-invocation-migration";
public const string UNITY_PACKAGES_DIR_NAME = "Packages";
public const string PACKAGE_SOURCE_DIR_NAME = "src";
public const string CLI_LAYOUT_CONTRACT_FILE_NAME = "layout-contract.json";
public const string CLI_CONTRACT_FILE_NAME = "contract.json";
public const string GLOBAL_UNIX_COMMAND_NAME = EXECUTABLE_NAME;
public const string GLOBAL_WINDOWS_COMMAND_NAME = EXECUTABLE_NAME + ".exe";
}
Expand Down
2 changes: 0 additions & 2 deletions Packages/src/Editor/Domain/IUnityCliLoopEditorSettingsPort.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ public interface IUnityCliLoopEditorSettingsPort
void SaveSettings(UnityCliLoopEditorSettingsData settings);
void UpdateSettings(Func<UnityCliLoopEditorSettingsData, UnityCliLoopEditorSettingsData> transform);
string GetLastSeenSetupWizardVersion();
void SetLastSeenSetupWizardVersion(string version);
bool GetSuppressSetupWizardAutoShow();
void SetSuppressSetupWizardAutoShow(bool suppressAutoShow);
void SetShowUnityCliLoopSecuritySetting(bool showUnityCliLoopSecuritySetting);
void SetShowToolSettings(bool showToolSettings);
void SetInstallSkillsFlat(bool installSkillsFlat);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,32 +188,6 @@ public static bool ContainsCurrentToolContractsApi(string source)
return RegexMatchesCode(source, CurrentToolContractsNamespaceRegex);
}

public static bool ContainsLegacyDomainMetadataApi(string source)
{
Debug.Assert(source != null, "source must not be null");

return RegexMatchesCode(source, LegacyDomainMetadataRegex) ||
ContainsLegacyDomainHelperApiForAssembly(
source,
hasLegacyAssemblySource: ContainsLegacyToolMigrationMarker(source),
legacyAssemblyAliases: Array.Empty<string>());
}

public static bool ContainsLegacyDomainHelperApiForAssembly(
string source,
bool hasLegacyAssemblySource,
string[] legacyAssemblyAliases)
{
Debug.Assert(source != null, "source must not be null");
Debug.Assert(legacyAssemblyAliases != null, "legacyAssemblyAliases must not be null");

string[] legacyNamespaceAliases = GetCombinedLegacyNamespaceAliases(source, legacyAssemblyAliases);
return ContainsLegacyDomainHelperReference(
source,
hasLegacyAssemblySource,
legacyNamespaceAliases);
}

public static bool ContainsCurrentDomainMetadataApi(string source)
{
Debug.Assert(source != null, "source must not be null");
Expand Down Expand Up @@ -326,19 +300,6 @@ public static bool ContainsLegacyEditorWindowCaptureUtilityTimeoutMigrationForAs
requiresTimeoutArgumentMigration: true);
}

public static bool ContainsCurrentFirstPartyScreenshotApi(string source)
{
Debug.Assert(source != null, "source must not be null");

bool hasCurrentFirstPartyToolsNamespaceUsage =
RegexMatchesCode(source, CurrentFirstPartyToolsNamespaceRegex);
return ContainsCurrentFirstPartyScreenshotApiForAssembly(
source,
hasCurrentFirstPartyToolsNamespaceUsage,
Array.Empty<string>(),
Array.Empty<string>());
}

public static bool ContainsCurrentFirstPartyScreenshotApiForAssembly(
string source,
bool hasAssemblyScopedCurrentFirstPartyToolsUsing,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,51 +158,6 @@ public static bool ContainsMigratableUnqualifiedLegacyRegistrarDomainReturn(stri
return false;
}

public static bool ContainsLegacyDomainHelperReference(
string source,
bool canMigrateBareLegacyDomainHelper,
string[] aliases)
{
Debug.Assert(source != null, "source must not be null");
Debug.Assert(aliases != null, "aliases must not be null");

CodeTextMask codeTextMask = CodeTextMask.Create(source);
foreach (TypeReplacementRule rule in DomainTypeReplacementRules)
{
Regex fullyQualifiedRegex = new(
$@"(?:(?:global::)?{Regex.Escape(LegacyNamespace)}\.){Regex.Escape(rule.LegacyName)}\b",
RegexOptions.Compiled);
if (RegexMatchesCode(source, fullyQualifiedRegex))
{
return true;
}

foreach (string alias in aliases)
{
if (ContainsAliasQualifiedName(source, alias, rule.LegacyName))
{
return true;
}
}

if (canMigrateBareLegacyDomainHelper &&
ContainsLegacyAssemblyScopedTypeName(source, codeTextMask, rule.LegacyName))
{
return true;
}
}

return false;
}

public static bool ContainsCurrentDomainHelperApi(string source)
{
Debug.Assert(source != null, "source must not be null");

bool hasCurrentDomainNamespaceUsage = RegexMatchesCode(source, CurrentDomainNamespaceRegex);
return ContainsCurrentDomainHelperApiForAssembly(source, hasCurrentDomainNamespaceUsage);
}

public static bool ContainsCurrentDomainHelperApiForAssembly(
string source,
bool canUseBareCurrentDomainType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public static class ThirdPartyToolMigrationRuleCatalog
public const string DescriptionAttributeArgumentName = "Description";
public const string DisplayDevelopmentOnlyAttributeArgumentName = "DisplayDevelopmentOnly";
public const string RequiredSecuritySettingAttributeArgumentName = "RequiredSecuritySetting";
public const string LegacySecuritySettingsTypeName = "SecuritySettings";
public const string CurrentSecuritySettingTypeName = "UnityCliLoopSecuritySetting";
public const string LegacyEditorDelayTypeName = "EditorDelay";
public const string LegacyEditorDelayMethodName = "DelayFrame";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,6 @@ public ClearConsoleResponse(bool success, int clearedLogCount, ClearedLogCounts
Message = message ?? string.Empty;
ErrorMessage = string.Empty;
}

/// <summary>
/// Create a new ClearConsoleResponse for failed operation
/// </summary>
public ClearConsoleResponse(string errorMessage)
{
Success = false;
ClearedLogCount = 0;
ClearedCounts = new ClearedLogCounts();
Message = string.Empty;
ErrorMessage = errorMessage ?? string.Empty;
}

/// <summary>
/// Parameterless constructor for JSON deserialization
/// </summary>
public ClearConsoleResponse()
{
ClearedCounts = new ClearedLogCounts();
Message = string.Empty;
ErrorMessage = string.Empty;
}
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,6 @@ public static void NotifyRecordingStopped()
ServiceValue.NotifyRecordingStopped();
}

public static void ForceStop()
{
ServiceValue.ForceStop();
}

internal static string FormatVector2(Vector2 v)
{
return InputRecordingVectorFormat.FormatVector2(v);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ private void ApplyUiPointerActivity(UiReplayFrame replayFrame)
MouseAction.Click,
replayFrame.InputPosition,
null,
_currentPressTarget?.name,
replayFrame.GameViewSize);
SimulateMouseUiOverlayState.RequestExpandAnimation();
return;
Expand All @@ -104,7 +103,6 @@ private void ApplyUiPointerActivity(UiReplayFrame replayFrame)
MouseAction.Click,
replayFrame.InputPosition,
null,
null,
replayFrame.GameViewSize);
}
}
Expand All @@ -122,7 +120,6 @@ private void ApplyUiPointerHold(UiReplayFrame replayFrame)
MouseAction.Drag,
replayFrame.InputPosition,
pressInputPos,
null,
replayFrame.GameViewSize);
return;
}
Expand All @@ -137,7 +134,6 @@ private void ApplyUiPointerHold(UiReplayFrame replayFrame)
MouseAction.LongPress,
replayFrame.InputPosition,
null,
_currentPressTarget?.name,
replayFrame.GameViewSize);
SimulateMouseUiOverlayState.UpdateLongPressElapsed(elapsed);
}
Expand Down
Loading
Loading