Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Models/ExternalMerger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static ExternalMerger()
new ExternalMerger("git", "Use Git Settings", "", "", ""),
new ExternalMerger("vscode", "Visual Studio Code", "Code.exe", "-n --wait \"$MERGED\"", "-n --wait --diff \"$LOCAL\" \"$REMOTE\""),
new ExternalMerger("vscode_insiders", "Visual Studio Code - Insiders", "Code - Insiders.exe", "-n --wait \"$MERGED\"", "-n --wait --diff \"$LOCAL\" \"$REMOTE\""),
new ExternalMerger("vs", "Visual Studio", "vsDiffMerge.exe", "\"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\" /m", "\"$LOCAL\" \"$REMOTE\""),
new ExternalMerger("vs17", "Visual Studio", "vsDiffMerge.exe", "\"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\" /m", "\"$LOCAL\" \"$REMOTE\""),
new ExternalMerger("tortoise_merge", "Tortoise Merge", "TortoiseMerge.exe;TortoiseGitMerge.exe", "-base:\"$BASE\" -theirs:\"$REMOTE\" -mine:\"$LOCAL\" -merged:\"$MERGED\"", "-base:\"$LOCAL\" -theirs:\"$REMOTE\""),
new ExternalMerger("kdiff3", "KDiff3", "kdiff3.exe", "\"$REMOTE\" -b \"$BASE\" \"$LOCAL\" -o \"$MERGED\"", "\"$LOCAL\" \"$REMOTE\""),
new ExternalMerger("beyond_compare", "Beyond Compare", "BComp.exe", "\"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\"", "\"$LOCAL\" \"$REMOTE\""),
Expand Down
12 changes: 12 additions & 0 deletions src/Models/ExternalTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@ public class VisualStudioInstance

[JsonPropertyName("isPrerelease")]
public bool IsPrerelease { get; set; } = false;

[JsonPropertyName("catalog")]
public VisualStudioCatalog Catalog { get; set; } = new();
}

public class VisualStudioCatalog
{
[JsonPropertyName("productLine")]
public string ProductLine { get; set; } = string.Empty;

[JsonIgnore]
public VisualStudioProductLine ParsedProductLine => Enum.TryParse<VisualStudioProductLine>(ProductLine, out var ppl) ? ppl : VisualStudioProductLine.Dev17;
}

public class JetBrainsState
Expand Down
14 changes: 14 additions & 0 deletions src/Models/VisualStudioProductLine.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace SourceGit.Models
{
public enum VisualStudioProductLine
{
/// <summary>
/// Visual Studio 2022
/// </summary>
Dev17 = 17,
/// <summary>
/// Visual Studio 2026
/// </summary>
Dev18 = 18
}
}
4 changes: 3 additions & 1 deletion src/Native/Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,9 @@ private void FindVisualStudio(Models.ExternalToolsFinder finder)
foreach (var instance in instances)
{
var exec = instance.ProductPath;
var icon = instance.IsPrerelease ? "vs-preview" : "vs";
var productLine = instance.Catalog.ParsedProductLine;
var icon = instance.IsPrerelease ? $"vs{(int)productLine}-preview" : $"vs{(int)productLine}";

finder.TryAdd(instance.DisplayName, icon, () => exec, GenerateCommandlineArgsForVisualStudio);
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Resources/Images/ExternalToolIcons/vs18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.