Skip to content

Commit 09a7264

Browse files
zivkanjonathanpeppersjjonesczpremunakoeplinger
authored
Add Spectre.Console to 10.0 (#1485)
* Add Spectre.Console 0.52.0 (#1447) * Add Spectre.Console 0.52.0 (#1287) Context: #1287 * Update spectre-console submodule to 0.52.0 * Add patch file to delete problematic binaries: #1287 (comment) Co-authored-by: Jan Jones <[email protected]> * Remove binary patch again * Pin darc version * Add DelaySign and PublicSign to build arguments --------- Co-authored-by: Jan Jones <[email protected]> Co-authored-by: Premek Vysoky <[email protected]> Co-authored-by: Alexander Köplinger <[email protected]> * Update spectre.console (#1482) * Upgrade Spectre.Console to 0.54.0 * Make build work Add wcwsith.sources version 4.0.1 Update spectre-console's patch * Remove wcwidth.sources which was upgraded to 4.0.1 --------- Co-authored-by: Michael Simons <[email protected]> --------- Co-authored-by: Jonathan Peppers <[email protected]> Co-authored-by: Jan Jones <[email protected]> Co-authored-by: Premek Vysoky <[email protected]> Co-authored-by: Alexander Köplinger <[email protected]> Co-authored-by: Michael Simons <[email protected]>
1 parent adf19e6 commit 09a7264

Some content is hidden

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

44 files changed

+47498
-1
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@
2222
[submodule "vs-solutionpersistence"]
2323
path = src/externalPackages/src/vs-solutionpersistence
2424
url = https://github.com/microsoft/vs-solutionpersistence.git
25+
[submodule "spectre-console"]
26+
path = src/externalPackages/src/spectre-console
27+
url = https://github.com/spectreconsole/spectre.console

eng/Versions.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<HumanizerReleaseVersion>2.14.1</HumanizerReleaseVersion>
1616
<MSBuildLocatorReleaseVersion>1.10.2</MSBuildLocatorReleaseVersion>
1717
<SolutionPersistenceVersion>1.0.52</SolutionPersistenceVersion>
18+
<SpectreConsoleReleaseVersion>0.52.0</SpectreConsoleReleaseVersion>
1819
</PropertyGroup>
1920
<PropertyGroup>
2021
<!-- NuGet dependencies -->

eng/common/vmr-sync.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ set -e
164164
highlight 'Installing .NET, preparing the tooling..'
165165
source "./eng/common/tools.sh"
166166
InitializeDotNetCli true
167-
GetDarc
167+
GetDarc "1.1.0-beta.25514.2"
168168
dotnetDir=$( cd ./.dotnet/; pwd -P )
169169
dotnet=$dotnetDir/dotnet
170170

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
From 1250cea7252e45de242063668469b75ff7618ee0 Mon Sep 17 00:00:00 2001
2+
From: Andy Zivkovic <[email protected]>
3+
Date: Thu, 27 Nov 2025 10:42:15 +1030
4+
Subject: [PATCH] Remove PolySharp
5+
6+
---
7+
src/Spectre.Console/Spectre.Console.csproj | 4 ----
8+
1 file changed, 4 deletions(-)
9+
10+
diff --git a/src/Spectre.Console/Spectre.Console.csproj b/src/Spectre.Console/Spectre.Console.csproj
11+
index 5a9e161..991c064 100644
12+
--- a/src/Spectre.Console/Spectre.Console.csproj
13+
+++ b/src/Spectre.Console/Spectre.Console.csproj
14+
@@ -22,10 +22,6 @@
15+
<PackageReference Include="Wcwidth.Sources">
16+
<PrivateAssets>all</PrivateAssets>
17+
</PackageReference>
18+
- <PackageReference Include="PolySharp">
19+
- <PrivateAssets>all</PrivateAssets>
20+
- <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
21+
- </PackageReference>
22+
</ItemGroup>
23+
24+
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
25+
--
26+
2.43.0
27+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<Project Sdk="Microsoft.Build.NoTargets">
2+
3+
<PropertyGroup>
4+
<PackagesOutput>$(ProjectDirectory)src/Spectre.Console/bin/$(Configuration)/</PackagesOutput>
5+
<GlobalJsonFile>$(ProjectDirectory)global.json</GlobalJsonFile>
6+
<CustomRepoBuild>true</CustomRepoBuild>
7+
</PropertyGroup>
8+
9+
<Target Name="CustomRepoBuild">
10+
<PropertyGroup>
11+
<BuildCommandArgs>$(ProjectDirectory)src/Spectre.Console/Spectre.Console.csproj</BuildCommandArgs>
12+
<BuildCommandArgs>$(BuildCommandArgs) /p:Configuration=$(Configuration)</BuildCommandArgs>
13+
<BuildCommandArgs>$(BuildCommandArgs) /p:DelaySign=$(DelaySign)</BuildCommandArgs>
14+
<BuildCommandArgs>$(BuildCommandArgs) /p:PublicSign=$(PublicSign)</BuildCommandArgs>
15+
<BuildCommandArgs>$(BuildCommandArgs) /v:$(LogVerbosity)</BuildCommandArgs>
16+
<BuildCommandArgs>$(BuildCommandArgs) $(RedirectRepoOutputToLog)</BuildCommandArgs>
17+
<BuildCommandArgs>$(BuildCommandArgs) /p:Version=$(SpectreConsoleReleaseVersion)</BuildCommandArgs>
18+
<BuildCommandArgs>$(BuildCommandArgs) /p:TargetFrameworks=$(NetCurrent)</BuildCommandArgs>
19+
<BuildCommandArgs>$(BuildCommandArgs) /p:UseBuildTimeTools=false</BuildCommandArgs>
20+
<BuildCommandArgs>$(BuildCommandArgs) /p:IsAotCompatible=false</BuildCommandArgs>
21+
</PropertyGroup>
22+
23+
<Exec Command="$(DotNetTool) restore /bl:$(ArtifactsLogRepoDir)restore.binlog $(BuildCommandArgs)"
24+
EnvironmentVariables="@(EnvironmentVariables)"
25+
WorkingDirectory="$(ProjectDirectory)"
26+
IgnoreStandardErrorWarningFormat="true" />
27+
28+
<Exec Command="$(DotNetTool) build /bl:$(ArtifactsLogRepoDir)build.binlog $(BuildCommandArgs)"
29+
EnvironmentVariables="@(EnvironmentVariables)"
30+
WorkingDirectory="$(ProjectDirectory)"
31+
IgnoreStandardErrorWarningFormat="true" />
32+
33+
<Exec Command="$(DotNetTool) pack /bl:$(ArtifactsLogRepoDir)pack.binlog $(BuildCommandArgs)"
34+
EnvironmentVariables="@(EnvironmentVariables)"
35+
WorkingDirectory="$(ProjectDirectory)"
36+
IgnoreStandardErrorWarningFormat="true" />
37+
</Target>
38+
39+
</Project>
Submodule spectre-console added at e097281
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>netstandard2.0</TargetFrameworks>
5+
<PackageVersion>4.0.1</PackageVersion>
6+
<AssemblyName>Wcwidth.Sources</AssemblyName>
7+
</PropertyGroup>
8+
9+
</Project>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
namespace Wcwidth;
2+
3+
internal static class IntegerExtensions
4+
{
5+
public static bool Exist(this int[,] table, int value)
6+
{
7+
return Find(table, value) != 0;
8+
}
9+
10+
public static int Find(this int[,] table, int value)
11+
{
12+
if (table is null)
13+
{
14+
throw new ArgumentNullException(nameof(table));
15+
}
16+
17+
var min = 0;
18+
var max = table.GetUpperBound(0);
19+
int mid;
20+
21+
if (value < table[0, 0] || value > table[max, 1])
22+
{
23+
return 0;
24+
}
25+
26+
while (max >= min)
27+
{
28+
mid = (min + max) / 2;
29+
if (value > table[mid, 1])
30+
{
31+
min = mid + 1;
32+
}
33+
else if (value < table[mid, 0])
34+
{
35+
max = mid - 1;
36+
}
37+
else
38+
{
39+
return 1;
40+
}
41+
}
42+
43+
return 0;
44+
}
45+
}
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by a tool.
4+
//
5+
// Changes to this file may cause incorrect behavior and will be lost if
6+
// the code is regenerated.
7+
// </auto-generated>
8+
//------------------------------------------------------------------------------
9+
10+
using System;
11+
12+
namespace Wcwidth;
13+
14+
internal static partial class Vs16Table
15+
{
16+
private static int[,] GenerateTable(Unicode version)
17+
{
18+
return version switch
19+
{
20+
Unicode.Version_9_0_0 => Unicode_9_0_0(),
21+
_ => throw new InvalidOperationException("Unknown Unicode version"),
22+
};
23+
}
24+
25+
private static int[,] Unicode_9_0_0()
26+
{
27+
return new int[,]
28+
{
29+
{ 0x000023, 0x000023 },
30+
{ 0x00002A, 0x00002A },
31+
{ 0x000030, 0x000039 },
32+
{ 0x0000A9, 0x0000A9 },
33+
{ 0x0000AE, 0x0000AE },
34+
{ 0x00203C, 0x00203C },
35+
{ 0x002049, 0x002049 },
36+
{ 0x002122, 0x002122 },
37+
{ 0x002139, 0x002139 },
38+
{ 0x002194, 0x002199 },
39+
{ 0x0021A9, 0x0021AA },
40+
{ 0x002328, 0x002328 },
41+
{ 0x0023CF, 0x0023CF },
42+
{ 0x0023ED, 0x0023EF },
43+
{ 0x0023F1, 0x0023F2 },
44+
{ 0x0023F8, 0x0023FA },
45+
{ 0x0024C2, 0x0024C2 },
46+
{ 0x0025AA, 0x0025AB },
47+
{ 0x0025B6, 0x0025B6 },
48+
{ 0x0025C0, 0x0025C0 },
49+
{ 0x0025FB, 0x0025FC },
50+
{ 0x002600, 0x002604 },
51+
{ 0x00260E, 0x00260E },
52+
{ 0x002611, 0x002611 },
53+
{ 0x002618, 0x002618 },
54+
{ 0x00261D, 0x00261D },
55+
{ 0x002620, 0x002620 },
56+
{ 0x002622, 0x002623 },
57+
{ 0x002626, 0x002626 },
58+
{ 0x00262A, 0x00262A },
59+
{ 0x00262E, 0x00262F },
60+
{ 0x002638, 0x00263A },
61+
{ 0x002640, 0x002640 },
62+
{ 0x002642, 0x002642 },
63+
{ 0x00265F, 0x002660 },
64+
{ 0x002663, 0x002663 },
65+
{ 0x002665, 0x002666 },
66+
{ 0x002668, 0x002668 },
67+
{ 0x00267B, 0x00267B },
68+
{ 0x00267E, 0x00267E },
69+
{ 0x002692, 0x002692 },
70+
{ 0x002694, 0x002697 },
71+
{ 0x002699, 0x002699 },
72+
{ 0x00269B, 0x00269C },
73+
{ 0x0026A0, 0x0026A0 },
74+
{ 0x0026A7, 0x0026A7 },
75+
{ 0x0026B0, 0x0026B1 },
76+
{ 0x0026C8, 0x0026C8 },
77+
{ 0x0026CF, 0x0026CF },
78+
{ 0x0026D1, 0x0026D1 },
79+
{ 0x0026D3, 0x0026D3 },
80+
{ 0x0026E9, 0x0026E9 },
81+
{ 0x0026F0, 0x0026F1 },
82+
{ 0x0026F4, 0x0026F4 },
83+
{ 0x0026F7, 0x0026F9 },
84+
{ 0x002702, 0x002702 },
85+
{ 0x002708, 0x002709 },
86+
{ 0x00270C, 0x00270D },
87+
{ 0x00270F, 0x00270F },
88+
{ 0x002712, 0x002712 },
89+
{ 0x002714, 0x002714 },
90+
{ 0x002716, 0x002716 },
91+
{ 0x00271D, 0x00271D },
92+
{ 0x002721, 0x002721 },
93+
{ 0x002733, 0x002734 },
94+
{ 0x002744, 0x002744 },
95+
{ 0x002747, 0x002747 },
96+
{ 0x002763, 0x002764 },
97+
{ 0x0027A1, 0x0027A1 },
98+
{ 0x002934, 0x002935 },
99+
{ 0x002B05, 0x002B07 },
100+
{ 0x01F170, 0x01F171 },
101+
{ 0x01F17E, 0x01F17F },
102+
{ 0x01F321, 0x01F321 },
103+
{ 0x01F324, 0x01F32C },
104+
{ 0x01F336, 0x01F336 },
105+
{ 0x01F37D, 0x01F37D },
106+
{ 0x01F396, 0x01F397 },
107+
{ 0x01F399, 0x01F39B },
108+
{ 0x01F39E, 0x01F39F },
109+
{ 0x01F3CB, 0x01F3CE },
110+
{ 0x01F3D4, 0x01F3DF },
111+
{ 0x01F3F3, 0x01F3F3 },
112+
{ 0x01F3F5, 0x01F3F5 },
113+
{ 0x01F3F7, 0x01F3F7 },
114+
{ 0x01F43F, 0x01F43F },
115+
{ 0x01F441, 0x01F441 },
116+
{ 0x01F4FD, 0x01F4FD },
117+
{ 0x01F549, 0x01F54A },
118+
{ 0x01F56F, 0x01F570 },
119+
{ 0x01F573, 0x01F579 },
120+
{ 0x01F587, 0x01F587 },
121+
{ 0x01F58A, 0x01F58D },
122+
{ 0x01F590, 0x01F590 },
123+
{ 0x01F5A5, 0x01F5A5 },
124+
{ 0x01F5A8, 0x01F5A8 },
125+
{ 0x01F5B1, 0x01F5B2 },
126+
{ 0x01F5BC, 0x01F5BC },
127+
{ 0x01F5C2, 0x01F5C4 },
128+
{ 0x01F5D1, 0x01F5D3 },
129+
{ 0x01F5DC, 0x01F5DE },
130+
{ 0x01F5E1, 0x01F5E1 },
131+
{ 0x01F5E3, 0x01F5E3 },
132+
{ 0x01F5E8, 0x01F5E8 },
133+
{ 0x01F5EF, 0x01F5EF },
134+
{ 0x01F5F3, 0x01F5F3 },
135+
{ 0x01F5FA, 0x01F5FA },
136+
{ 0x01F6CB, 0x01F6CB },
137+
{ 0x01F6CD, 0x01F6CF },
138+
{ 0x01F6E0, 0x01F6E5 },
139+
{ 0x01F6E9, 0x01F6E9 },
140+
{ 0x01F6F0, 0x01F6F0 },
141+
{ 0x01F6F3, 0x01F6F3 },
142+
};
143+
}
144+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#if WCWIDTH
2+
#pragma warning restore
3+
#else
4+
#pragma warning disable
5+
#endif
6+
7+
namespace Wcwidth;
8+
9+
internal static partial class Vs16Table
10+
{
11+
private static readonly Dictionary<Unicode, int[,]> _lookup;
12+
private static readonly object _lock;
13+
14+
static Vs16Table()
15+
{
16+
_lookup = new Dictionary<Unicode, int[,]>();
17+
_lock = new object();
18+
}
19+
20+
public static int[,] GetTable(Unicode version)
21+
{
22+
if (!_lookup.TryGetValue(version, out var table))
23+
{
24+
lock (_lock)
25+
{
26+
if (_lookup.TryGetValue(version, out table))
27+
{
28+
return table;
29+
}
30+
31+
// Generate the table for the version dynamically
32+
// since we don't want to load everything into memory.
33+
table = GenerateTable(version);
34+
_lookup[version] = table;
35+
}
36+
}
37+
38+
return table;
39+
}
40+
}

0 commit comments

Comments
 (0)