You've already forked com.unity.ide.cursor
mirror of
https://github.com/boxqkrtm/com.unity.ide.cursor.git
synced 2026-05-16 07:20:06 +00:00
Compare commits
4 Commits
copilot/fi
...
feat/add-i
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8bf674e510 | ||
|
|
22d40e0e16 | ||
|
|
c14987c13b | ||
|
|
866c5bfc20 |
@@ -584,12 +584,7 @@ namespace Microsoft.Unity.VisualStudio.Editor
|
|||||||
var application = Path;
|
var application = Path;
|
||||||
|
|
||||||
var workspace = TryFindWorkspace(directory);
|
var workspace = TryFindWorkspace(directory);
|
||||||
// Use version-compatible null-coalescing for Unity 2019.4 (C# 7.3) support
|
|
||||||
#if UNITY_2020_2_OR_NEWER
|
|
||||||
workspace ??= directory;
|
workspace ??= directory;
|
||||||
#else
|
|
||||||
workspace = workspace ?? directory;
|
|
||||||
#endif
|
|
||||||
directory = workspace;
|
directory = workspace;
|
||||||
|
|
||||||
if (EditorPrefs.GetBool(ReuseExistingWindowKey, false))
|
if (EditorPrefs.GetBool(ReuseExistingWindowKey, false))
|
||||||
|
|||||||
@@ -44,11 +44,8 @@ namespace Microsoft.Unity.VisualStudio.Editor
|
|||||||
[InitializeOnLoadMethod]
|
[InitializeOnLoadMethod]
|
||||||
static void LegacyVisualStudioCodePackageDisabler()
|
static void LegacyVisualStudioCodePackageDisabler()
|
||||||
{
|
{
|
||||||
#if UNITY_2021_1_OR_NEWER
|
// disable legacy Visual Studio Code packages
|
||||||
var editor = CodeEditor.Editor.GetCodeEditorForPath("code.cmd");
|
var editor = CodeEditor.Editor.GetCodeEditorForPath("code.cmd");
|
||||||
#else
|
|
||||||
var editor = CodeEditor.CurrentEditor;
|
|
||||||
#endif
|
|
||||||
if (editor == null)
|
if (editor == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -229,9 +226,7 @@ namespace Microsoft.Unity.VisualStudio.Editor
|
|||||||
{
|
{
|
||||||
var editorPath = CodeEditor.CurrentEditorInstallation;
|
var editorPath = CodeEditor.CurrentEditorInstallation;
|
||||||
|
|
||||||
// Performance optimization: Use cached installation lookup instead of discovering every time
|
if (!Discovery.TryDiscoverInstallation(editorPath, out var installation)) {
|
||||||
if (!TryGetVisualStudioInstallationForPath(editorPath, lookupDiscoveredInstallations: true, out var installation))
|
|
||||||
{
|
|
||||||
Debug.LogWarning($"Visual Studio executable {editorPath} is not found. Please change your settings in Edit > Preferences > External Tools.");
|
Debug.LogWarning($"Visual Studio executable {editorPath} is not found. Please change your settings in Edit > Preferences > External Tools.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -243,8 +238,7 @@ namespace Microsoft.Unity.VisualStudio.Editor
|
|||||||
if (!IsProjectGeneratedFor(path, generator, out var missingFlag))
|
if (!IsProjectGeneratedFor(path, generator, out var missingFlag))
|
||||||
Debug.LogWarning($"You are trying to open {path} outside a generated project. This might cause problems with IntelliSense and debugging. To avoid this, you can change your .csproj preferences in Edit > Preferences > External Tools and enable {GetProjectGenerationFlagDescription(missingFlag)} generation.");
|
Debug.LogWarning($"You are trying to open {path} outside a generated project. This might cause problems with IntelliSense and debugging. To avoid this, you can change your .csproj preferences in Edit > Preferences > External Tools and enable {GetProjectGenerationFlagDescription(missingFlag)} generation.");
|
||||||
|
|
||||||
// Performance optimization: Only sync if solution doesn't exist
|
var solution = GetOrGenerateSolutionFile(generator);
|
||||||
var solution = GetOrGenerateSolutionFileIfNeeded(generator);
|
|
||||||
return installation.Open(path, line, column, solution);
|
return installation.Open(path, line, column, solution);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -313,15 +307,5 @@ namespace Microsoft.Unity.VisualStudio.Editor
|
|||||||
generator.Sync();
|
generator.Sync();
|
||||||
return generator.SolutionFile();
|
return generator.SolutionFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Performance optimization: Only sync if solution file doesn't exist
|
|
||||||
private static string GetOrGenerateSolutionFileIfNeeded(IGenerator generator)
|
|
||||||
{
|
|
||||||
if (!generator.HasSolutionBeenGenerated())
|
|
||||||
{
|
|
||||||
generator.Sync();
|
|
||||||
}
|
|
||||||
return generator.SolutionFile();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user