Skip to content

Commit 439420d

Browse files
committed
Revert (amend to remove stupid ci cache)
1 parent f3e025f commit 439420d

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

Packages/com.unity.ide.visualstudio/Editor/VisualStudioEditor.cs

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -228,22 +228,8 @@ public bool OpenProject(string path, int line, int column)
228228
if (!IsProjectGeneratedFor(path, generator, out var missingFlag))
229229
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.");
230230

231-
if (!generator.HasSolutionBeenGenerated())
232-
{
233-
// If no solution has been generated, run a sync before opening the solution
234-
generator.Sync();
235-
return OpenFromInstallation(installation, path, line, column);
236-
}
237-
else
238-
{
239-
// Else chances are high that the solution is up-to-date, proactively open the solution for better latency
240-
var result = OpenFromInstallation(installation, path, line, column);
241-
242-
// But run a sync to make sure everything is up-to-date. Best case we'll do nothing (apart from checking compilation objects), worst case VS will reload touched projects.
243-
generator.Sync();
244-
245-
return result;
246-
}
231+
var solution = GetOrGenerateSolutionFile(generator);
232+
return installation.Open(path, line, column, solution);
247233
}
248234

249235
private static bool OpenFromInstallation(IVisualStudioInstallation installation, string path, int line, int column)
@@ -311,5 +297,11 @@ private static bool IsProjectGeneratedFor(string path, IGenerator generator, out
311297
missingFlag = flag;
312298
return false;
313299
}
300+
301+
private static string GetOrGenerateSolutionFile(IGenerator generator)
302+
{
303+
generator.Sync();
304+
return generator.SolutionFile();
305+
}
314306
}
315307
}

0 commit comments

Comments
 (0)