You've already forked com.unity.ide.cursor
mirror of
https://github.com/boxqkrtm/com.unity.ide.cursor.git
synced 2026-05-14 14:20:09 +00:00
code-workspace
This commit is contained in:
@@ -507,6 +507,15 @@ namespace Microsoft.Unity.VisualStudio.Editor {
|
||||
return null;
|
||||
}
|
||||
|
||||
private static string TryFindWorkspace(string directory)
|
||||
{
|
||||
var files = Directory.GetFiles(directory, "*.code-workspace", SearchOption.TopDirectoryOnly);
|
||||
if (files.Length == 0 || files.Length > 1)
|
||||
return null;
|
||||
|
||||
return files[0];
|
||||
}
|
||||
|
||||
public override bool Open(string path, int line, int column, string solution) {
|
||||
line = Math.Max(1, line);
|
||||
column = Math.Max(0, column);
|
||||
@@ -514,6 +523,10 @@ namespace Microsoft.Unity.VisualStudio.Editor {
|
||||
var directory = IOPath.GetDirectoryName(solution);
|
||||
var application = Path;
|
||||
|
||||
var workspace = TryFindWorkspace(directory);
|
||||
workspace ??= directory;
|
||||
directory = workspace;
|
||||
|
||||
var existingProcess = FindRunningCursorWithSolution(directory);
|
||||
if (existingProcess != null) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user