Skip to content

Commit ccf4ff6

Browse files
authored
feat: Multiple IDE's support (#2683)
1 parent 665a05e commit ccf4ff6

46 files changed

Lines changed: 533 additions & 382 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

THIRD PARTY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ respective owners.
146146

147147
### ModernUIIcons.com
148148

149-
Please carefully understand the license and download the latest icons at ModernUIIcons.com.
149+
Please carefully understand the license and download the latest icons at https://github.com/Templarian/WindowsIcons
150150

151151
#### Understand Your Rights
152152
No Attribution and No Derived Works

sources/Directory.Packages.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
</ItemGroup>
4343
<!-- Other dependencies -->
4444
<ItemGroup>
45+
<PackageVersion Include="JetBrains.Rider.PathLocator" Version="1.0.12" />
4546
<PackageVersion Include="Microsoft.AspNet.WebApi.Client" Version="5.2.7" />
4647
<PackageVersion Include="Microsoft.Build" Version="17.0.0" />
4748
<PackageVersion Include="Microsoft.Build.Locator" Version="1.6.10" />

sources/assets/Stride.Core.Assets.CompilerApp/PackageBuilder.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
using System.Collections.Generic;
66
using System.Diagnostics;
77
using System.Linq;
8-
using System.Reflection;
9-
108
using Stride.Core.Assets.Compiler;
119
using Stride.Core.Assets.Diagnostics;
1210
using Stride.Core.BuildEngine;
13-
using Stride.Core;
1411
using Stride.Core.Diagnostics;
1512
using Stride.Core.IO;
1613
using Stride.Core.MicroThreading;
@@ -19,13 +16,9 @@
1916
using Stride.Core.Assets.Analysis;
2017
using Stride.Core.Reflection;
2118
using Stride.Core.Serialization.Contents;
22-
using Stride;
2319
using Stride.Assets;
24-
using Stride.Graphics;
25-
using Stride.Core.VisualStudio;
2620
using ServiceWire.NamedPipes;
2721
using System.IO;
28-
using Stride.Core.Storage;
2922
using System.Text;
3023

3124
namespace Stride.Core.Assets.CompilerApp

sources/assets/Stride.Core.Assets.CompilerApp/PackageBuilderApp.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@
1313
using Mono.Options;
1414
using Stride.Core.Assets.Diagnostics;
1515
using Stride.Core.BuildEngine;
16-
using Stride.Core;
1716
using Stride.Core.Diagnostics;
1817
using Stride.Core.Yaml;
19-
using Stride.Core.VisualStudio;
2018
using Stride.Assets.Models;
2119
using Stride.Assets.SpriteFont;
22-
using Stride.Graphics;
2320
using Stride.Particles;
2421
using Stride.Rendering.Materials;
2522
using Stride.Rendering.ProceduralModels;

sources/assets/Stride.Core.Assets/AssetRegistry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using Stride.Core.Diagnostics;
99
using Stride.Core.Reflection;
1010
using Stride.Core.Serialization.Contents;
11-
using Stride.Core.VisualStudio;
11+
using Stride.Core.Solutions;
1212
using Stride.Core.Yaml.Serialization;
1313
using Stride.Core.Serialization;
1414

sources/assets/Stride.Core.Assets/PackageSession.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using Stride.Core.Assets.Analysis;
1010
using Stride.Core.Assets.Diagnostics;
1111
using Stride.Core.Assets.Tracking;
12+
using Stride.Core.Solutions;
1213
using Stride.Core.Diagnostics;
1314
using Stride.Core.Extensions;
1415
using Stride.Core.IO;
@@ -291,19 +292,19 @@ protected SolutionProject(Package package) : base(package)
291292
public SolutionProject(Package package, Guid projectGuid, string fullPath)
292293
: this(package)
293294
{
294-
VSProject = new VisualStudio.Project(projectGuid, VisualStudio.KnownProjectTypeGuid.CSharp, Path.GetFileNameWithoutExtension(fullPath), fullPath, Guid.Empty,
295+
VSProject = new Project(projectGuid, KnownProjectTypeGuid.CSharp, Path.GetFileNameWithoutExtension(fullPath), fullPath, Guid.Empty,
295296
[],
296297
[],
297298
[]);
298299
}
299300

300-
public SolutionProject(Package package, VisualStudio.Project vsProject)
301+
public SolutionProject(Package package, Project vsProject)
301302
: this(package)
302303
{
303304
VSProject = vsProject;
304305
}
305306

306-
public VisualStudio.Project VSProject { get; set; }
307+
public Project VSProject { get; set; }
307308

308309
public Guid Id => VSProject.Guid;
309310

@@ -430,14 +431,14 @@ public sealed partial class PackageSession : IDisposable, IAssetFinder
430431
public event DirtyFlagChangedDelegate<AssetItem> AssetDirtyChanged;
431432
private TaskCompletionSource<int> saveCompletion;
432433

433-
internal VisualStudio.Solution VSSolution;
434+
internal Solution VSSolution;
434435

435436
/// <summary>
436437
/// Initializes a new instance of the <see cref="PackageSession"/> class.
437438
/// </summary>
438439
public PackageSession()
439440
{
440-
VSSolution = new VisualStudio.Solution();
441+
VSSolution = new Solution();
441442
VSSolution.Headers.Add(SolutionHeader);
442443

443444
Projects = [];
@@ -790,7 +791,7 @@ public static void Load(string filePath, PackageSessionResult sessionResult, Pac
790791
if (string.Equals(Path.GetExtension(filePath), ".sln", StringComparison.InvariantCultureIgnoreCase))
791792
{
792793
// The session should save back its changes to the solution
793-
var solution = session.VSSolution = VisualStudio.Solution.FromFile(filePath);
794+
var solution = session.VSSolution = Solution.FromFile(filePath);
794795

795796
// Keep header
796797
var versionHeader = solution.Properties.FirstOrDefault(x => x.Name == "VisualStudioVersion");
@@ -802,7 +803,7 @@ public static void Load(string filePath, PackageSessionResult sessionResult, Pac
802803
// Note: using ToList() because upgrade from old package system might change Projects list
803804
foreach (var vsProject in solution.Projects.ToList())
804805
{
805-
if (vsProject.TypeGuid == VisualStudio.KnownProjectTypeGuid.CSharp || vsProject.TypeGuid == VisualStudio.KnownProjectTypeGuid.CSharpNewSystem)
806+
if (vsProject.TypeGuid == KnownProjectTypeGuid.CSharp || vsProject.TypeGuid == KnownProjectTypeGuid.CSharpNewSystem)
806807
{
807808
var project = (SolutionProject)session.LoadProject(sessionResult, vsProject.FullPath, loadParameters);
808809
project.VSProject = vsProject;

sources/assets/Stride.Core.Assets/PackageSessionHelper.Solution.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.IO;
66
using NuGet.ProjectModel;
77
using Stride.Core.Extensions;
8-
using Stride.Core.VisualStudio;
8+
using Stride.Core.Solutions;
99

1010
namespace Stride.Core.Assets;
1111

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
// Copyright (c) .NET Foundation and Contributors (https://dotnetfoundation.org/ & https://stride3d.net)
2+
// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.
3+
4+
namespace Stride.Core.CodeEditorSupport;
5+
6+
public sealed class IDEInfo
7+
{
8+
/// <summary>
9+
/// Initializes a new instance of the <see cref="IDEInfo"/> class.
10+
/// </summary>
11+
/// <param name="installationVersion">The version of the IDE instance.</param>
12+
/// <param name="displayName">The display name of the IDE instance</param>
13+
/// <param name="programPath">The path to the installation root of the IDE instance.</param>
14+
/// <param name="instanceId">The unique identifier for this installation instance.</param>
15+
/// <param name="ideType">The type of IDE instance</param>
16+
/// <exception cref="ArgumentNullException"></exception>
17+
public IDEInfo(Version installationVersion, string displayName, string? programPath, string instanceId, IDEType ideType)
18+
{
19+
DisplayName = displayName ?? throw new ArgumentNullException(nameof(displayName));
20+
InstallationVersion = installationVersion ?? throw new ArgumentNullException(nameof(installationVersion));
21+
InstanceId = instanceId ?? throw new ArgumentNullException(nameof(instanceId));
22+
ProgramPath = programPath;
23+
IDEType = ideType;
24+
}
25+
26+
public static readonly IDEInfo DefaultIDE = new(new Version("0.0"), "Default IDE", string.Empty, string.Empty, IDEType.VisualStudio);
27+
28+
/// <summary>
29+
/// Gets the type of the IDE.
30+
/// </summary>
31+
public IDEType IDEType { get; }
32+
33+
/// <summary>
34+
/// Gets the display name (title) of the product installed in this instance.
35+
/// </summary>
36+
public string DisplayName { get; }
37+
38+
/// <summary>Gets the version of the product installed in this instance.</summary>
39+
/// <value>The version of the product installed in this instance.</value>
40+
public Version InstallationVersion { get; }
41+
42+
/// <summary>
43+
/// The path to the executable of this IDE, or <c>null</c>.
44+
/// </summary>
45+
public string? ProgramPath { get; }
46+
47+
/// <summary>
48+
/// The hex code for this installation instance. It is used, for example, to create a unique folder in %LocalAppData%
49+
/// </summary>
50+
public string InstanceId { get; }
51+
52+
/// <summary>
53+
/// The path to the VSIX installer of this IDE, or <c>null</c>.
54+
/// </summary>
55+
public string? VsixInstallerPath { get; set; }
56+
57+
/// <summary>
58+
/// The package names and versions of packages installed to this instance.
59+
/// </summary>
60+
/// <value></value>
61+
public Dictionary<string, string> PackageVersions { get; } = [];
62+
63+
/// <summary>
64+
/// <c>true</c> if this IDE has a development environment; otherwise, <c>false</c>.
65+
/// </summary>
66+
public bool HasProgram => !string.IsNullOrEmpty(ProgramPath);
67+
68+
/// <summary>
69+
/// <c>true</c> if this IDE has a VSIX installer; otherwise, <c>false</c>.
70+
/// </summary>
71+
public bool HasVsixInstaller => !string.IsNullOrEmpty(VsixInstallerPath);
72+
73+
/// <inheritdoc />
74+
public override string ToString() => DisplayName;
75+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright (c) .NET Foundation and Contributors (https://dotnetfoundation.org/ & https://stride3d.net)
2+
// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.
3+
4+
using Stride.Core.CodeEditorSupport.Rider;
5+
using Stride.Core.CodeEditorSupport.VisualStudio;
6+
using Stride.Core.CodeEditorSupport.VSCode;
7+
8+
namespace Stride.Core.CodeEditorSupport;
9+
10+
public static class IDEInfoVersions
11+
{
12+
public static IEnumerable<IDEInfo> AvailableIDEs()
13+
{
14+
return [..VisualStudioVersions.AvailableInstances, ..RiderVersions.AvailableInstances, ..VSCodeVersions.AvailableInstances];
15+
}
16+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright (c) .NET Foundation and Contributors (https://dotnetfoundation.org/ & https://stride3d.net)
2+
// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.
3+
4+
namespace Stride.Core.CodeEditorSupport;
5+
6+
/// <summary>
7+
/// Represents the type of <see cref="IDEInfo"/> class.
8+
/// </summary>
9+
public enum IDEType
10+
{
11+
/// <summary>
12+
/// Represents the Visual Studio IDE
13+
/// </summary>
14+
VisualStudio,
15+
16+
/// <summary>
17+
/// Represents the JetBrains Rider IDE
18+
/// </summary>
19+
Rider,
20+
21+
/// <summary>
22+
/// Represents the Visual Studio Code editor, or it's fork - VS Codium
23+
/// </summary>
24+
VSCode
25+
}

0 commit comments

Comments
 (0)