From 22d40e0e16fe25fcd4eaae9fec3d2718a6c10dee Mon Sep 17 00:00:00 2001 From: boxqkrtm <9902abcd@gmail.com> Date: Sun, 2 Nov 2025 14:31:29 +0900 Subject: [PATCH] refactor: make ReuseExistingWindowKey internal for better encapsulation --- Editor/VisualStudioCursorInstallation.cs | 2 +- Editor/VisualStudioEditor.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Editor/VisualStudioCursorInstallation.cs b/Editor/VisualStudioCursorInstallation.cs index 638fb85..3c230d7 100644 --- a/Editor/VisualStudioCursorInstallation.cs +++ b/Editor/VisualStudioCursorInstallation.cs @@ -20,7 +20,7 @@ namespace Microsoft.Unity.VisualStudio.Editor internal class VisualStudioCursorInstallation : VisualStudioInstallation { private static readonly IGenerator _generator = new SdkStyleProjectGeneration(); - private const string ReuseExistingWindowKey = "cursor_reuse_existing_window"; + internal const string ReuseExistingWindowKey = "cursor_reuse_existing_window"; public override bool SupportsAnalyzers { diff --git a/Editor/VisualStudioEditor.cs b/Editor/VisualStudioEditor.cs index 271dc4b..c3129fb 100644 --- a/Editor/VisualStudioEditor.cs +++ b/Editor/VisualStudioEditor.cs @@ -134,10 +134,10 @@ namespace Microsoft.Unity.VisualStudio.Editor if (installation is VisualStudioCursorInstallation) { - var reuseWindow = EditorPrefs.GetBool("cursor_reuse_existing_window", false); + var reuseWindow = EditorPrefs.GetBool(VisualStudioCursorInstallation.ReuseExistingWindowKey, false); var newReuseWindow = EditorGUILayout.Toggle(new GUIContent("Reuse existing Cursor window", "When enabled, opens files in an existing Cursor window if found. When disabled, always opens a new window."), reuseWindow); if (newReuseWindow != reuseWindow) - EditorPrefs.SetBool("cursor_reuse_existing_window", newReuseWindow); + EditorPrefs.SetBool(VisualStudioCursorInstallation.ReuseExistingWindowKey, newReuseWindow); EditorGUILayout.Space(); }