You've already forked com.unity.ide.cursor
mirror of
https://github.com/boxqkrtm/com.unity.ide.cursor.git
synced 2026-05-15 06:40:08 +00:00
Compare commits
4 Commits
feat/add-i
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd8ff1fb70 | ||
|
|
d17d7814f6 | ||
|
|
a97262d3f7 | ||
|
|
53e1baac3c |
@@ -1,5 +1,12 @@
|
||||
# Code Editor Package for Cursor
|
||||
|
||||
## [2.0.28] - 2026-02-12
|
||||
|
||||
Integration:
|
||||
|
||||
- Performance optimization for opening files
|
||||
- Fix CS1525: Use C# 7.3-compatible null-coalescing for Unity 2019.4
|
||||
|
||||
## [2.0.27] - 2025-11-02
|
||||
|
||||
Integration:
|
||||
|
||||
@@ -584,7 +584,12 @@ namespace Microsoft.Unity.VisualStudio.Editor
|
||||
var application = Path;
|
||||
|
||||
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;
|
||||
#else
|
||||
workspace = workspace ?? directory;
|
||||
#endif
|
||||
directory = workspace;
|
||||
|
||||
if (EditorPrefs.GetBool(ReuseExistingWindowKey, false))
|
||||
|
||||
@@ -44,8 +44,11 @@ namespace Microsoft.Unity.VisualStudio.Editor
|
||||
[InitializeOnLoadMethod]
|
||||
static void LegacyVisualStudioCodePackageDisabler()
|
||||
{
|
||||
// disable legacy Visual Studio Code packages
|
||||
#if UNITY_2021_1_OR_NEWER
|
||||
var editor = CodeEditor.Editor.GetCodeEditorForPath("code.cmd");
|
||||
#else
|
||||
var editor = CodeEditor.CurrentEditor;
|
||||
#endif
|
||||
if (editor == null)
|
||||
return;
|
||||
|
||||
@@ -138,7 +141,7 @@ namespace Microsoft.Unity.VisualStudio.Editor
|
||||
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(VisualStudioCursorInstallation.ReuseExistingWindowKey, newReuseWindow);
|
||||
|
||||
|
||||
EditorGUILayout.Space();
|
||||
}
|
||||
|
||||
@@ -226,7 +229,9 @@ namespace Microsoft.Unity.VisualStudio.Editor
|
||||
{
|
||||
var editorPath = CodeEditor.CurrentEditorInstallation;
|
||||
|
||||
if (!Discovery.TryDiscoverInstallation(editorPath, out var installation)) {
|
||||
// Performance optimization: Use cached installation lookup instead of discovering every time
|
||||
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.");
|
||||
return false;
|
||||
}
|
||||
@@ -238,7 +243,8 @@ namespace Microsoft.Unity.VisualStudio.Editor
|
||||
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.");
|
||||
|
||||
var solution = GetOrGenerateSolutionFile(generator);
|
||||
// Performance optimization: Only sync if solution doesn't exist
|
||||
var solution = GetOrGenerateSolutionFileIfNeeded(generator);
|
||||
return installation.Open(path, line, column, solution);
|
||||
}
|
||||
|
||||
@@ -307,5 +313,15 @@ namespace Microsoft.Unity.VisualStudio.Editor
|
||||
generator.Sync();
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "com.boxqkrtm.ide.cursor",
|
||||
"displayName": "Cursor Editor",
|
||||
"description": "Cursor editor integration for supporting Cursor as code editor for unity. Adds support for generating csproj files for intellisense purposes, auto discovery of installations, etc.",
|
||||
"version": "2.0.27",
|
||||
"version": "2.0.28",
|
||||
"unity": "2019.4",
|
||||
"unityRelease": "25f1",
|
||||
"dependencies": {
|
||||
|
||||
Reference in New Issue
Block a user