Skip to content

Commit c8e7ae4

Browse files
committed
Extend output language support with C# 13 and 14
1 parent 0e78745 commit c8e7ae4

File tree

5 files changed

+27
-5
lines changed

5 files changed

+27
-5
lines changed

backend/ILSpyX.Backend/Application/ILSpyBackendSettings.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
using ICSharpCode.Decompiler.CSharp;
33
using ICSharpCode.Decompiler.CSharp.OutputVisitor;
44
using ILSpyX.Backend.Model;
5+
using System.Diagnostics.CodeAnalysis;
56

67
namespace ILSpyX.Backend.Application;
78

89
public class ILSpyBackendSettings
910
{
10-
private CSharpFormattingOptions formattingOptions;
11+
private readonly CSharpFormattingOptions formattingOptions;
1112

1213
public ILSpyBackendSettings()
1314
{
@@ -26,6 +27,7 @@ public DecompilerSettings CreateDecompilerSettings(string outputLanguage = Langu
2627
return decompilerSettings;
2728
}
2829

30+
[SuppressMessage("ReSharper", "RedundantSwitchExpressionArms")]
2931
private LanguageVersion GetCSharpLanguageVersion(string languageName)
3032
{
3133
return languageName switch
@@ -45,7 +47,9 @@ private LanguageVersion GetCSharpLanguageVersion(string languageName)
4547
LanguageName.CSharp_10 => LanguageVersion.CSharp10_0,
4648
LanguageName.CSharp_11 => LanguageVersion.CSharp11_0,
4749
LanguageName.CSharp_12 => LanguageVersion.CSharp12_0,
48-
_ => LanguageVersion.CSharp12_0,
50+
LanguageName.CSharp_13 => LanguageVersion.CSharp13_0,
51+
LanguageName.CSharp_14 => LanguageVersion.CSharp14_0,
52+
_ => LanguageVersion.CSharp14_0,
4953
};
5054
}
5155
}

backend/ILSpyX.Backend/Model/LanguageNames.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@ public static class LanguageName
1818
public const string CSharp_10 = "cs-10";
1919
public const string CSharp_11 = "cs-11";
2020
public const string CSharp_12 = "cs-12";
21-
public const string CSharpLatest = CSharp_12;
21+
public const string CSharp_13 = "cs-13";
22+
public const string CSharp_14 = "cs-14";
23+
public const string CSharpLatest = CSharp_14;
2224
}

vscode-extension/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@
3232
"ilspy.defaultOutputLanguage": {
3333
"description": "Defines to which language or language variant ILSpy will decompile assemblies by default. Note that you can choose a different language for a specific view later.",
3434
"type": "string",
35-
"default": "C# 12.0 / VS 2022.8",
35+
"default": "C# 14.0 / VS 2026",
3636
"enum": [
37+
"C# 14.0 / VS 2026",
38+
"C# 13.0 / VS 2022.12",
3739
"C# 12.0 / VS 2022.8",
3840
"C# 11.0 / VS 2022.4",
3941
"C# 10.0 / VS 2022",
@@ -52,6 +54,8 @@
5254
"IL"
5355
],
5456
"enumDescriptions": [
57+
"Decompile to C# 14.0 by default",
58+
"Decompile to C# 13.0 by default",
5559
"Decompile to C# 12.0 by default",
5660
"Decompile to C# 11.0 by default",
5761
"Decompile to C# 10.0 by default",

vscode-extension/src/decompiler/languageInfos.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,19 @@ export const languageInfos = createLanguageMap([
8383
displayName: "C# 12.0 / VS 2022.8",
8484
vsLanguageMode: "csharp",
8585
},
86+
{
87+
name: LanguageName.CSharp_13,
88+
displayName: "C# 13.0 / VS 2022.12",
89+
vsLanguageMode: "csharp",
90+
},
91+
{
92+
name: LanguageName.CSharp_14,
93+
displayName: "C# 14.0 / VS 2026",
94+
vsLanguageMode: "csharp",
95+
},
8696
]);
8797

88-
export const LATEST_OUTPUT_LANGUAGE: LanguageName = LanguageName.CSharp_12;
98+
export const LATEST_OUTPUT_LANGUAGE: LanguageName = LanguageName.CSharp_14;
8999

90100
export const languageFromDisplayName = (name?: string) =>
91101
Object.entries(languageInfos).find(

vscode-extension/src/protocol/LanguageName.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ export enum LanguageName {
2020
CSharp_10 = "cs-10",
2121
CSharp_11 = "cs-11",
2222
CSharp_12 = "cs-12",
23+
CSharp_13 = "cs-13",
24+
CSharp_14 = "cs-14",
2325
}

0 commit comments

Comments
 (0)